https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58416
--- Comment #11 from Paul Eggert <eggert at cs dot ucla.edu> --- (In reply to Richard Biener from comment #10) > The remaining issue is analyzed to be caused by SRA so you can check whether > -fno-tree-sra fixes it for you. Thanks, it does, and I modified the Emacs 'configure' script here: https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=9f4fc6608212191e1a9e07bf89f38ba9e4ea786c so that, when using GCC 4 or later on x86, Emacs 'configure' appends to CFLAGS either the option -mfpmath=sse (if the target is known to support SSE2, e.g., because -msse2 is also given) or the option -fno-tree-sra (if not). It strikes me that GCC could do this itself, as a crude workaround for all programs. That is, when compiling for x86 and -mfpmath=sse is not in effect, GCC could automatically disable tree-sra for the compilation unit. Or it could be more selective and disable tree-sra only if the compilation unit defines a union that could cause the trouble. Although such a patch would hurt the performance of the generated code, that's better than generating wrong code that works only 99.9% of the time.