From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3010 invoked by alias); 28 Jan 2013 14:03:53 -0000 Received: (qmail 2067 invoked by uid 48); 28 Jan 2013 14:03:20 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/55270] [4.8 Regression] ICE in get_loop_body, at cfgloop.c:823 Date: Mon, 28 Jan 2013 14:03:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mpolacek 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: 2013-01/txt/msg02573.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55270 --- Comment #9 from Richard Biener 2013-01-28 14:03:18 UTC --- When propagate_rhs_into_lhs alters the CFG from if () { if () exit_loop; } to if () { exit_loop; } it fails to fixup loop structure: /* Propagation into these nodes may make certain edges in the CFG unexecutable. We want to identify them as PHI nodes at the destination of those unexecutable edges may become degenerates. */ else if (gimple_code (use_stmt) == GIMPLE_COND || gimple_code (use_stmt) == GIMPLE_SWITCH || gimple_code (use_stmt) == GIMPLE_GOTO) { ... Now, for full propagation the edge wants marking as non-executable (which is done by removing it here - somewhat premature, as CFG cleanup is run afterwards anyway and that handles the situation correctly by calling fix_loop_structure). Index: gcc/tree-ssa-dom.c =================================================================== --- gcc/tree-ssa-dom.c (revision 195502) +++ gcc/tree-ssa-dom.c (working copy) @@ -3006,7 +3006,14 @@ eliminate_degenerate_phis (void) } if (cfg_altered) - free_dominance_info (CDI_DOMINATORS); + { + free_dominance_info (CDI_DOMINATORS); + if (current_loops) + { + calculate_dominance_info (CDI_DOMINATORS); + fix_loop_structure (NULL); + } + } /* Propagation of const and copies may make some EH edges dead. Purge such edges from the CFG as needed. */ fixes this (one more reason to fix loop structure at loop_optimizer_init instead ...)