From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8464 invoked by alias); 12 Dec 2011 12:46:14 -0000 Received: (qmail 8453 invoked by uid 22791); 12 Dec 2011 12:46:13 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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, 12 Dec 2011 12:45:58 +0000 From: "vries at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/51471] [4.7 Regression] gcc.c-torture/execute/20040811-1.c and gcc.c-torture/execute/vla-dealloc-1.c fails at -O3 -g on mips64-linux-gnu Date: Mon, 12 Dec 2011 12:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.0 X-Bugzilla-Changed-Fields: CC 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: 2011-12/txt/msg01244.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51471 vries at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vries at gcc dot gnu.org --- Comment #5 from vries at gcc dot gnu.org 2011-12-12 12:45:53 UTC --- I can reproduce this: 20040811-1.c.220r.vartrack: ... (jump_insn:TI 82 77 93 3 (set (pc) (if_then_else (ne (reg/v:SI 3 $3 [orig:210 nD.1374 ] [210]) (reg:SI 7 $7 [255])) (label_ref:SI 30) (pc))) 20040811-1.c:16 434 {*branch_equalitysi} (expr_list:REG_EQUAL (if_then_else (ne (reg/v:SI 3 $3 [orig:210 nD.1374 ] [210]) (const_int 1000000 [0xf4240])) (label_ref:SI 30) (pc)) (expr_list:REG_BR_PROB (const_int 9899 [0x26ab]) (nil))) -> 30) (note 93 82 133 4 [bb 4] NOTE_INSN_BASIC_BLOCK) (note 133 93 122 4 NOTE_INSN_EPILOGUE_BEG) (insn 122 133 123 4 (clobber (mem/c:BLK (reg/f:SI 29 $sp) [4 A8])) 20040811-1.c:19 -1 (nil)) (insn/f:TI 123 122 148 4 (set (reg/f:SI 29 $sp) (reg/f:SI 30 $fp)) 20040811-1.c:19 280 {*movsi_internal} (expr_list:REG_CFA_DEF_CFA (plus:SI (reg/f:SI 29 $sp) (const_int 32 [0x20])) (nil))) ... 20040811-1.c.221r.mach: ... (insn 153 77 93 (sequence [ (jump_insn:TI 82 77 123 (set (pc) (if_then_else (ne (reg/v:SI 3 $3 [orig:210 nD.1374 ] [210]) (reg:SI 7 $7 [255])) (label_ref:SI 30) (pc))) 20040811-1.c:16 434 {*branch_equalitysi} (expr_list:REG_BR_PRED (const_int 14 [0xe]) (expr_list:REG_EQUAL (if_then_else (ne (reg/v:SI 3 $3 [orig:210 nD.1374 ] [210]) (const_int 1000000 [0xf4240])) (label_ref:SI 30) (pc)) (expr_list:REG_BR_PROB (const_int 9899 [0x26ab]) (nil)))) -> 30) (insn/f:TI 123 82 93 (set (reg/f:SI 29 $sp) (reg/f:SI 30 $fp)) 280 {*movsi_internal} (expr_list:REG_CFA_DEF_CFA (plus:SI (reg/f:SI 29 $sp) (const_int 32 [0x20])) (nil))) ]) 20040811-1.c:16 -1 (nil)) (note 93 153 133 [bb 4] NOTE_INSN_BASIC_BLOCK) (note 133 93 122 NOTE_INSN_EPILOGUE_BEG) (insn 122 133 148 (clobber (mem/c:BLK (reg/f:SI 29 $sp) [4 A8])) 20040811-1.c:19 -1 (nil)) ... This looks similar to PR51271. In both cases, an insn from the epilogue is moved to before the epilogue by delay slot scheduling during pass_machine_reorg, which causes an inconsistent cfa state. Indeed the clobber 122 reads $29 and the moved insn 123 sets $29, so if delay slot scheduling would handle clobbers, that should have stopped it. But resource.c:mark_referenced_resources seems to ignore standalone clobbers: ... case CLOBBER: return; ... Furthermore, in PR51271 both insn 141 and insn 143 are moved before the epilogue, but the insn causing the assert AFAIU is insn 141, which is both before the clobber, and not interfering with the clobber: ... (note 155 81 141 9 NOTE_INSN_EPILOGUE_BEG) (insn 141 155 142 9 (set (reg:DI 28 $28) (mem/c:DI (plus:SI (reg/f:SI 29 $sp) (const_int 8 [0x8])) [4 S8 A64])) res_hconf.c:11 278 {*movdi_64bit} (nil)) (insn 142 141 143 9 (clobber (mem/c:BLK (reg/f:SI 29 $sp) [4 A8])) res_hconf.c:11 -1 (nil)) (insn/f 143 142 89 9 (set (reg/f:SI 29 $sp) (plus:SI (reg/f:SI 29 $sp) (const_int 16 [0x10]))) res_hconf.c:11 10 {*addsi3} (expr_list:REG_CFA_DEF_CFA (reg/f:SI 29 $sp) (expr_list:REG_CFA_RESTORE (reg:DI 28 $28) (nil)))) ... So my question is: what is the mechanism that should prevent epilogue insns from being moved to before the epilogue?