]> 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:07:08 +0000 (22:07 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Mon, 8 Jun 2015 20:07:08 +0000 (22:07 +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: r224247

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

index 09dbbcb4582508f34205c94cf948ecd4344e4775..5b3bfc61442cb7b002156a2ed471e28486332718 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-08  Venkataramanan Kumar  <venkataramanan.kumar@amd.com>
 
        * config/i386/sse.md (sse3_mwait): Swap the operand constriants.
@@ -18,7 +28,7 @@
        GIMPLE_OMP_TASK add an EDGE_ABNORMAL edge from entry to exit.
 
        2015-05-04  Jakub Jelinek  <jakub@redhat.com>
+
        PR tree-optimization/65984
        * ubsan.c: Include tree-cfg.h.
        (instrument_bool_enum_load): Use stmt_ends_bb_p instead of
index 52c5497840c93c50c547be62b4165e391450543d..f71204cb1be0e6235c589a6695d5f3dfdf984a23 100644 (file)
@@ -5905,6 +5905,7 @@ bool
 ix86_function_arg_regno_p (int regno)
 {
   int i;
+  enum calling_abi call_abi;
   const int *parm_regs;
 
   if (!TARGET_64BIT)
@@ -5927,16 +5928,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;
@@ -7780,7 +7783,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:
@@ -7788,7 +7791,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 d6d4ff6c358a2c943e8a07892393cc9a58eb207b..da7994451d97907e32e69fa99c5a02f2d1516dac 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
@@ -7,7 +15,7 @@
 
        Backported from mainline
        2015-05-04  Jakub Jelinek  <jakub@redhat.com>
+
        PR tree-optimization/65984
        * c-c++-common/ubsan/pr65984.c: New test.
 
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" } } */