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.
This commit is contained in:
Uros Bizjak 2022-02-09 20:19:45 +01:00
parent 2b399dbabd
commit 2f9ab267e7
2 changed files with 15 additions and 1 deletions

View File

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

View File

@ -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;
}