From patchwork Fri Nov 4 13:43:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 123635 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 5499BB6F67 for ; Sat, 5 Nov 2011 00:44:13 +1100 (EST) Received: (qmail 11924 invoked by alias); 4 Nov 2011 13:44:11 -0000 Received: (qmail 11914 invoked by uid 22791); 4 Nov 2011 13:44:10 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-qw0-f47.google.com (HELO mail-qw0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 04 Nov 2011 13:43:54 +0000 Received: by qam2 with SMTP id 2so2273947qam.20 for ; Fri, 04 Nov 2011 06:43:54 -0700 (PDT) Received: by 10.224.215.130 with SMTP id he2mr7263792qab.55.1320414233822; Fri, 04 Nov 2011 06:43:53 -0700 (PDT) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id hn10sm9748745qab.20.2011.11.04.06.43.51 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Nov 2011 06:43:53 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id B8430170C2E4; Sat, 5 Nov 2011 00:13:40 +1030 (CST) Date: Sat, 5 Nov 2011 00:13:40 +1030 From: Alan Modra To: gcc-patches@gcc.gnu.org Cc: David Edelsohn Subject: [rs6000] fix PR 30282, load from stack moved past stack update Message-ID: <20111104134340.GD22298@bubble.grove.modra.org> Mail-Followup-To: gcc-patches@gcc.gnu.org, David Edelsohn MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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 This patch fixes PR30282, caused by instructions being scheduled over the stack reset. Note that only for ABI_V4 do we currently have frame_reg_rtx != sp_reg_rtx in rs6000_emit_stack_reset, so the patch doesn't emit *less* blockages. I did benchmark this change and saw nothing but the usual benchmake noise. Bootstrapped etc. powerpc-linux. OK to apply? * config/rs6000/rs6000.c (rs6000_emit_stack_reset): Always emit blockage for ABI_V4. Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 177309) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -19689,7 +19689,7 @@ rs6000_emit_stack_reset (rs6000_stack_t { /* This blockage is needed so that sched doesn't decide to move the sp change before the register restores. */ - if (frame_reg_rtx != sp_reg_rtx + if (DEFAULT_ABI == ABI_V4 || (TARGET_SPE_ABI && info->spe_64bit_regs_used != 0 && info->first_gp_reg_save != 32))