aboutsummaryrefslogtreecommitdiff
path: root/gcc/common
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-12-21 09:45:30 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2017-12-21 09:45:30 +0100
commitb1ccd09a7786c047a02f6eae42d431483be6a0ea (patch)
treec0b88ab7c74e93f2cd2b00a8446ac9ce383e9860 /gcc/common
parent079b4a9c4aa1bee7ce03746e243b54a4d2752515 (diff)
downloadgcc-b1ccd09a7786c047a02f6eae42d431483be6a0ea.zip
gcc-b1ccd09a7786c047a02f6eae42d431483be6a0ea.tar.gz
gcc-b1ccd09a7786c047a02f6eae42d431483be6a0ea.tar.bz2
re PR target/83488 (ICE on a CET test-case)
PR target/83488 * config/i386/i386.c (ix86_target_string): Move -mavx512vbmi2 and -mshstk entries from isa_opts2 to isa_opts and -mhle, -mmovbe, -mclzero and -mmwaitx entries from isa_opts to isa_opts2. (ix86_option_override_internal): Adjust for OPTION_MASK_ISA_{HLE,MOVBE,CLZERO,MWAITX} moving to ix86_isa_flags2 and OPTION_MASK_ISA_SHSTK moving to ix86_isa_flags. (BDESC_VERIFYS): Remove SPECIAL_ARGS2 related checks. (ix86_init_mmx_sse_builtins): Remove bdesc_special_args2 handling. Use def_builtin2 instead of def_builtin for OPTION_MASK_ISA_MWAITX and OPTION_MASK_ISA_CLZERO builtins. Use def_builtin instead of def_builtin2 for CET builtins. (ix86_expand_builtin): Remove bdesc_special_args2 handling. Fix up formatting in IX86_BUILTIN_RDPID code. * config/i386/i386-builtin.def: Move VBMI2 builtins from SPECIAL_ARGS2 section to SPECIAL_ARGS and from ARGS2 section to ARGS. * config/i386/i386.opt (mavx512vbmi2, mshstk): Move from ix86_isa_flags2 to ix86_isa_flags. (mhle, mmovbe, mclzero, mmwaitx): Move from ix86_isa_flags to ix86_isa_flags2. * config/i386/i386-c.c (ix86_target_macros_internal): Check for OPTION_MASK_ISA_{CLZERO,MWAITX} in isa_flag2 instead of isa_flag. Check for OPTION_MASK_ISA_{SHSTK,AVX512VBMI2} in isa_flag instead of isa_flag2. * common/config/i386/i386-common.c (OPTION_MASK_ISA_AVX512VBMI2_SET): Or in OPTION_MASK_ISA_AVX512F_SET. (OPTION_MASK_ISA_AVX512F_UNSET): Or in OPTION_MASK_ISA_AVX512VBMI2_UNSET. (ix86_handle_option): Adjust for OPTION_MASK_ISA_{SHSTK,AVX512VBMI2}_*SET being in ix86_isa_flags and OPTION_MASK_ISA_{MOVBE,MWAITX,CLZERO}_*SET in ix86_isa_flags2. * gcc.target/i386/pr83488.c: New test. From-SVN: r255937
Diffstat (limited to 'gcc/common')
-rw-r--r--gcc/common/config/i386/i386-common.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/gcc/common/config/i386/i386-common.c b/gcc/common/config/i386/i386-common.c
index 00eb017..5a339f0 100644
--- a/gcc/common/config/i386/i386-common.c
+++ b/gcc/common/config/i386/i386-common.c
@@ -80,7 +80,8 @@ along with GCC; see the file COPYING3. If not see
(OPTION_MASK_ISA_AVX512VBMI | OPTION_MASK_ISA_AVX512BW_SET)
#define OPTION_MASK_ISA_AVX5124FMAPS_SET OPTION_MASK_ISA_AVX5124FMAPS
#define OPTION_MASK_ISA_AVX5124VNNIW_SET OPTION_MASK_ISA_AVX5124VNNIW
-#define OPTION_MASK_ISA_AVX512VBMI2_SET OPTION_MASK_ISA_AVX512VBMI2
+#define OPTION_MASK_ISA_AVX512VBMI2_SET \
+ (OPTION_MASK_ISA_AVX512VBMI2 | OPTION_MASK_ISA_AVX512F_SET)
#define OPTION_MASK_ISA_AVX512VNNI_SET OPTION_MASK_ISA_AVX512VNNI
#define OPTION_MASK_ISA_AVX512VPOPCNTDQ_SET OPTION_MASK_ISA_AVX512VPOPCNTDQ
#define OPTION_MASK_ISA_RTM_SET OPTION_MASK_ISA_RTM
@@ -183,7 +184,7 @@ along with GCC; see the file COPYING3. If not see
(OPTION_MASK_ISA_AVX512F | OPTION_MASK_ISA_AVX512CD_UNSET \
| OPTION_MASK_ISA_AVX512PF_UNSET | OPTION_MASK_ISA_AVX512ER_UNSET \
| OPTION_MASK_ISA_AVX512DQ_UNSET | OPTION_MASK_ISA_AVX512BW_UNSET \
- | OPTION_MASK_ISA_AVX512VL_UNSET)
+ | OPTION_MASK_ISA_AVX512VL_UNSET | OPTION_MASK_ISA_AVX512VBMI2_UNSET)
#define OPTION_MASK_ISA_AVX512CD_UNSET OPTION_MASK_ISA_AVX512CD
#define OPTION_MASK_ISA_AVX512PF_UNSET OPTION_MASK_ISA_AVX512PF
#define OPTION_MASK_ISA_AVX512ER_UNSET OPTION_MASK_ISA_AVX512ER
@@ -533,13 +534,13 @@ ix86_handle_option (struct gcc_options *opts,
case OPT_mshstk:
if (value)
{
- opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA_SHSTK_SET;
- opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA_SHSTK_SET;
+ opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SHSTK_SET;
+ opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SHSTK_SET;
}
else
{
- opts->x_ix86_isa_flags2 &= ~OPTION_MASK_ISA_SHSTK_UNSET;
- opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA_SHSTK_UNSET;
+ opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_SHSTK_UNSET;
+ opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_SHSTK_UNSET;
}
return true;
@@ -602,15 +603,13 @@ ix86_handle_option (struct gcc_options *opts,
case OPT_mavx512vbmi2:
if (value)
{
- opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA_AVX512VBMI2_SET;
- opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA_AVX512VBMI2_SET;
- opts->x_ix86_isa_flags |= OPTION_MASK_ISA_AVX512F_SET;
- opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_AVX512F_SET;
+ opts->x_ix86_isa_flags |= OPTION_MASK_ISA_AVX512VBMI2_SET;
+ opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_AVX512VBMI2_SET;
}
else
{
- opts->x_ix86_isa_flags2 &= ~OPTION_MASK_ISA_AVX512VBMI2_UNSET;
- opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA_AVX512VBMI2_UNSET;
+ opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_AVX512VBMI2_UNSET;
+ opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_AVX512VBMI2_UNSET;
}
return true;
@@ -917,13 +916,13 @@ ix86_handle_option (struct gcc_options *opts,
case OPT_mmovbe:
if (value)
{
- opts->x_ix86_isa_flags |= OPTION_MASK_ISA_MOVBE_SET;
- opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_MOVBE_SET;
+ opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA_MOVBE_SET;
+ opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA_MOVBE_SET;
}
else
{
- opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_MOVBE_UNSET;
- opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_MOVBE_UNSET;
+ opts->x_ix86_isa_flags2 &= ~OPTION_MASK_ISA_MOVBE_UNSET;
+ opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA_MOVBE_UNSET;
}
return true;
@@ -1164,26 +1163,26 @@ ix86_handle_option (struct gcc_options *opts,
case OPT_mmwaitx:
if (value)
{
- opts->x_ix86_isa_flags |= OPTION_MASK_ISA_MWAITX_SET;
- opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_MWAITX_SET;
+ opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA_MWAITX_SET;
+ opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA_MWAITX_SET;
}
else
{
- opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_MWAITX_UNSET;
- opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_MWAITX_UNSET;
+ opts->x_ix86_isa_flags2 &= ~OPTION_MASK_ISA_MWAITX_UNSET;
+ opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA_MWAITX_UNSET;
}
return true;
case OPT_mclzero:
if (value)
{
- opts->x_ix86_isa_flags |= OPTION_MASK_ISA_CLZERO_SET;
- opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_CLZERO_SET;
+ opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA_CLZERO_SET;
+ opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA_CLZERO_SET;
}
else
{
- opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_CLZERO_UNSET;
- opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_CLZERO_UNSET;
+ opts->x_ix86_isa_flags2 &= ~OPTION_MASK_ISA_CLZERO_UNSET;
+ opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA_CLZERO_UNSET;
}
return true;