While trying to build gcc-4.5.0, I've got the following error : build/gengenrtl -h > tmp-genrtl.h /bin/sh: line 1: 2767 Segmentation fault build/gengenrtl > tmp-genrtl.c make[3]: *** [s-genrtl] Error 139 emerging gcc with BOOT_CFLAGS="-O2 -fno-delayed-branch" solves the issue.
Created attachment 234185 [details] Stripped down version of gengenrtl which triggers the issue Added stripped down version of gengenrtl.c to repro the issue. Observed behavior : gcc -O2 -> Segv gcc -O2 -fno-delayed-branch -> OK gcc -O1 -> OK gcc -O1 -freorder-blocks -> Segv gcc -O1 -freorder-blocks -fno-delayed-branch -> OK gcc -O0 -freorder-blocks -fdelayed-branch -> OK
This seems to be similar to PR 44469 : http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44469 The testcase is quite similar to the one I've attached but the workaround doesn't seem to help. I'm doublechecking right now.
What's the verdict?
According to the upstream bug report, it should be in 4.5.3, which was released months ago but isn't in the tree yet.
Fixed in 4.5.3.