diff options
author | liuhongt <hongtao.liu@intel.com> | 2020-09-16 13:56:30 +0800 |
---|---|---|
committer | liuhongt <hongtao.liu@intel.com> | 2020-09-17 12:59:35 +0800 |
commit | a8c4b66a41fa805757f5943bd41690243365bccd (patch) | |
tree | d4c8f331c87574822c1a3806c3969541ed2b63ab | |
parent | ecde1b0a467127714872785b9935fe7c580778f0 (diff) | |
download | gcc-a8c4b66a41fa805757f5943bd41690243365bccd.zip gcc-a8c4b66a41fa805757f5943bd41690243365bccd.tar.gz gcc-a8c4b66a41fa805757f5943bd41690243365bccd.tar.bz2 |
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.
-rw-r--r-- | gcc/common/config/i386/i386-common.c | 5 | ||||
-rw-r--r-- | 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 5305145..6e34095 100644 --- a/gcc/common/config/i386/i386-common.c +++ b/gcc/common/config/i386/i386-common.c @@ -187,12 +187,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 0000000..ca87a79 --- /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); +} |