From patchwork Thu Jun 10 01:04:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 55139 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 3C4A01007D1 for ; Thu, 10 Jun 2010 11:04:55 +1000 (EST) Received: (qmail 7129 invoked by alias); 10 Jun 2010 01:04:54 -0000 Received: (qmail 7028 invoked by uid 22791); 10 Jun 2010 01:04:53 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-pv0-f175.google.com (HELO mail-pv0-f175.google.com) (74.125.83.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 10 Jun 2010 01:04:49 +0000 Received: by pvc30 with SMTP id 30so267507pvc.20 for ; Wed, 09 Jun 2010 18:04:47 -0700 (PDT) Received: by 10.114.249.6 with SMTP id w6mr14910085wah.0.1276131887439; Wed, 09 Jun 2010 18:04:47 -0700 (PDT) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id c14sm70904739waa.13.2010.06.09.18.04.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 09 Jun 2010 18:04:46 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id CB5DA170C308; Thu, 10 Jun 2010 10:34:40 +0930 (CST) Date: Thu, 10 Jun 2010 10:34:40 +0930 From: Alan Modra To: gcc-patches@gcc.gnu.org Subject: caller-save adjust_address fix Message-ID: <20100610010440.GN7312@bubble.grove.modra.org> Mail-Followup-To: gcc-patches@gcc.gnu.org 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 an ICE in change_address_1 seen when a caller-save slot is needed in a different mode to that in which it is created, and the stack offset is too large for valid reg+offset addressing. Refer http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44364#c38 Fairly obvious, since if no mode change is needed then we simply copy the mem regardless of whether the offset is valid or not. Bootstrapped etc. powerpc-linux. OK to apply? PR target/44364 * caller-save.c (insert_restore, insert_save): Use non-validate form of adjust_address. Index: gcc/caller-save.c =================================================================== --- gcc/caller-save.c (revision 160429) +++ gcc/caller-save.c (working copy) @@ -1212,7 +1212,7 @@ insert_restore (struct insn_chain *chain /* Check that insn to restore REGNO in save_mode[regno] is correct. */ && reg_save_code (regno, save_mode[regno]) >= 0) - mem = adjust_address (mem, save_mode[regno], 0); + mem = adjust_address_nv (mem, save_mode[regno], 0); else mem = copy_rtx (mem); @@ -1293,7 +1293,7 @@ insert_save (struct insn_chain *chain, i /* Check that insn to save REGNO in save_mode[regno] is correct. */ && reg_save_code (regno, save_mode[regno]) >= 0) - mem = adjust_address (mem, save_mode[regno], 0); + mem = adjust_address_nv (mem, save_mode[regno], 0); else mem = copy_rtx (mem);