]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/66275 (__attribute__((sysv_abi)) with x86_64-w64-mingw32-gcc...
authorUros Bizjak <ubizjak@gmail.com>
Mon, 8 Jun 2015 20:59:07 +0000 (22:59 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Mon, 8 Jun 2015 20:59:07 +0000 (22:59 +0200)
Backport from mainline:
2015-06-03  Uros Bizjak  <ubizjak@gmail.com>

PR target/66275
* config/i386/i386.c (ix86_function_arg_regno): Use ix86_cfun_abi
to determine current function ABI.
(ix86_function_value_regno_p): Ditto.

testsuite/ChangeLog:

Backport from mainline:
2015-06-03  Uros Bizjak  <ubizjak@gmail.com>

PR target/66275
* gcc.target/i386/pr66275.c: New test.

From-SVN: r224249

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr66275.c [new file with mode: 0644]

index 97d90074cf779bbef2d9b84ca5b2fb50f427092c..1f6492fee294e9e7e6fe10771cf8862e6cd5da02 100644 (file)
@@ -1,3 +1,13 @@
+2015-06-08  Uros Bizjak  <ubizjak@gmail.com>
+
+       Backport from mainline:
+       2015-06-03  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/66275
+       * config/i386/i386.c (ix86_function_arg_regno): Use ix86_cfun_abi
+       to determine current function ABI.
+       (ix86_function_value_regno_p): Ditto.
+
 2015-06-05  Venkataramanan Kumar  <venkataramanan.kumar@amd.com>
 
        * config/i386/sse.md (sse3_mwait): Swap the operand constriants.
index cb5b325183c84c0eaa358facaa780e5683734831..c2d0c5fae79551d34be6bf71e8fea3e0aa1022ab 100644 (file)
@@ -5451,6 +5451,7 @@ bool
 ix86_function_arg_regno_p (int regno)
 {
   int i;
+  enum calling_abi call_abi;
   const int *parm_regs;
 
   if (!TARGET_64BIT)
@@ -5481,16 +5482,18 @@ ix86_function_arg_regno_p (int regno)
   /* TODO: The function should depend on current function ABI but
      builtins.c would need updating then. Therefore we use the
      default ABI.  */
+  call_abi = ix86_cfun_abi ();
 
   /* RAX is used as hidden argument to va_arg functions.  */
-  if (ix86_abi == SYSV_ABI && regno == AX_REG)
+  if (call_abi == SYSV_ABI && regno == AX_REG)
     return true;
 
-  if (ix86_abi == MS_ABI)
+  if (call_abi == MS_ABI)
     parm_regs = x86_64_ms_abi_int_parameter_registers;
   else
     parm_regs = x86_64_int_parameter_registers;
-  for (i = 0; i < (ix86_abi == MS_ABI
+
+  for (i = 0; i < (call_abi == MS_ABI
                   ? X86_64_MS_REGPARM_MAX : X86_64_REGPARM_MAX); i++)
     if (regno == parm_regs[i])
       return true;
@@ -7250,7 +7253,7 @@ ix86_function_value_regno_p (const unsigned int regno)
       return true;
     case DI_REG:
     case SI_REG:
-      return TARGET_64BIT && ix86_abi != MS_ABI;
+      return TARGET_64BIT && ix86_cfun_abi () != MS_ABI;
 
       /* Complex values are returned in %st(0)/%st(1) pair.  */
     case ST0_REG:
@@ -7258,7 +7261,7 @@ ix86_function_value_regno_p (const unsigned int regno)
       /* TODO: The function should depend on current function ABI but
        builtins.c would need updating then. Therefore we use the
        default ABI.  */
-      if (TARGET_64BIT && ix86_abi == MS_ABI)
+      if (TARGET_64BIT && ix86_cfun_abi () == MS_ABI)
        return false;
       return TARGET_FLOAT_RETURNS_IN_80387;
 
index c4183511c2961a094015fdf8e419180e2f37420e..576bcb30cbc75ce8204d9485717fbe18b591f153 100644 (file)
@@ -1,3 +1,11 @@
+2015-06-08  Uros Bizjak  <ubizjak@gmail.com>
+
+       Backport from mainline:
+       2015-06-03  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/66275
+       * gcc.target/i386/pr66275.c: New test.
+
 2015-06-04  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/66251
diff --git a/gcc/testsuite/gcc.target/i386/pr66275.c b/gcc/testsuite/gcc.target/i386/pr66275.c
new file mode 100644 (file)
index 0000000..b8759ae
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile { target { *-*-linux* && { ! ia32 } } } } */
+/* { dg-options "-mabi=ms -fdump-rtl-dfinit" } */
+
+void
+__attribute__((sysv_abi))
+foo () {};
+
+/* { dg-final { scan-rtl-dump "entry block defs\[^\\n]*\\\[si\\]\[^\\n]*\\\[di\\]" "dfinit" } } */