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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
It is not about the alignment of the first field but rather the alignment of a
struct. BUT variable alignment is controlled separately from struct alignment.

That is the point I am trying to make. If you want a variable to have a smaller
alignment than what the target backend wants to give it, then you need to use
the aligned attributes.

What pragma pack does is change the alignment of the struct so that if you do:

struct f *t;
....

t->field1 = 10;

It will be an unaligned access there.

But if you have a variable, the alignment will be different and the compiler
can increase still to be more efficient.

Reply via email to