From patchwork Thu Sep 2 21:40: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: 63558 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 CD887B7184 for ; Fri, 3 Sep 2010 07:40:16 +1000 (EST) Received: (qmail 7366 invoked by alias); 2 Sep 2010 21:40:14 -0000 Received: (qmail 7358 invoked by uid 22791); 2 Sep 2010 21:40:13 -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; Thu, 02 Sep 2010 21:40:09 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o82Le7qT009926 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 2 Sep 2010 17:40:08 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o82Le7eM018546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 2 Sep 2010 17:40:07 -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 o82LeH9N017589 for ; Thu, 2 Sep 2010 23:40:17 +0200 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id o82LeEPF017588 for gcc-patches@gcc.gnu.org; Thu, 2 Sep 2010 23:40:14 +0200 Date: Thu, 2 Sep 2010 23:40:14 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix output_set_got vs. barrier_args_size (PR middle-end/45484) Message-ID: <20100902214014.GW1269@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline 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 Hi! If output_set_got does a call, it calls dwarf2out_frame_debug with a barrier to ensure all queued .eh_frame/.debug_frame register saves are flushed before the call. Unfortunately, BARRIER was a bad choice of an insn, because dwarf2out_notice_stack_adjust for BARRIERs tries to look its INSN_UID in barrier_args_size array, but as that BARRIER is created on the fly, it is beyond the size of the array. We don't want to adjust args_size at that point in any way. Fixed by using a different insn that causes the flushing as well: if (!NONJUMP_INSN_P (insn) || clobbers_queued_reg_save (insn)) flush_queued_reg_saves (); but doesn't have any other side-effects in dwarf2out_frame_debug. Bootstrapped/regtested on x86_64-linux and i686-linux. Ok for trunk and 4.5? 2010-09-02 Jakub Jelinek PR middle-end/45484 * config/i386/i386.c (output_set_got): Use a dummy JUMP_INSN instead of BARRIER for flushing of queued register saves. Jakub --- gcc/config/i386/i386.c.jj 2010-09-01 19:15:23.000000000 +0200 +++ gcc/config/i386/i386.c 2010-09-02 17:31:36.533646187 +0200 @@ -8122,7 +8122,7 @@ output_set_got (rtx dest, rtx label ATTR { 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); }