From patchwork Fri Jul 22 05:14:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 106214 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 B37EDB6F64 for ; Fri, 22 Jul 2011 15:14:51 +1000 (EST) Received: (qmail 22113 invoked by alias); 22 Jul 2011 05:14:48 -0000 Received: (qmail 22096 invoked by uid 22791); 22 Jul 2011 05:14:46 -0000 X-SWARE-Spam-Status: No, hits=-2.3 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-qy0-f182.google.com (HELO mail-qy0-f182.google.com) (209.85.216.182) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 22 Jul 2011 05:14:32 +0000 Received: by qyk38 with SMTP id 38so1185437qyk.20 for ; Thu, 21 Jul 2011 22:14:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.10.231 with SMTP id q39mr916471qcq.46.1311311671604; Thu, 21 Jul 2011 22:14:31 -0700 (PDT) Received: by 10.229.98.193 with HTTP; Thu, 21 Jul 2011 22:14:31 -0700 (PDT) In-Reply-To: References: <20110709212846.GA3563@intel.com> <4E1A1D43.3010106@redhat.com> <4E1A4864.2030702@redhat.com> <4E1DB962.6010808@redhat.com> <4E1DBBC9.4030305@redhat.com> <4E28A291.5080700@redhat.com> <4E28BB66.4010504@redhat.com> Date: Thu, 21 Jul 2011 22:14:31 -0700 Message-ID: Subject: Re: PATCH [3/n] X32: Promote pointers to Pmode From: "H.J. Lu" To: Richard Henderson Cc: Uros Bizjak , gcc-patches@gcc.gnu.org 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 On Thu, Jul 21, 2011 at 5:36 PM, H.J. Lu wrote: > On Thu, Jul 21, 2011 at 4:51 PM, Richard Henderson wrote: >> On 07/21/2011 04:28 PM, H.J. Lu wrote: >>> On Thu, Jul 21, 2011 at 3:05 PM, Richard Henderson wrote: >>>> On 07/21/2011 03:02 PM, H.J. Lu wrote: >>>>>       * config/i386/i386.c (function_value_64): Always return pointers >>>>>       in Pmode. >>>>>       (ix86_promote_function_mode): New. >>>>>       (TARGET_PROMOTE_FUNCTION_MODE): Likewise. >>>> >>>> Much better, thanks. >>>> >>>> >>>> r~ >>>> >>> >>> Also need this patch.  Otherwise, I got >>> >>> FAIL: gcc.target/x86_64/abi/callabi/func-indirect-2a.c (internal compiler error) >>> FAIL: gcc.target/x86_64/abi/callabi/func-indirect-2a.c (test for excess errors) >>> FAIL: gcc.target/x86_64/abi/callabi/func-indirect-2b.c (internal compiler error) >>> FAIL: gcc.target/x86_64/abi/callabi/func-indirect-2b.c (test for excess errors) >>> >>> OK for trunk? >> >> Hmm.  Should we even be running ms_64 callabi tests across pointer sizes though? >> > > Good question.  I can disable the test.  But compiler will still ICE on this > input. > > How about this patch? OK for trunk? Thanks. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 9e3532e..6e030d9 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3133,6 +3133,9 @@ ix86_option_override_internal (bool main_args_p) if (!global_options_set.x_ix86_abi) ix86_abi = DEFAULT_ABI; + if (ix86_abi == MS_ABI && TARGET_X32) + error ("MS ABI not supported in x32 mode"); + if (global_options_set.x_ix86_cmodel) { switch (ix86_cmodel) @@ -25520,7 +25523,7 @@ ix86_init_builtins (void) ix86_init_mmx_sse_builtins (); - if (TARGET_64BIT) + if (TARGET_LP64) ix86_init_builtins_va_builtins_abi (); #ifdef SUBTARGET_INIT_BUILTINS @@ -29340,7 +29343,7 @@ ix86_handle_abi_attribute (tree *node, tree name, *no_add_attrs = true; return NULL_TREE; } - if (!TARGET_64BIT) + if (!TARGET_LP64) { warning (OPT_Wattributes, "%qE attribute only available for 64-bit", name); diff --git a/gcc/testsuite/gcc.target/x86_64/abi/callabi/callabi.exp b/gcc/testsuite/gcc.target/x86_64/abi/callabi/callabi.exp index b0cba17..e76d0c1 100644 --- a/gcc/testsuite/gcc.target/x86_64/abi/callabi/callabi.exp +++ b/gcc/testsuite/gcc.target/x86_64/abi/callabi/callabi.exp @@ -20,7 +20,7 @@ load_lib gcc-dg.exp if { (![istarget x86_64-*-*] && ![istarget i?86-*-*]) - || [is-effective-target ia32] } then { + || [is-effective-target ilp32] } then { return }