From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27067 invoked by alias); 27 Mar 2012 13:52:04 -0000 Received: (qmail 27049 invoked by uid 22791); 27 Mar 2012 13:52:02 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_CF 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, 27 Mar 2012 13:51:49 +0000 From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/51106] [4.5/4.6 Regression] ICE in move_insn, at haifa-sched.c:2314 Date: Tue, 27 Mar 2012 13:55:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: 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 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: 2012-03/txt/msg02331.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51106 --- Comment #17 from rguenther at suse dot de 2012-03-27 13:50:57 UTC --- On Tue, 27 Mar 2012, abel at gcc dot gnu.org wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51106 > > --- Comment #16 from Andrey Belevantsev 2012-03-27 13:28:03 UTC --- > So, something like the below patch, or even better -- as we want to fold all > RTL-build related pseudo passes into expand, make pass_instantiate_virtual_regs > also the expand part (thus, until the into_cfglayout pass), and then the new > cleanup_cfg will nicely work at the end of expand. > > diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c > index b86cc74..0c27d11 100644 > --- a/gcc/cfgrtl.c > +++ b/gcc/cfgrtl.c > @@ -2261,7 +2261,7 @@ purge_dead_edges (basic_block bb) > edge e; > rtx insn = BB_END (bb), note; > bool purged = false; > - bool found; > + bool found, fallthru; > edge_iterator ei; > > if (DEBUG_INSN_P (insn) && insn != BB_HEAD (bb)) > @@ -2433,16 +2433,22 @@ purge_dead_edges (basic_block bb) > as these are only created by conditional branches. If we find such an > edge we know that there used to be a jump here and can then safely > remove all non-fallthru edges. */ > - found = false; > + found = fallthru = false; > FOR_EACH_EDGE (e, ei, bb->succs) > - if (! (e->flags & (EDGE_COMPLEX | EDGE_FALLTHRU))) > - { > + { > + if (! (e->flags & (EDGE_COMPLEX | EDGE_FALLTHRU))) > found = true; > - break; > - } > - > + if (e->flags & (EDGE_FALLTHRU | EDGE_FAKE)) > + fallthru = true; > + } > if (!found) > return purged; > + if (!fallthru) > + { > + gcc_assert (single_succ_p (bb)); > + single_succ_edge (bb)->flags |= EDGE_FALLTHRU; > + return purged; > + } > > /* Remove all but the fake and fallthru edges. The fake edge may be > the only successor for this block in the case of noreturn > Looks reasonable. Though I think that whoever removed the fallthru edge should have adjusted the flags on the others.