The following valid C++ code gives an ICE with gcc 3.3.2 when no optimization is used. With -O, -O2 or -O3 the code compiles. struct A { ~A(); float f(float x); float g() const {return 0;} }; void h() { A a, b; a.f(b.g() + 1); }
Indeed. Crashes 3.3.2 and mainline. According to Phil's regression checker, the regression was introduced between 2003-09-21-trunk (#407) and 2003-09-22-trunk (#408).
This is 2003-09-22 Olivier Hainque <hainque@act-europe.fr> PR target/9786 * reg-stack.c (convert_regs_1): Purge possible dead eh edges after potential deletion of trapping insn. Avoids later ICE from call to fixup_abnormal_edges. (convert_regs_2): Stack the current block successors before processing this block, that is, before the potential deletion of dead edges by convert_regs_1, because these edges have been used to initialize the predecessors count. Since I checked in the patch, I'll investigate.
This is really x86-specific.
Subject: Bug 12712 CVSROOT: /cvs/gcc Module name: gcc Changes by: ebotcazou@gcc.gnu.org 2003-10-25 12:55:18 Modified files: gcc : ChangeLog reg-stack.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/opt: reg-stack3.C Log message: PR target/12712 * reg-stack.c (convert_regs_1): Create an arbitrary input stack if the block has no predecessors. (convert_regs_2): Document the problem with successors whose only predecessor is the block to be processed. (convert_regs): Don't create the arbitrary input stack here. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1548&r2=2.1549 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/reg-stack.c.diff?cvsroot=gcc&r1=1.135&r2=1.136 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3144&r2=1.3145 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/reg-stack3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 12712 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: ebotcazou@gcc.gnu.org 2003-10-25 13:00:42 Modified files: gcc : ChangeLog reg-stack.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/opt: reg-stack3.C Log message: PR target/12712 * reg-stack.c (convert_regs_1): Create an arbitrary input stack if the block has no predecessors. (convert_regs_2): Document the problem with successors whose only predecessor is the block to be processed. (convert_regs): Don't create the arbitrary input stack here. 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.787&r2=1.16114.2.788 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/reg-stack.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.117.2.4&r2=1.117.2.5 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.309&r2=1.2261.2.310 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/reg-stack3.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
See http://gcc.gnu.org/ml/gcc-patches/2003-10/msg02117.html