From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4516 invoked by alias); 1 Feb 2011 12:04:02 -0000 Received: (qmail 4506 invoked by uid 22791); 1 Feb 2011 12:04:01 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_TM X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 01 Feb 2011 12:03:55 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/47559] ICE: verify_stmts failed: statement marked for throw, but doesn't with -fnon-call-exceptions and noexcept X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: ice-on-valid-code, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Keywords Status Last reconfirmed CC Component Ever Confirmed Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Tue, 01 Feb 2011 12:04:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-02/txt/msg00067.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47559 Richard Guenther changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code Status|UNCONFIRMED |NEW Last reconfirmed| |2011.02.01 12:03:49 CC| |rakdver at gcc dot gnu.org Component|middle-end |tree-optimization Ever Confirmed|0 |1 --- Comment #1 from Richard Guenther 2011-02-01 12:03:49 UTC --- LIM produces void foo(int*) (int * k) Eh tree: 1 must_not_throw { int k__lsm.1; : k__lsm.1_4 = MEM[(int *)k_1(D)]; : [MNT 1] k__lsm.1_5 = 0; : goto ; } failing to move the EH info. I think it should just give up here - it tries to, but only if loop exits via EH edges appear - which is not the case for must-not-throw. There is also no exit in that endless loop anyway - which shows the transform isn't valid as if *k points to readonly memory the testcase now will fail to trap as the store never happens. Which means this is wrong-code as well (should we simply not do store-motion for loops without exits?). Thus, the following would fix the wrong-code issue (but probably not the ICE in a more generalized test): Index: gcc/tree-ssa-loop-im.c =================================================================== --- gcc/tree-ssa-loop-im.c (revision 169434) +++ gcc/tree-ssa-loop-im.c (working copy) @@ -2368,6 +2368,9 @@ loop_suitable_for_sm (struct loop *loop unsigned i; edge ex; + if (VEC_empty (edge, exits)) + return false; + FOR_EACH_VEC_ELT (edge, exits, i, ex) if (ex->flags & (EDGE_ABNORMAL | EDGE_EH)) return false; I am testing that change now.