Trying to build LLVM with current mainline g++ fails. Interestingly, it only fails at -O0, but at -O2 it works. Strange. %COMP.sh "--version" g++ (GCC) 3.4 20031208 (experimental) %COMP.sh "-c -O0" CommandLine.ii /mnt/hd/src/llvm/lib/Support/CommandLine.cpp: In function `void llvm::RemoveArgument(const char*, llvm::cl::Option*)': /mnt/hd/src/llvm/lib/Support/CommandLine.cpp:77: internal compiler error: in convert_from_eh_region_ranges_1, at except.c:1133 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. vs. <bkoz@roscoe> /home/bkoz %COMP.sh "-c -O2" CommandLine.ii g++: -lv3test: linker input file unused because linking not done
Created attachment 5325 [details] pre-processed file from LLVM cvs
Confirmed. A regression in 3.3 and mainline from 3.2.3. Here is something smaller: ---------------------- #include <string> bool foo(std::string s = std::string()) { return false; } void RemoveArgument() { (__builtin_expect (foo() && true, 1) ? 0 : (abort(), 0)); } ---------------------- g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc x.cc: In function `void RemoveArgument()': x.cc:9: internal compiler error: in convert_from_eh_region_ranges_1, at except.c:1133 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. g/x> g/x> g/x> g/x> g/x> /home/bangerth/bin/gcc-3.3.3-pre/bin/c++ -c x.cc x.cc: In function `void RemoveArgument()': x.cc:9: internal compiler error: in convert_from_eh_region_ranges_1, at except.c:1159 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. I'll work on something self-contained. W.
So here we go: --------------------- extern void abort (void) throw () __attribute__ ((__noreturn__)); struct X { ~X () throw() {} }; bool foo(X s = X()) { return false; } void bar() { (__builtin_expect (foo() && true, 1) ? 0 : (abort(), 0)); } ----------------------------- g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc x.cc: In function `void bar()': x.cc:11: internal compiler error: in convert_from_eh_region_ranges_1, at except.c:1133 Please submit a full bug report,
Subject: Re: ICE in convert_from_eh_region_ranges_1, at except.c:1133 >Confirmed. A regression in 3.3 and mainline from 3.2.3. Here is >something smaller: >---------------------- >#include <string> > >bool foo(std::string s = std::string()) { > return false; >} > >void RemoveArgument() { > (__builtin_expect (foo() && true, 1) ? 0 : (abort(), 0)); >} >---------------------- Wow, this reduction is pretty impressive. You went from 856k to 5 lines! Awesome. -benjamin
:-) And this one was even one of the simpler ones and took me less than 10 minutes. I've learned to find the cut-points in the string headers quickly, and what patterns eh-related bugs follow w.r.t. string and allocator classes. A year ago, this would have been a testcase I would have dreaded, and which would have taken me one or two hours to reduce. The pattern-matching powers of the human brain are impressive ;-) W.
From Phil's regression hunter: Search converges between 2003-03-23-trunk (#253) and 2003-03 -30-trunk (#254). : Search converges between 2003-03-23-3.3 (#85) and 2003-03-30-3.3 (#86).
The regression in PR 13392 was introduced or exposed with this patch: 2003-03-24 Jakub Jelinek <jakub@redhat.com> * dojump.c (do_jump): Handle UNSAVE_EXPR specially. The regression hunt took place on i686-pc-linux-gnu using the minimized test case from comment #3 compiled with default options, starting with the range identified by Phil's regression hunter.
This is Execption handling related (yes the ICE is eh also but if I compile the self-containted example with -fno-exceptions, it compiles just fine).
http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02330.html
Subject: Bug 13392 CVSROOT: /cvs/gcc Module name: gcc Changes by: jakub@gcc.gnu.org 2004-01-11 19:05:34 Modified files: gcc : ChangeLog builtins.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/opt: expect2.C Log message: PR middle-end/13392 * builtins.c (expand_builtin_expect_jump): Handle conditional jumps to drop through label. Don't fall back to SCC even when conditional jump has not been found. * g++.dg/opt/expect2.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.2224&r2=2.2225 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/builtins.c.diff?cvsroot=gcc&r1=1.270&r2=1.271 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3359&r2=1.3360 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/expect2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 13392 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: jakub@gcc.gnu.org 2004-01-11 19:13:13 Modified files: gcc : ChangeLog builtins.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/opt: expect2.C Log message: PR middle-end/13392 * builtins.c (expand_builtin_expect_jump): Handle conditional jumps to drop through label. Don't fall back to SCC even when conditional jump has not been found. * g++.dg/opt/expect2.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.872&r2=1.16114.2.873 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/builtins.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.165.2.9&r2=1.165.2.10 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.351&r2=1.2261.2.352 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/expect2.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
Fixed for 3.3.3.
Subject: Bug 13392 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_2-rhl8-branch Changes by: jakub@gcc.gnu.org 2004-02-28 11:16:07 Modified files: gcc : ChangeLog builtins.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/opt: expect2.C Log message: PR middle-end/13392 * builtins.c (expand_builtin_expect_jump): Handle conditional jumps to drop through label. Don't fall back to SCC even when conditional jump has not been found. * g++.dg/opt/expect2.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.13152.2.657.2.27.2.182&r2=1.13152.2.657.2.27.2.183 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/builtins.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.142.2.2.8.14&r2=1.142.2.2.8.15 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.1672.2.166.2.8.2.76&r2=1.1672.2.166.2.8.2.77 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/expect2.C.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=NONE&r2=1.1.20.1