From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31046 invoked by alias); 27 Feb 2012 20:51:07 -0000 Received: (qmail 31031 invoked by uid 22791); 27 Feb 2012 20:51:06 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_ZJ 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; Mon, 27 Feb 2012 20:50:53 +0000 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/48133] [4.5/4.6/4.7 Regression] ICE: in get_loop_body, at cfgloop.c:831 with -O -funroll-loops -fthread-jumps -fno-tree-ch Date: Mon, 27 Feb 2012 21:06: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: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.5.4 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-02/txt/msg02621.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48133 --- Comment #7 from Uros Bizjak 2012-02-27 20:50:46 UTC --- I have done a bit of debugging here. The problem starts in peel_loop_completely, loop-unroll.c. Before remove_path (ein), we have: loop_0 (header = 0, latch = 1, niter = ) { bb_2 (preds = {bb_0 }, succs = {bb_3 }) bb_9 (preds = {bb_8 }, succs = {bb_1 }) loop_1 (header = 3, latch = 10, niter = ) { bb_3 (preds = {bb_2 bb_10 }, succs = {bb_4 }) bb_10 (preds = {bb_5 }, succs = {bb_3 }) loop_2 (header = 4, latch = 11, niter = ) { bb_4 (preds = {bb_11 bb_3 }, succs = {bb_7 bb_5 }) bb_5 (preds = {bb_4 }, succs = {bb_6 bb_10 }) bb_6 (preds = {bb_7 bb_5 }, succs = {bb_7 }) bb_7 (preds = {bb_4 bb_6 }, succs = {bb_6 bb_8 }) bb_8 (preds = {bb_7 }, succs = {bb_11 bb_9 }) bb_11 (preds = {bb_8 }, succs = {bb_4 }) } } } We cancel loop2 completely and path ( 8 -> 11), and we get: loop_0 (header = 0, latch = 1, niter = ) { bb_2 (preds = {bb_0 }, succs = {bb_3 }) bb_8 (preds = {bb_7 }, succs = {bb_9 }) bb_9 (preds = {bb_8 }, succs = {bb_1 }) loop_1 (header = 3, latch = 10, niter = ) { bb_3 (preds = {bb_2 bb_10 }, succs = {bb_4 }) bb_4 (preds = {bb_3 }, succs = {bb_7 bb_5 }) bb_5 (preds = {bb_4 }, succs = {bb_6 bb_10 }) bb_10 (preds = {bb_5 }, succs = {bb_3 }) bb_6 (preds = {bb_7 bb_5 }, succs = {bb_7 }) bb_7 (preds = {bb_4 bb_6 }, succs = {bb_6 bb_8 }) } } Analysing loop_1 through get_loop_body -> get_loop_body_with_size -> dfs_enumerate_from (..., 1 /* reverse */, ...), we visit only BBs 3, 10, 5 and 4, leaving out BBs 6 and 7. This crashes compilation later in get_loop_body: gcc_assert (tv == loop->num_nodes); since tv == 4 and loop->num_nodes == 6.