[dragonegg PATCH] Use the preferred alignment when deciding whether to use an explicit alignment

Duncan Sands baldrick at free.fr
Tue Apr 2 14:23:09 PDT 2013


Hi Peter,

> Use the preferred alignment when deciding whether to use an explicit
> alignment.
>
> OK to commit?

I don't like it.  An alignment of 0 for a global variable guarantess it gets
at least the ABI alignment, but maybe no more.  The optimizers may increase it
in cases where that seems safe and profitable to them, usually to the preferred
alignment, but they may not always do so.  In such cases (where the global only
gets the ABI alignment) your patch would decrease the alignment from what the
user requested (the preferred alignment) to the ABI alignment, which would be
wrong.

Ciao, Duncan.



More information about the llvm-commits mailing list