------- Comment #21 from brian at dessent dot net 2008-09-29 20:06 ------- Subject: Re: [cygming] Invalid alignment for SSE store to .comm data generated with -O3
This is an example of what I'm talking about: the bar() function is optimized away to simply "return 0" because the compiler assumes the alignment is correct without having to actually emit the code to check it: $ echo 'char foo[1] __attribute__((aligned(16))); int bar() { if((int)foo % 16) return 1; else return 0; }' | i686-pc-mingw32-gcc -x c - -S -o - -fomit-frame-pointer .file "" .text .globl _bar .def _bar; .scl 2; .type 32; .endef _bar: movl $0, %eax ret .comm _foo, 16 # 1 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216