public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Richard Henderson <rth@redhat.com>
Cc: Uros Bizjak <ubizjak@gmail.com>, gcc-patches@gcc.gnu.org
Subject: Re: PATCH [3/n] X32: Promote pointers to Pmode
Date: Fri, 22 Jul 2011 13:31:00 -0000	[thread overview]
Message-ID: <CAMe9rOr5H+DTRdAH8qS59ZOA_j_4qmOZxHRbB7b+vVu4X3s3Vg@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOpQ6pYz0KfL_QxJOPA=kxUODK_MOTTP65FTngUSMA2nxQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2203 bytes --]

On Thu, Jul 21, 2011 at 10:14 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Jul 21, 2011 at 5:36 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Thu, Jul 21, 2011 at 4:51 PM, Richard Henderson <rth@redhat.com> wrote:
>>> On 07/21/2011 04:28 PM, H.J. Lu wrote:
>>>> On Thu, Jul 21, 2011 at 3:05 PM, Richard Henderson <rth@redhat.com> 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?
>

Need to skip all ms_abi tests for x32.  OK for trunk?

Thanks.

H.J.
----
gcc/

2011-07-21  H.J. Lu  <hongjiu.lu@intel.com>

	* config/i386/i386.c (ix86_option_override_internal): Disallow
	MS ABI in x32 mode.
	(ix86_init_builtins): Call ix86_init_builtins_va_builtins_abi
	only for TARGET_LP64.
	(ix86_handle_abi_attribute): Check TARGET_LP64 instead of
	TARGET_64BIT.

gcc/testsuite/

2011-07-21  H.J. Lu  <hongjiu.lu@intel.com>

	* gcc/testsuite/gcc.target/i386/avx-vzeroupper-16.c: Only run
	on lp64 targets.
	* gcc/testsuite/gcc.target/i386/avx-vzeroupper-17.c: Likewise.
	* gcc/testsuite/gcc.target/i386/avx-vzeroupper-18.c: Likewise.
	* gcc/testsuite/gcc.target/i386/pr43662.c: Likewise.
	* gcc/testsuite/gcc.target/i386/pr43869.c: Likewise.

	* gcc.target/x86_64/abi/callabi/callabi.exp: Check ilp32
	instead of ia32.

[-- Attachment #2: gcc-x32-abi-ms-2.patch --]
[-- Type: text/plain, Size: 4504 bytes --]

gcc/

2011-07-21  H.J. Lu  <hongjiu.lu@intel.com>
 
	* config/i386/i386.c (ix86_option_override_internal): Disallow
	MS ABI in x32 mode.
	(ix86_init_builtins): Call ix86_init_builtins_va_builtins_abi
	only for TARGET_LP64.
	(ix86_handle_abi_attribute): Check TARGET_LP64 instead of
	TARGET_64BIT.

gcc/testsuite/

2011-07-21  H.J. Lu  <hongjiu.lu@intel.com>

	* gcc/testsuite/gcc.target/i386/avx-vzeroupper-16.c: Only run
	on lp64 targets.
	* gcc/testsuite/gcc.target/i386/avx-vzeroupper-17.c: Likewise.
	* gcc/testsuite/gcc.target/i386/avx-vzeroupper-18.c: Likewise.
	* gcc/testsuite/gcc.target/i386/pr43662.c: Likewise.
	* gcc/testsuite/gcc.target/i386/pr43869.c: Likewise.

	* gcc.target/x86_64/abi/callabi/callabi.exp: Check ilp32
	instead of ia32.

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
 }
 
diff --git a/gcc/testsuite/gcc.target/i386/avx-vzeroupper-16.c b/gcc/testsuite/gcc.target/i386/avx-vzeroupper-16.c
index 095640a..bc6e0d2 100644
--- a/gcc/testsuite/gcc.target/i386/avx-vzeroupper-16.c
+++ b/gcc/testsuite/gcc.target/i386/avx-vzeroupper-16.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-do compile { target lp64 } } */
 /* { dg-options "-O2 -mavx -mabi=ms -mtune=generic -dp" } */
 
 typedef float __m256 __attribute__ ((__vector_size__ (32), __may_alias__));
diff --git a/gcc/testsuite/gcc.target/i386/avx-vzeroupper-17.c b/gcc/testsuite/gcc.target/i386/avx-vzeroupper-17.c
index ef293b3..5d3aa48 100644
--- a/gcc/testsuite/gcc.target/i386/avx-vzeroupper-17.c
+++ b/gcc/testsuite/gcc.target/i386/avx-vzeroupper-17.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-do compile { target lp64 } } */
 /* { dg-options "-O2 -mavx -mabi=ms -mtune=generic -dp" } */
 
 typedef float __m256 __attribute__ ((__vector_size__ (32), __may_alias__));
diff --git a/gcc/testsuite/gcc.target/i386/avx-vzeroupper-18.c b/gcc/testsuite/gcc.target/i386/avx-vzeroupper-18.c
index 046b7ef..0630752 100644
--- a/gcc/testsuite/gcc.target/i386/avx-vzeroupper-18.c
+++ b/gcc/testsuite/gcc.target/i386/avx-vzeroupper-18.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-do compile { target lp64 } } */
 /* { dg-options "-O0 -mavx -mabi=ms -mtune=generic -dp" } */
 
 typedef float __m256 __attribute__ ((__vector_size__ (32), __may_alias__));
diff --git a/gcc/testsuite/gcc.target/i386/pr43662.c b/gcc/testsuite/gcc.target/i386/pr43662.c
index 5e75dc5..2896a1a 100644
--- a/gcc/testsuite/gcc.target/i386/pr43662.c
+++ b/gcc/testsuite/gcc.target/i386/pr43662.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-do compile { target lp64 } } */
 /* { dg-options "-O2" } */
 
 void __attribute__ ((ms_abi)) foo (void)
diff --git a/gcc/testsuite/gcc.target/i386/pr43869.c b/gcc/testsuite/gcc.target/i386/pr43869.c
index 5513b19..4157db1 100644
--- a/gcc/testsuite/gcc.target/i386/pr43869.c
+++ b/gcc/testsuite/gcc.target/i386/pr43869.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-do compile { target lp64 } } */
 
 int __attribute__((__noinline__))
 bugged(float f1, float f2, float f3, float f4,

  reply	other threads:[~2011-07-22 13:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-09 21:37 H.J. Lu
2011-07-10 16:37 ` Uros Bizjak
2011-07-10 19:56   ` H.J. Lu
2011-07-10 23:51     ` Richard Henderson
2011-07-11  0:04       ` H.J. Lu
2011-07-11  1:16         ` Richard Henderson
2011-07-11  1:47           ` H.J. Lu
2011-07-13 14:07             ` H.J. Lu
2011-07-13 15:36               ` Richard Henderson
2011-07-13 15:38                 ` H.J. Lu
2011-07-13 16:13                   ` Richard Henderson
2011-07-14  7:36                     ` H.J. Lu
2011-07-21 22:30                     ` H.J. Lu
2011-07-21 22:46                       ` Richard Henderson
2011-07-22  0:10                         ` H.J. Lu
2011-07-22  3:23                           ` Richard Henderson
2011-07-22  4:22                             ` H.J. Lu
2011-07-22  8:08                               ` H.J. Lu
2011-07-22 13:31                                 ` H.J. Lu [this message]
2011-07-22 16:34                                   ` Richard Henderson
2011-07-13 13:42     ` H.J. Lu
2011-07-13 13:48       ` Uros Bizjak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMe9rOr5H+DTRdAH8qS59ZOA_j_4qmOZxHRbB7b+vVu4X3s3Vg@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rth@redhat.com \
    --cc=ubizjak@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).