[Bug c/60360] __attribute((aligned(...))) changes sizeof(...) of struct

2014-02-28 Thread dabler at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60360 --- Comment #6 from DaBler --- When I call sizeof(...) on the int type (instead of a variable), it is the same: typedef int TypeInt __attribute((aligned(64))); printf("%zu %zu\n", sizeof(TypeInt), alignof(TypeInt)); // Output: 4 64 Moreover, It

[Bug c/60360] __attribute((aligned(...))) changes sizeof(...) of struct

2014-02-27 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60360 --- Comment #5 from Marc Glisse --- When you call sizeof on a type T, by definition, it tells you how far 2 consecutive elements are in an array of T (obviously that needs to be a multiple of the alignment). When you call it on a variable like thi

[Bug c/60360] __attribute((aligned(...))) changes sizeof(...) of struct

2014-02-27 Thread dabler at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60360 --- Comment #4 from DaBler --- I see no reason why should not another variable be padded after struct as well.

[Bug c/60360] __attribute((aligned(...))) changes sizeof(...) of struct

2014-02-27 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60360 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/60360] __attribute((aligned(...))) changes sizeof(...) of struct

2014-02-27 Thread dabler at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60360 --- Comment #2 from DaBler --- The output of gcc -v: Using built-in specs. COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.6.3/gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/lto-wrapper Target: x86_64-pc-linux-gnu Configured wi

[Bug c/60360] __attribute((aligned(...))) changes sizeof(...) of struct

2014-02-27 Thread dabler at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60360 --- Comment #1 from DaBler --- Created attachment 32227 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32227&action=edit he preprocessed file that triggers the bug Output: 64 64 64 64 4 64 4 64 4 64 Expected output: 4 64 4 64 4 64 4 64 4 6