Summary: | [3.3 regression] ICE in make_label_edge with -fnon-call-exceptions -fno-gcse -O2 | ||
---|---|---|---|
Product: | gcc | Reporter: | nick |
Component: | rtl-optimization | Assignee: | Eric Botcazou <ebotcazou> |
Status: | RESOLVED FIXED | ||
Severity: | critical | CC: | gcc-bugs, mark |
Priority: | P2 | Keywords: | ice-on-valid-code |
Version: | 3.3.1 | ||
Target Milestone: | 3.3.2 | ||
Host: | i686-pc-linux-gnu | Target: | i686-pc-linux-gnu |
Build: | i686-pc-linux-gnu | Known to work: | |
Known to fail: | Last reconfirmed: | 2003-09-11 01:43:47 | |
Attachments: | bzip2 compressed preprocessed test case for pr 12215 |
Description
nick
2003-09-08 20:12:20 UTC
Created attachment 4719 [details] bzip2 compressed preprocessed test case for pr 12215 *** Bug 12214 has been marked as a duplicate of this bug. *** Confirmed. A regression on 3.3 branch only. W. This one was fairly painless compared to some of the optimization PRs: --------------------------- struct B { ~B() throw() {} }; struct X { X(const char*, const B&); ~X() {} }; bool m(); void f(int &i, float &arg0); void g (const char **argv) { float val; int i = 1; try { while ( i < 1 ) { X arg(argv[i], B()); if (m()) throw(0); f(i, val); } } catch (...) {} } ------------------------------------ It only fails with 3.3, but that doesn't mean that the bug is not also present in latent form on mainline, of course: g/x> /home/bangerth/bin/gcc-3.3.2-pre/bin/c++ -fnon-call-exceptions -fno-gcse -O2 -c y.cc y.cc: In function `void g(const char**)': y.cc:27: internal compiler error: in make_label_edge, at cfgbuild.c:238 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. W. Related to PR opt/11083. Investigating. Patch: http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00809.html Erratum: http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00936.html Subject: Re: [3.3 regression] ICE in
make_label_edge with -fnon-call-exceptions -fno-gcse -O2
On Fri, 2003-10-03 at 23:17, ebotcazou at gcc dot gnu dot org wrote:
> PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12215
Let's call the possibly-trapping insn I. Let's call the next nonnote
insn after I N.
This patch changes the compiler to emit the new instruction (X) right
before N, rather than right after I. Now, N and I are in different
basic blocks. So, X will be executed any time control enters the block
containing N, even if not falling through from I. Won't that be wrong?
Thanks,
No, because I think we are guaranteed that the control flow can't enter block(N) without falling through from block(I) by cse_set_around_loop, because we are guaranteed there is no label between them: /* Look for an insn in front of LOOP_START that sets something in the desired mode to SET_SRC (x) before we hit a label or CALL_INSN. */ for (p = prev_nonnote_insn (loop_start); p && GET_CODE (p) != CALL_INSN && GET_CODE (p) != CODE_LABEL; p = prev_nonnote_insn (p)) [sorry, I should have mentioned it in my first message]. Subject: Re: [3.3 regression] ICE in
make_label_edge with -fnon-call-exceptions -fno-gcse -O2
On Mon, 2003-10-06 at 00:20, ebotcazou at gcc dot gnu dot org wrote:
> PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12215
OK, it sounds like you've thought this through carefully, and your
explanation makes sense.
Your patch is OK, then.
Thanks,
Subject: Bug 12215 CVSROOT: /cvs/gcc Module name: gcc Changes by: ebotcazou@gcc.gnu.org 2003-10-06 09:18:01 Modified files: gcc : ChangeLog cse.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/opt: cfg2.C Log message: PR optimization/12215 * cse.c (cse_set_around_loop): Emit the move at the beginning of the next basic block for trapping sets. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1297&r2=2.1298 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cse.c.diff?cvsroot=gcc&r1=1.271&r2=1.272 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3097&r2=1.3098 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/cfg2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 Subject: Bug 12215 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: ebotcazou@gcc.gnu.org 2003-10-06 09:24:18 Modified files: gcc : ChangeLog cse.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/opt: cfg2.C Log message: PR optimization/12215 * cse.c (cse_set_around_loop): Emit the move at the beginning of the next basic block for trapping sets. 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.772&r2=1.16114.2.773 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cse.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.244.2.2&r2=1.244.2.3 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.298&r2=1.2261.2.299 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/cfg2.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1 Original patch applied. |