public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r10-8771] If -mavx implies -mxsave, then -mno-xsave should imply -mno-avx.
@ 2020-09-17  5:10 hongtao Liu
  0 siblings, 0 replies; only message in thread
From: hongtao Liu @ 2020-09-17  5:10 UTC (permalink / raw)
  To: gcc-cvs

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

commit r10-8771-ga99116a2cab3f1265a79ffe10ad63fe4ee26f10a
Author: liuhongt <hongtao.liu@intel.com>
Date:   Wed Sep 16 13:56:30 2020 +0800

    If -mavx implies -mxsave, then -mno-xsave should imply -mno-avx.
    
    Current status is -mno-avx implies -mno-xsave which should be wrong.
    
    gcc/ChangeLog
    
            * common/config/i386/i386-common.c
            (OPTION_MASK_ISA_AVX_UNSET): Remove OPTION_MASK_ISA_XSAVE_UNSET.
            (OPTION_MASK_ISA_XSAVE_UNSET): Add OPTION_MASK_ISA_AVX_UNSET.
    
    gcc/testsuite/ChangeLog
    
            * gcc.target/i386/xsave-avx-1.c: New test.

Diff:
---
 gcc/common/config/i386/i386-common.c        |  5 +++--
 gcc/testsuite/gcc.target/i386/xsave-avx-1.c | 12 ++++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/gcc/common/config/i386/i386-common.c b/gcc/common/config/i386/i386-common.c
index 8e4cd64542d..1e4d25f052a 100644
--- a/gcc/common/config/i386/i386-common.c
+++ b/gcc/common/config/i386/i386-common.c
@@ -185,12 +185,13 @@ along with GCC; see the file COPYING3.  If not see
 #define OPTION_MASK_ISA_AVX_UNSET \
   (OPTION_MASK_ISA_AVX | OPTION_MASK_ISA_FMA_UNSET \
    | OPTION_MASK_ISA_FMA4_UNSET | OPTION_MASK_ISA_F16C_UNSET \
-   | OPTION_MASK_ISA_AVX2_UNSET | OPTION_MASK_ISA_XSAVE_UNSET)
+   | OPTION_MASK_ISA_AVX2_UNSET )
 #define OPTION_MASK_ISA_FMA_UNSET OPTION_MASK_ISA_FMA
 #define OPTION_MASK_ISA_FXSR_UNSET OPTION_MASK_ISA_FXSR
 #define OPTION_MASK_ISA_XSAVE_UNSET \
   (OPTION_MASK_ISA_XSAVE | OPTION_MASK_ISA_XSAVEOPT_UNSET \
-   | OPTION_MASK_ISA_XSAVES_UNSET | OPTION_MASK_ISA_XSAVEC_UNSET)
+   | OPTION_MASK_ISA_XSAVES_UNSET | OPTION_MASK_ISA_XSAVEC_UNSET \
+   | OPTION_MASK_ISA_AVX_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/xsave-avx-1.c b/gcc/testsuite/gcc.target/i386/xsave-avx-1.c
new file mode 100644
index 00000000000..ca87a791446
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/xsave-avx-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-mxsave -mno-avx" } */
+
+#include <immintrin.h>
+
+extern int m;
+
+void
+avx_imply_save (void)
+{
+  _xgetbv (m);
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-17  5:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17  5:10 [gcc r10-8771] If -mavx implies -mxsave, then -mno-xsave should imply -mno-avx hongtao Liu

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