Emacs 23.3 built with USE="X Xaw3d -gtk -motif" fails with a segmentation fault at runtime. This is with -O2 in CFLAGS, on amd64. The problem disappears when -fno-strict-aliasing is added to CFLAGS. I've narrowed it down further: - compile src/xterm.c with -O1, compile the rest of the sources with -O2 => Success - compile src/xterm.c with -O2, compile the rest of the sources with -O1 => Failure - compile src/xterm.c with -O2 -fno-strict-aliasing, compile the rest of the sources with -O2 => Success - compile src/xterm.c with -O1 -fgcse -fstrict-aliasing, compile the rest of the sources with -O1 => Failure
Created attachment 265413 [details] build log
Created attachment 265415 [details] emerge --info
Created attachment 265417 [details] gdb backtrace
FWIW, this happens with all of GCC 4.3.5, 4.4.5, and 4.5.2.
Reported upstream. I'll add -fno-strict-aliasing as a workaround in the ebuild.
Quoting from the upstream bug <https://debbugs.gnu.org/8217#32>: ... I find that the workaround of adding -fno-strict-aliasing to CFLAGS wasn't present for version 24.1, and there never were any bugs reported to us. This seems to indicate that the problem had disappeared already in early Emacs 24 versions. However, I also cannot reproduce this any more with Emacs 23.4 and GCC 5.4.0 (nor with GCC 4.9.3). So it may well be that this issue wasn't with Emacs but with GCC.