aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2022-03-13 08:57:51 -0700
committerH.J. Lu <hjl.tools@gmail.com>2022-03-16 06:30:53 -0700
commit3117ffce4c1598a35e724138735b099262353358 (patch)
treecd3121aeafc0396a7982cbd6612e01976fc0d879
parent2a5fabeb2faffa671e9b0984ce3a6f76153d23d4 (diff)
downloadgcc-3117ffce4c1598a35e724138735b099262353358.zip
gcc-3117ffce4c1598a35e724138735b099262353358.tar.gz
gcc-3117ffce4c1598a35e724138735b099262353358.tar.bz2
x86: Also check _SOFT_FLOAT in <x86gprintrin.h>
Push target("general-regs-only") in <x86gprintrin.h> if x87 is enabled. gcc/ PR target/104890 * config/i386/x86gprintrin.h: Also check _SOFT_FLOAT before pushing target("general-regs-only"). gcc/testsuite/ PR target/104890 * gcc.target/i386/pr104890.c: New test.
-rw-r--r--gcc/config/i386/x86gprintrin.h2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr104890.c11
2 files changed, 12 insertions, 1 deletions
diff --git a/gcc/config/i386/x86gprintrin.h b/gcc/config/i386/x86gprintrin.h
index 017ec29..e0be01d 100644
--- a/gcc/config/i386/x86gprintrin.h
+++ b/gcc/config/i386/x86gprintrin.h
@@ -24,7 +24,7 @@
#ifndef _X86GPRINTRIN_H_INCLUDED
#define _X86GPRINTRIN_H_INCLUDED
-#if defined __MMX__ || defined __SSE__
+#if !defined _SOFT_FLOAT || defined __MMX__ || defined __SSE__
#pragma GCC push_options
#pragma GCC target("general-regs-only")
#define __DISABLE_GENERAL_REGS_ONLY__
diff --git a/gcc/testsuite/gcc.target/i386/pr104890.c b/gcc/testsuite/gcc.target/i386/pr104890.c
new file mode 100644
index 0000000..cb430ee
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr104890.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-O2 -mshstk -march=i686" } */
+
+#include <x86gprintrin.h>
+
+__attribute__((target ("general-regs-only")))
+int
+foo ()
+{
+ return _get_ssp ();
+}