From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21763 invoked by alias); 16 Jul 2014 08:29:31 -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 21696 invoked by uid 48); 16 Jul 2014 08:29:27 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/61801] sched2 miscompiles syscall sequence with -g Date: Wed, 16 Jul 2014 08:29: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-Version: 4.8.3 X-Bugzilla-Keywords: missed-optimization, ra, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: 2014-07/txt/msg01053.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61801 --- Comment #7 from Richard Biener --- It's combine combining 120 into 123 and on the way via propagate_for_debug replacing reg:SI 126 with the asm in the debug_insn. (insn 120 119 122 15 (parallel [ (set (reg:SI 126 [ resultvar ]) (asm_operands/v:SI ("xchgl %%ebx, %%edi int $0x80 xchgl %%edi, %%ebx ... (debug_insn 122 120 123 15 (var_location:SI resultvar (reg:SI 126 [ resultvar ])) bug-887141_pthread_create.1.min.i:77 -1 (nil)) (insn 123 122 124 15 (set (reg/v:SI 84 [ result ]) (reg:SI 126 [ resultvar ])) bug-887141_pthread_create.1.min.i:77 90 {*movsi_internal} (expr_list:REG_DEAD (reg:SI 126 [ resultvar ]) (nil))) So to avoid generating debug-insns with asm_operands loc maybe do Index: valtrack.c =================================================================== --- valtrack.c (revision 212580) +++ valtrack.c (working copy) @@ -197,6 +197,12 @@ propagate_for_debug (rtx insn, rtx last, next = NEXT_INSN (insn); if (DEBUG_INSN_P (insn)) { + if (GET_CODE (src) == ASM_OPERANDS) + { + INSN_VAR_LOCATION_LOC (insn) = gen_rtx_UNKNOWN_VAR_LOC (); + df_insn_rescan (insn); + continue; + } loc = simplify_replace_fn_rtx (INSN_VAR_LOCATION_LOC (insn), dest, propagate_for_debug_subst, &p); if (loc == INSN_VAR_LOCATION_LOC (insn)) which "fixes" the bug.