public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: H.J. Lu <hjl@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r11-9685] x86: Also check _SOFT_FLOAT in <x86gprintrin.h>
Date: Tue, 22 Mar 2022 16:31:44 +0000 (GMT)	[thread overview]
Message-ID: <20220322163144.909B53858407@sourceware.org> (raw)

https://gcc.gnu.org/g:f407033b7ca27a75cccef8310360e275cdb94d26

commit r11-9685-gf407033b7ca27a75cccef8310360e275cdb94d26
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Mar 13 08:57:51 2022 -0700

    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.
    
    (cherry picked from commit 3117ffce4c1598a35e724138735b099262353358)

Diff:
---
 gcc/config/i386/x86gprintrin.h           |  2 +-
 gcc/testsuite/gcc.target/i386/pr104890.c | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/gcc/config/i386/x86gprintrin.h b/gcc/config/i386/x86gprintrin.h
index b7fefa780a6..7319e373ae9 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 ();
+}


                 reply	other threads:[~2022-03-22 16:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220322163144.909B53858407@sourceware.org \
    --to=hjl@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).