From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23689 invoked by alias); 20 Mar 2015 17:46:53 -0000 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 Received: (qmail 23611 invoked by uid 48); 20 Mar 2015 17:46:49 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/65496] ICE: in maybe_record_trace_start, at dwarf2cfi.c:2318 with -O3 -fsched2-use-superblocks -mavx512dq --param=max-pending-list-length=0 Date: Fri, 20 Mar 2015 18:10: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-Version: 5.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg02149.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65496 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rth at gcc dot gnu.org --- Comment #2 from Jakub Jelinek --- And the problem is that with these weirdo scheduling options the scheduler schedules the (insn/f:TI 620 60 37 2 (set (reg:DI 39 r10) (plus:DI (reg/f:DI 7 sp) (const_int 8 [0x8]))) pr65496.c:3 214 {*leadi} (nil)) instruction before the shrink-wrapping conditional jump: (jump_insn:TI 38 45 43 2 (set (pc) (if_then_else (eq (reg:CCZ 17 flags) (const_int 0 [0])) (label_ref:DI 645) (pc))) pr65496.c:4 613 {*jcc_1} (expr_list:REG_DEAD (reg:CCZ 17 flags) (int_list:REG_BR_PROB 900 (nil))) -> 645) At the end of the function we have: (insn/f:TI 641 640 645 40 (set (reg/f:DI 7 sp) (plus:DI (reg:DI 39 r10) (const_int -8 [0xfffffffffffffff8]))) pr65496.c:6 214 {*leadi} (expr_list:REG_DEAD (reg:DI 39 r10) (expr_list:REG_CFA_DEF_CFA (plus:DI (reg/f:DI 7 sp) (const_int 8 [0x8])) (nil)))) (code_label 645 641 644 41 106 "" [1 uses]) (note 644 645 663 41 [bb 41] NOTE_INSN_BASIC_BLOCK) (jump_insn 663 644 643 41 (parallel [ (simple_return) (unspec [ (const_int 0 [0]) ] UNSPEC_REP) ]) pr65496.c:6 682 {simple_return_internal_long} (nil)) (barrier 643 663 355) And the problem is that because the r10 = rsp + 8 frame related instruction is moved before the shrink-wrapping jump we assume CFA is in r10 + 0, but before fallthru into the return we have a CFA restore note to use r8 + 8 again as CFA (not really needed in this case, but desirable for the case when the r10 = rsp + 8 instruction isn't moved. Richard, any thoughts what to do about this? Avoid scheduling frame related instructions across conditional jumps? Something else?