From patchwork Mon Jul 25 03:15:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 106603 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 755DDB6F82 for ; Mon, 25 Jul 2011 13:15:27 +1000 (EST) Received: (qmail 5074 invoked by alias); 25 Jul 2011 03:15:26 -0000 Received: (qmail 5062 invoked by uid 22791); 25 Jul 2011 03:15:25 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 25 Jul 2011 03:15:04 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6P3F3V8023670 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 24 Jul 2011 23:15:04 -0400 Received: from pebble.twiddle.home (vpn-226-63.phx2.redhat.com [10.3.226.63]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p6P3F3VA016833 for ; Sun, 24 Jul 2011 23:15:03 -0400 Message-ID: <4E2CDFB7.90703@redhat.com> Date: Sun, 24 Jul 2011 20:15:03 -0700 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Thunderbird/3.1.11 MIME-Version: 1.0 To: GCC Patches Subject: Re: Fix debug/49825 References: <4E2CDDEC.3010001@redhat.com> In-Reply-To: <4E2CDDEC.3010001@redhat.com> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org As a follow-up, by inspection, args_size should be zeroed across edges for which we explicitly undo args_size, like EH. But we do the same thing for non-local gotos and computed gotos. I couldn't see any difference in the test results with this patch, and frankly I'm surprised about that. But, at least there are no regressions on i686-linux... r~ * dwarf2cfi.c (maybe_record_trace_start): Add abnormal parameter. Zero args_size for abnormal edges. Adjust all callers. diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c index f715e07..fd5f680 100644 --- a/gcc/dwarf2cfi.c +++ b/gcc/dwarf2cfi.c @@ -2396,7 +2396,7 @@ add_cfis_to_fde (void) trace from CUR_TRACE and CUR_ROW. */ static void -maybe_record_trace_start (rtx start, rtx origin) +maybe_record_trace_start (rtx start, rtx origin, bool abnormal) { dw_trace_info *ti; @@ -2421,6 +2421,11 @@ maybe_record_trace_start (rtx start, rtx origin) /* This is the first time we've encountered this trace. Propagate state across the edge and push the trace onto the work list. */ ti->beg_row = copy_cfi_row (cur_row); + /* On all abnormal edges, especially EH and non-local-goto, we take + care to free the pushed arguments. */ + if (abnormal) + ti->beg_row->args_size = 0; + ti->cfa_store = cur_trace->cfa_store; ti->cfa_temp = cur_trace->cfa_temp; ti->regs_saved_in_regs = VEC_copy (reg_saved_in_data, heap, @@ -2465,13 +2470,13 @@ create_trace_edges (rtx insn) for (i = 0; i < n; ++i) { lab = XEXP (RTVEC_ELT (vec, i), 0); - maybe_record_trace_start (lab, insn); + maybe_record_trace_start (lab, insn, false); } } else if (computed_jump_p (insn)) { for (lab = forced_labels; lab; lab = XEXP (lab, 1)) - maybe_record_trace_start (XEXP (lab, 0), insn); + maybe_record_trace_start (XEXP (lab, 0), insn, true); } else if (returnjump_p (insn)) ; @@ -2481,14 +2486,14 @@ create_trace_edges (rtx insn) for (i = 0; i < n; ++i) { lab = XEXP (ASM_OPERANDS_LABEL (tmp, i), 0); - maybe_record_trace_start (lab, insn); + maybe_record_trace_start (lab, insn, true); } } else { lab = JUMP_LABEL (insn); gcc_assert (lab != NULL); - maybe_record_trace_start (lab, insn); + maybe_record_trace_start (lab, insn, false); } } else if (CALL_P (insn)) @@ -2500,7 +2505,7 @@ create_trace_edges (rtx insn) /* Process non-local goto edges. */ if (can_nonlocal_goto (insn)) for (lab = nonlocal_goto_handler_labels; lab; lab = XEXP (lab, 1)) - maybe_record_trace_start (XEXP (lab, 0), insn); + maybe_record_trace_start (XEXP (lab, 0), insn, true); } /* Process EH edges. */ @@ -2508,7 +2513,7 @@ create_trace_edges (rtx insn) { eh_landing_pad lp = get_eh_landing_pad_from_rtx (insn); if (lp) - maybe_record_trace_start (lp->landing_pad, insn); + maybe_record_trace_start (lp->landing_pad, insn, true); } } @@ -2545,7 +2550,7 @@ scan_trace (dw_trace_info *trace) /* Propagate across fallthru edges. */ if (!BARRIER_P (insn)) - maybe_record_trace_start (insn, NULL); + maybe_record_trace_start (insn, NULL, false); break; }