Trying to build an updated hfsplus-tools - the 64-bit build results in http://koji.fedoraproject.org/koji/getfile?taskID=3797349&name=build.log which looks like it's probably not my fault. The 32-bit build seems fine. src.rpm is at http://cavan.codon.org.uk/~mjg59/tmp/hfsplus-tools-540.1.linux3-1.fc17.src.rpm .
Suspect this is http://llvm.org/bugs/show_bug.cgi?id=11926
I poked a bit at llvm/clang and rebuilding it with -O0 instead of -O2 fixed it for me. Certainly sounds very similar to the llvm bug linked in comment #1. Going to see if I can nail it down to a single optimization flag, instead of just turning everything off.
I managed to track it down to -ftree-pre that is enabled with -O2. When clang is built with gcc 4.7 using explicit "-O2 -fno-tree-pre", the build works fine on x86_64. Without it, clang segfaults building pretty much anything. I suspect this might be a gcc 4.7 optimization bug; apparently clang in Fedora isn't fully bootstrapped and is built using gcc. Adding Jakub Jelinek to CC for opinions.
If -O2 -fno-tree-pre works and -O2 doesn't, first narrow it down using a binary search between -O2 -fno-tree-pre and -O2 compiled objects to at least a single compilation unit, then you could use __attribute__((optimize (1))) (resp. __attribute__((optimize (2))) ) and/or -fno-inline to narrow it even further, read the problematic code, see if there aren't any e.g. aliasing warnings (-O2 enables -fstrict-aliasing), if you don't spot a bug in the gforth code after this and still suspect the compiler, turn that into self-contained minimal testcase (for the problematic routine add main that calls it with the right arguments, make the problematic routine __attribute__((noinline, noclone)) and stub out anything it calls, then file a gcc bugreport?
Thanks Jakub for the pointers. This will make it much easier to track down. Regarding aliasing warnings, apparently clang explicitly passes -fno-strict-aliasing to the compiler. However, Fedora RPM %{optflags} are inserted after -fno-strict-aliasing, so I guess the -O2 from %{optflags} negates the explicit -fno-strict-aliasing. In the mean time, I've built llvm-3.0-10 with -fno-tree-pre that should work around the crash for now. P.S. Some more info about the same clang segfault is at https://bugzilla.redhat.com/show_bug.cgi?id=800478
No, -fno-strict-aliasing -O2 doesn't enable strict aliasing, -O2 turns it on only when -f{,no-}strict-aliasing isn't explicit, otherwise only -fno-strict-aliasing -O2 -fstrict-aliasing would turn it back on.
llvm-3.0-10.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/llvm-3.0-10.fc17
Package llvm-3.0-10.fc17: * should fix your issue, * was pushed to the Fedora 17 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing llvm-3.0-10.fc17' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2012-4812/llvm-3.0-10.fc17 then log in and leave karma (feedback).
llvm-3.0-10.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report.