From patchwork Fri Sep 3 09:46:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 63601 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 20E3DB7161 for ; Fri, 3 Sep 2010 19:46:14 +1000 (EST) Received: (qmail 18095 invoked by alias); 3 Sep 2010 09:46:12 -0000 Received: (qmail 18083 invoked by uid 22791); 3 Sep 2010 09:46:11 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD 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; Fri, 03 Sep 2010 09:46:06 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o839k4p9010670 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 3 Sep 2010 05:46:04 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o839k39a008542 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 3 Sep 2010 05:46:04 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [127.0.0.1]) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4) with ESMTP id o839kF2a004413; Fri, 3 Sep 2010 11:46:15 +0200 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id o839kEPI004411; Fri, 3 Sep 2010 11:46:14 +0200 Date: Fri, 3 Sep 2010 11:46:14 +0200 From: Jakub Jelinek To: Richard Henderson Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix output_set_got vs. barrier_args_size (PR middle-end/45484, take 2) Message-ID: <20100903094614.GZ1269@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek References: <20100902214014.GW1269@tyan-ft48-01.lab.bos.redhat.com> <4C803D2F.4040607@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4C803D2F.4040607@redhat.com> User-Agent: Mutt/1.5.20 (2009-12-10) 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 On Thu, Sep 02, 2010 at 05:11:27PM -0700, Richard Henderson wrote: > On 09/02/2010 02:40 PM, Jakub Jelinek wrote: > > rtx insn; > > start_sequence (); > > - insn = emit_barrier (); > > + insn = emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, pc_rtx)); > > end_sequence (); > > dwarf2out_frame_debug (insn, false); > > Ug. Wouldn't it be better simply to expose a dwarf2out routine > that flushes the queue, without dancing around fake insns? Like this? Bootstrapped/regtested on x86_64-linux and i686-linux. 2010-09-02 Jakub Jelinek PR middle-end/45484 * dwarf2out.c (flush_queued_reg_saves): Rename to... (dwarf2out_flush_queued_reg_saves): ... this. No longer static. (dwarf2out_frame_debug_expr, dwarf2out_frame_debug): Adjust callers. * dwarf2out.h (dwarf2out_flush_queued_reg_saves): New prototype. * config/i386/i386.c (output_set_got): Call it. Jakub --- gcc/dwarf2out.c.jj 2010-09-02 20:48:05.000000000 +0200 +++ gcc/dwarf2out.c 2010-09-03 09:02:53.060646349 +0200 @@ -471,7 +471,6 @@ static void output_cfi (dw_cfi_ref, dw_f static void output_cfi_directive (dw_cfi_ref); static void output_call_frame_info (int); static void dwarf2out_note_section_used (void); -static void flush_queued_reg_saves (void); static bool clobbers_queued_reg_save (const_rtx); static void dwarf2out_frame_debug_expr (rtx, const char *); @@ -1712,8 +1711,8 @@ queue_reg_save (const char *label, rtx r /* Output all the entries in QUEUED_REG_SAVES. */ -static void -flush_queued_reg_saves (void) +void +dwarf2out_flush_queued_reg_saves (void) { struct queued_reg_save *q; @@ -2458,7 +2457,7 @@ dwarf2out_frame_debug_expr (rtx expr, co { /* We interpret reg_save differently with stack_realign set. Thus we must flush whatever we have queued first. */ - flush_queued_reg_saves (); + dwarf2out_flush_queued_reg_saves (); gcc_assert (cfa_store.reg == REGNO (XEXP (src, 0))); fde->stack_realign = 1; @@ -2705,7 +2704,7 @@ dwarf2out_frame_debug (rtx insn, bool af size_t i; /* Flush any queued register saves. */ - flush_queued_reg_saves (); + dwarf2out_flush_queued_reg_saves (); /* Set up state for generating call frame debug info. */ lookup_cfa (&cfa); @@ -2733,7 +2732,7 @@ dwarf2out_frame_debug (rtx insn, bool af } if (!NONJUMP_INSN_P (insn) || clobbers_queued_reg_save (insn)) - flush_queued_reg_saves (); + dwarf2out_flush_queued_reg_saves (); if (!RTX_FRAME_RELATED_P (insn)) { @@ -2841,7 +2840,7 @@ dwarf2out_frame_debug (rtx insn, bool af We could probably check just once, here, but this is safer than removing the check above. */ if (clobbers_queued_reg_save (insn)) - flush_queued_reg_saves (); + dwarf2out_flush_queued_reg_saves (); } /* Determine if we need to save and restore CFI information around this --- gcc/dwarf2out.h.jj 2010-06-28 13:43:38.000000000 +0200 +++ gcc/dwarf2out.h 2010-09-03 09:03:37.906440532 +0200 @@ -22,6 +22,7 @@ extern void dwarf2out_decl (tree); extern void dwarf2out_frame_debug (rtx, bool); extern void dwarf2out_cfi_begin_epilogue (rtx); extern void dwarf2out_frame_debug_restore_state (void); +extern void dwarf2out_flush_queued_reg_saves (void); extern void debug_dwarf (void); struct die_struct; --- gcc/config/i386/i386.c.jj 2010-09-02 20:44:41.194458857 +0200 +++ gcc/config/i386/i386.c 2010-09-03 09:04:22.728521383 +0200 @@ -8119,13 +8119,7 @@ output_set_got (rtx dest, rtx label ATTR /* Ensure all queued register saves are flushed before the call. */ if (dwarf2out_do_frame ()) - { - rtx insn; - start_sequence (); - insn = emit_barrier (); - end_sequence (); - dwarf2out_frame_debug (insn, false); - } + dwarf2out_flush_queued_reg_saves (); #endif xops[2] = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (name)); xops[2] = gen_rtx_MEM (QImode, xops[2]);