From patchwork Thu Jun 10 01:17:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 55140 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 9B27E1007D1 for ; Thu, 10 Jun 2010 11:17:29 +1000 (EST) Received: (qmail 16902 invoked by alias); 10 Jun 2010 01:17:28 -0000 Received: (qmail 16894 invoked by uid 22791); 10 Jun 2010 01:17:27 -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-pz0-f171.google.com (HELO mail-pz0-f171.google.com) (209.85.222.171) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 10 Jun 2010 01:17:19 +0000 Received: by pzk1 with SMTP id 1so953205pzk.8 for ; Wed, 09 Jun 2010 18:17:18 -0700 (PDT) Received: by 10.114.242.14 with SMTP id p14mr14806799wah.156.1276132638043; Wed, 09 Jun 2010 18:17:18 -0700 (PDT) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id r20sm71018374wam.17.2010.06.09.18.17.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 09 Jun 2010 18:17:17 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 466CC170C308; Thu, 10 Jun 2010 10:47:12 +0930 (CST) Date: Thu, 10 Jun 2010 10:47:12 +0930 From: Alan Modra To: gcc-patches@gcc.gnu.org Cc: David Edelsohn Subject: PR 44364, e500 caller-save slots Message-ID: <20100610011712.GO7312@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 e500 can use 64-bit gprs for fp calculations, but the normal size of gprs for integer calculations is 32-bit. This confuses gcc's caller-save logic, resulting in only the low 32 bits being saved even when the full 64-bit register is in use. Fixed as follows, but this tickles a bug in caller-save.c. See http://gcc.gnu.org/ml/gcc-patches/2010-06/msg01033.html OK to apply assuming bootstrap/regress test passes? PR target/44364 * config/rs6000/e500.h (HARD_REGNO_CALLER_SAVE_MODE): Define. Index: gcc/config/rs6000/e500.h =================================================================== --- gcc/config/rs6000/e500.h (revision 160245) +++ gcc/config/rs6000/e500.h (working copy) @@ -43,3 +43,10 @@ error ("E500 and FPRs not supported"); \ } \ } while (0) + +/* When setting up caller-save slots (MODE == VOIDmode) ensure we + allocate space for DFmode. Save gprs in the correct mode too. */ +#define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \ + (TARGET_E500_DOUBLE && ((MODE) == VOIDmode || (MODE) == DFmode) \ + ? DFmode \ + : choose_hard_reg_mode ((REGNO), (NREGS), false))