[PATCH][RFC] Fix __alignof__ of global variables on SystemZ

Richard Smith richard at metafoo.co.uk
Mon Apr 20 15:02:18 PDT 2015


LGTM

On Mon, Mar 30, 2015 at 11:21 AM, Ulrich Weigand <Ulrich.Weigand at de.ibm.com>
wrote:

>
>
> Hello,
>
> SystemZ prefers to align all global variables to two bytes, which is
> implemented by setting the TargetInfo member MinGlobalAlign.
>
> However, for compatibility with existing compilers this should *not*
> change the ABI alignment value as retrieved via __alignof__, which
> it currently does.
>
> This patch fixes the issue by having ASTContext::getDeclAlign ignore
> the MinGlobalAlign setting in the ForAlignof case.
>
> Since SystemZ is the only platform setting MinGlobalAlign, this should
> cause no change for any other target.
>
> (See attached file: clang-align-global)
>
>
> Mit freundlichen Gruessen / Best Regards
>
> Ulrich Weigand
>
> --
>   Dr. Ulrich Weigand | Phone: +49-7031/16-3727
>   STSM, GNU/Linux compilers and toolchain
>   IBM Deutschland Research & Development GmbH
>   Vorsitzende des Aufsichtsrats: Martina Koederitz | Geschäftsführung: Dirk
> Wittkopp
>   Sitz der Gesellschaft: Böblingen | Registergericht: Amtsgericht
> Stuttgart, HRB 243294
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150420/36d266eb/attachment.html>


More information about the cfe-commits mailing list