Re: __attribute__ aligned could be more efficient

2015-03-29 Thread Mason
On 29/03/2015 17:35, Andreas Schwab wrote: > Mason wrote: > >> Consider the following program. [snip] > > This mailing list is about the development of gcc, for user questions > please use gcc-h...@gcc.gnu.org instead. Thanks, I will re-send my original message to gcc-help. Please be aware tha

Re: __attribute__ aligned could be more efficient

2015-03-29 Thread Andreas Schwab
Mason writes: > Hello everyone, > > Consider the following program. This mailing list is about the development of gcc, for user questions please use gcc-h...@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 paddi

__attribute__ aligned could be more efficient

2015-03-29 Thread Mason
Hello everyone, Consider the following program. #include #include struct foo1 { char s[80]; }; struct foo2 { char s[80]; } __attribute__ ((aligned (64))); struct bar1 { struct foo1 f; int i; }; struct bar2 { struct foo2 f; int i; }; #define P(arg) printf("sizeof(" #arg ") = %u\n", (unsigned)si