[Bug c/69502] attribute aligned reduces alignment contrary to documentation

sven.koehler at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Nov 12 14:28:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69502

--- Comment #5 from Sven <sven.koehler at gmail dot com> ---
(In reply to sandra from comment #4)
> Fixed on trunk.

It's good thing that the documentation reflects the behavior of gcc. 

But on the other hand, having the align attribute work in both directions is a
bad idea, IMHO.

Using an attribute to specify an alignment guarantee (setting a lower bound on
the actual alignment) is a benign thing.

However, forcing lowering the alignment guarantee usually indicates some sort
of "trickery" that may force the compiler to circumvent certain limitations of
the underlying platform.

These two concepts (increasing alignment, lowering alignment) should be kept
strictly separate.


More information about the Gcc-bugs mailing list