------- Comment #39 from nickc at redhat dot com 2008-10-06 18:16 ------- Subject: Re: [cygming] Invalid alignment for SSE store to .comm data generated with -O3
> yes alignment works, and even my test align program with 4.2 without patches > gives correct alignment to local and global symbols OK, so when you said: "so how with -fno-common can make aligned work?" did you really mean: "so how without -fno-common can make aligned work?" In which case the answer is - I do not know. The problem is that the PE/COFF file format does not support aligned commons. We could try to create an extension to the format to support them, but that would be non-standard. Another possibility would be to turn any common symbol with an alignment attribute into a weak symbol instead. This would work (I think, I have not tried it), provided that there are no other definitions of the same symbol with a different size. Which would possibly cause problems with FORTRAN programs but it is unlikely to be an issue with C/C++ programs. Another possibility is to modify the linker so that when it is placing common symbols into the .bss section of the output executable every symbol is aligned to the maximum alignment specified for any of the .bss sections of any input object file. This would probably waste huge amounts of space in the .bss section (for large programs anyway) but it ought to work. Cheers Nick -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216