public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v2] x86: Also check _SOFT_FLOAT in <x86gprintrin.h>
@ 2022-03-14 14:31 H.J. Lu
  2022-03-15 14:39 ` H.J. Lu
  2022-03-17 15:05 ` H.J. Lu
  0 siblings, 2 replies; 7+ messages in thread
From: H.J. Lu @ 2022-03-14 14:31 UTC (permalink / raw)
  To: gcc-patches; +Cc: Uros Bizjak, Matthias Klose

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.
---
 gcc/config/i386/x86gprintrin.h           |  2 +-
 gcc/testsuite/gcc.target/i386/pr104890.c | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gcc.target/i386/pr104890.c

diff --git a/gcc/config/i386/x86gprintrin.h b/gcc/config/i386/x86gprintrin.h
index 017ec299793..e0be01d5e78 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 00000000000..cb430eef688
--- /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 ();
+}
-- 
2.35.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-03-22 14:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-14 14:31 [PATCH v2] x86: Also check _SOFT_FLOAT in <x86gprintrin.h> H.J. Lu
2022-03-15 14:39 ` H.J. Lu
2022-03-16  1:57   ` Hongtao Liu
2022-03-16 13:28     ` H.J. Lu
2022-03-17 10:00       ` Marc Poulhiès
2022-03-17 15:05 ` H.J. Lu
2022-03-22 14:28   ` H.J. Lu

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).