This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: __attribute__ aligned could be more efficient


Mason <slash.tmp@free.fr> writes:

> Hello everyone,
>
> Consider the following program.

This mailing list is about the development of gcc, for user questions
please use gcc-help@gcc.gnu.org instead.

> gcc lays out bar2 like this:
> foo2(80) padding(48) i(4) padding(60)

struct foo2 has size 128, not 80.  The padding is part of the type.

> But it seems (to me) that gcc could fit the "int" field in the
> first padding, to save space:
>
> foo2(80) i(4) padding(44)

Structure members cannot overlap.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]