From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7266 invoked by alias); 24 Dec 2009 07:39:38 -0000 Received: (qmail 7234 invoked by uid 48); 24 Dec 2009 07:39:24 -0000 Date: Thu, 24 Dec 2009 07:39:00 -0000 Message-ID: <20091224073924.7233.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug rtl-optimization/42388] [4.5 Regression] ICE in move_bb_info with sel-sched and modulo-sched for 176.gcc In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "abel at gcc dot gnu dot org" 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: 2009-12/txt/msg02312.txt.bz2 ------- Comment #3 from abel at gcc dot gnu dot org 2009-12-24 07:39 ------- The problem was that the failing assert is actually too strict, when an empty block is removed, its predecessor could be outside the region. After fixing this, I have also further robustified the function to expect empty blocks with no succs or preds, as this problem showed itself yet another time via the single failed test of the patch on ia64. * sel-sched-ir.c (maybe_tidy_empty_bb): Do not delete empty blocks that have no predecessors nor successors. Do not call move_bb_info for empty blocks outside of current region. --- gcc/sel-sched-ir.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index 3c2989a..0950f2a 100644 --- a/gcc/sel-sched-ir.c +++ b/gcc/sel-sched-ir.c @@ -3519,12 +3519,15 @@ maybe_tidy_empty_bb (basic_block bb) bool rescan_p; /* Keep empty bb only if this block immediately precedes EXIT and - has incoming non-fallthrough edge. Otherwise remove it. */ + has incoming non-fallthrough edge, or it has no predecessors or + successors. Otherwise remove it. */ if (!sel_bb_empty_p (bb) || (single_succ_p (bb) && single_succ (bb) == EXIT_BLOCK_PTR && (!single_pred_p (bb) - || !(single_pred_edge (bb)->flags & EDGE_FALLTHRU)))) + || !(single_pred_edge (bb)->flags & EDGE_FALLTHRU))) + || EDGE_COUNT (bb->preds) == 0 + || EDGE_COUNT (bb->succs) == 0) return false; /* Do not attempt to redirect complex edges. */ @@ -3574,7 +3577,8 @@ maybe_tidy_empty_bb (basic_block bb) { gcc_assert (pred_bb != NULL); - move_bb_info (pred_bb, bb); + if (in_current_region_p (pred_bb)) + move_bb_info (pred_bb, bb); remove_empty_bb (bb, true); } -- abel at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |abel at gcc dot gnu dot org, | |amonakov at gcc dot gnu dot | |org AssignedTo|unassigned at gcc dot gnu |abel at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2009-12-24 07:39:24 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42388