summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2015-06-03 15:46:41 +0000
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2015-06-03 15:46:41 +0000
commit73a9a75eabae5bc5121035f2dd21864c2e282546 (patch)
tree2747f9a15d221bfbb9ad62dd70a5659cc7d7e05d
parentd1df0bfccbf06e761cbeecb1ec96b53e0fc20215 (diff)
downloadgcc-73a9a75eabae5bc5121035f2dd21864c2e282546.tar.gz
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: PR target/66275 * gcc.target/i386/pr66275.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224094 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/i386/i386.c15
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/i386/pr66275.c8
4 files changed, 30 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5f695bd3fdc..3951a8e4942 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+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-03 Martin Liska <mliska@suse.cz>
* alloc-pool.h (struct pool_usage): Correct GNU coding style.
@@ -13,7 +20,7 @@
-Bsymbolic.
2015-06-02 Andres Tiraboschi <andres.tiraboschi@tallertechnologies.com>
-
+
* doc/plugins.texi (enum plugin_event): New event.
* plugin.c (register_callback): Handle PLUGIN_START_PARSE_FUNCTION
and PLUGIN_FINISH_FUNCTION.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index e77cd0448bf..de8ce37cb0f 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -6149,6 +6149,7 @@ bool
ix86_function_arg_regno_p (int regno)
{
int i;
+ enum calling_abi call_abi;
const int *parm_regs;
if (TARGET_MPX && BND_REGNO_P (regno))
@@ -6174,16 +6175,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;
@@ -8212,10 +8215,10 @@ ix86_function_value_regno_p (const unsigned int regno)
case AX_REG:
return true;
case DX_REG:
- return (!TARGET_64BIT || ix86_abi != MS_ABI);
+ return (!TARGET_64BIT || ix86_cfun_abi () != MS_ABI);
case DI_REG:
case SI_REG:
- return TARGET_64BIT && ix86_abi != MS_ABI;
+ return TARGET_64BIT && ix86_cfun_abi () != MS_ABI;
case BND0_REG:
case BND1_REG:
@@ -8227,7 +8230,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;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index efd859b8ef5..a1d74917010 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-03 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/66275
+ * gcc.target/i386/pr66275.c: New test.
+
2015-06-03 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* gcc.dg/Wcxx-compat-22.c: New testcase.
diff --git a/gcc/testsuite/gcc.target/i386/pr66275.c b/gcc/testsuite/gcc.target/i386/pr66275.c
new file mode 100644
index 00000000000..b8759aeb5ec
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr66275.c
@@ -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" } } */