From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26524 invoked by alias); 4 Nov 2012 12:49:42 -0000 Received: (qmail 26490 invoked by uid 48); 4 Nov 2012 12:49:28 -0000 From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/54838] [4.8 Regression] ICE: in merge_latch_edges, at cfgloop.c:678 with -ftracer Date: Sun, 04 Nov 2012 12:49:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek 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: 2012-11/txt/msg00273.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54838 --- Comment #5 from Marek Polacek 2012-11-04 12:49:27 UTC --- I think the problem is that we somehow arrive at this: loop_1 (header = 2, multiple latches, niter = ) { bb_2 (preds = {bb_0 }, succs = {bb_4 bb_3 }) { (note 5 0 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK) (insn 2 5 3 2 (set (reg/v/f:DI 60 [ b ]) (reg:DI 5 di [ b ])) ./pr54838.c:5 63 {*movdi_internal_rex64} (nil)) (insn 3 2 4 2 (set (reg/v/f:DI 61 [ c ]) (reg:DI 4 si [ c ])) ./pr54838.c:5 63 {*movdi_internal_rex64} (nil)) (note 4 3 7 2 NOTE_INSN_FUNCTION_BEG) (insn 7 4 14 2 (set (reg:SI 59 [ D.1735 ]) (mem:SI (reg/v/f:DI 61 [ c ]) [2 *c_3(D)+0 S4 A32])) 65 {*movsi_internal} (nil)) (insn 14 7 15 2 (set (reg:CCZ 17 flags) (compare:CCZ (reg:SI 59 [ D.1735 ]) (const_int 1 [0x1]))) ./pr54838.c:7 7 {*cmpsi_1} (nil)) (jump_insn 15 14 38 2 (set (pc) (if_then_else (eq (reg:CCZ 17 flags) (const_int 0 [0])) (label_ref:DI 20) (pc))) ./pr54838.c:7 595 {*jcc_1} (expr_list:REG_BR_PROB (const_int 3333 [0xd05]) (nil)) -> 20) } } , i.e. we have a loop which contains only the header. The rest of BBs are there, but in loop_0. When we call disambiguate_loops_with_multiple_latches, loop->latch is NULL on that loop, so we end up calling merge_latch_edges, but that ICEs because VEC_length (edge, latches) is of course 0.