public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Uros Bizjak <uros@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-7147] i386: -mno-xsave should disable all relevant ISA flags [PR104462]
Date: Wed,  9 Feb 2022 19:20:19 +0000 (GMT)	[thread overview]
Message-ID: <20220209192019.F0A563858D28@sourceware.org> (raw)

https://gcc.gnu.org/g:2f9ab267e725ddf2b6b44113e4fc4fb8b2a6adfb

commit r12-7147-g2f9ab267e725ddf2b6b44113e4fc4fb8b2a6adfb
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Wed Feb 9 20:19:45 2022 +0100

    i386: -mno-xsave should disable all relevant ISA flags [PR104462]
    
    2022-02-09  Uroš Bizjak  <ubizjak@gmail.com>
    
    gcc/ChangeLog:
    
            PR target/104462
            * common/config/i386/i386-common.cc (OPTION_MASK_ISA2_XSAVE_UNSET):
            Also include OPTION_MASK_ISA2_AVX2_UNSET.
    
    gcc/testsuite/ChangeLog:
    
            PR target/104462
            * gcc.target/i386/pr104462.c: New test.

Diff:
---
 gcc/common/config/i386/i386-common.cc    |  3 ++-
 gcc/testsuite/gcc.target/i386/pr104462.c | 13 +++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/gcc/common/config/i386/i386-common.cc b/gcc/common/config/i386/i386-common.cc
index 607e9f20e85..449df6351c9 100644
--- a/gcc/common/config/i386/i386-common.cc
+++ b/gcc/common/config/i386/i386-common.cc
@@ -206,7 +206,8 @@ along with GCC; see the file COPYING3.  If not see
   (OPTION_MASK_ISA_XSAVE | OPTION_MASK_ISA_XSAVEOPT_UNSET \
    | OPTION_MASK_ISA_XSAVES_UNSET | OPTION_MASK_ISA_XSAVEC_UNSET \
    | OPTION_MASK_ISA_AVX_UNSET)
-#define OPTION_MASK_ISA2_XSAVE_UNSET OPTION_MASK_ISA2_AMX_TILE_UNSET
+#define OPTION_MASK_ISA2_XSAVE_UNSET \
+  (OPTION_MASK_ISA2_AVX2_UNSET | OPTION_MASK_ISA2_AMX_TILE_UNSET)
 #define OPTION_MASK_ISA_XSAVEOPT_UNSET OPTION_MASK_ISA_XSAVEOPT
 #define OPTION_MASK_ISA_AVX2_UNSET \
   (OPTION_MASK_ISA_AVX2 | OPTION_MASK_ISA_AVX512F_UNSET)
diff --git a/gcc/testsuite/gcc.target/i386/pr104462.c b/gcc/testsuite/gcc.target/i386/pr104462.c
new file mode 100644
index 00000000000..7a5ee64f431
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr104462.c
@@ -0,0 +1,13 @@
+/* PR target/104462 */
+/* { dg-do compile } */
+/* { dg-options "-mavx512fp16 -mno-xsave" } */
+
+typedef _Float16 __attribute__((__vector_size__ (8))) F;
+
+F f;
+
+void
+foo (void)
+{
+  f *= -f;
+}


                 reply	other threads:[~2022-02-09 19:20 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=20220209192019.F0A563858D28@sourceware.org \
    --to=uros@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).