From patchwork Sun Mar 6 18:55:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 85586 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 0F23EB70BA for ; Mon, 7 Mar 2011 05:56:12 +1100 (EST) Received: (qmail 23354 invoked by alias); 6 Mar 2011 18:56:11 -0000 Received: (qmail 23346 invoked by uid 22791); 6 Mar 2011 18:56:10 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL, BAYES_00, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 06 Mar 2011 18:56:06 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 06 Mar 2011 10:55:57 -0800 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by fmsmga001.fm.intel.com with ESMTP; 06 Mar 2011 10:55:57 -0800 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id 98CD8180973; Sun, 6 Mar 2011 10:55:57 -0800 (PST) Date: Sun, 6 Mar 2011 10:55:57 -0800 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: [x32] PATCH: Convert function address to Pmode if needed Message-ID: <20110306185557.GA19947@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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, I checked in this patch to convert function address to Pmode if needed. H.J. --- commit b2f3e23711761c7ae4c8378ba63525dfd4030a7a Author: H.J. Lu Date: Sun Mar 6 10:52:38 2011 -0800 Convert function address to Pmode if needed. diff --git a/gcc/ChangeLog.x32 b/gcc/ChangeLog.x32 index 022767b..0fae773 100644 --- a/gcc/ChangeLog.x32 +++ b/gcc/ChangeLog.x32 @@ -1,5 +1,10 @@ 2011-03-06 H.J. Lu + * config/i386/i386.c (ix86_expand_call): Convert function address + to Pmode if needed. + +2011-03-06 H.J. Lu + PR other/48007 * unwind-dw2.c (_Unwind_Context): Save call frame hard registers as _Unwind_Word. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index b2eae67..c034257 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -22041,7 +22041,10 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1, ? !sibcall_insn_operand (XEXP (fnaddr, 0), Pmode) : !call_insn_operand (XEXP (fnaddr, 0), Pmode)) { - fnaddr = copy_to_mode_reg (Pmode, XEXP (fnaddr, 0)); + fnaddr = XEXP (fnaddr, 0); + if (GET_MODE (fnaddr) != Pmode) + fnaddr = convert_to_mode (Pmode, fnaddr, 1); + fnaddr = copy_to_mode_reg (Pmode, fnaddr); fnaddr = gen_rtx_MEM (QImode, fnaddr); }