From eb5e1998e29873ba77deff357dc27e8cef53dff0 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Mon, 8 Mar 2021 12:56:06 +0100 Subject: i386: Properly set ix86_isa_flags gcc/ChangeLog: PR target/99464 * config/i386/i386-options.c (ix86_option_override_internal): Set isa_flags for OPTS argument and not for the global global_options. gcc/testsuite/ChangeLog: PR target/99464 * gcc.target/i386/pr99464.c: New test. --- gcc/config/i386/i386-options.c | 8 ++++---- gcc/testsuite/gcc.target/i386/pr99464.c | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr99464.c (limited to 'gcc') diff --git a/gcc/config/i386/i386-options.c b/gcc/config/i386/i386-options.c index 410fa0c..e93935f 100644 --- a/gcc/config/i386/i386-options.c +++ b/gcc/config/i386/i386-options.c @@ -2159,11 +2159,11 @@ ix86_option_override_internal (bool main_args_p, && !(opts->x_ix86_isa_flags2_explicit & OPTION_MASK_ISA2_MOVBE)) opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA2_MOVBE; if (((processor_alias_table[i].flags & PTA_AES) != 0) - && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_AES)) - ix86_isa_flags |= OPTION_MASK_ISA_AES; + && !(opts->x_ix86_isa_flags_explicit & OPTION_MASK_ISA_AES)) + opts->x_ix86_isa_flags |= OPTION_MASK_ISA_AES; if (((processor_alias_table[i].flags & PTA_SHA) != 0) - && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_SHA)) - ix86_isa_flags |= OPTION_MASK_ISA_SHA; + && !(opts->x_ix86_isa_flags_explicit & OPTION_MASK_ISA_SHA)) + opts->x_ix86_isa_flags |= OPTION_MASK_ISA_SHA; if (((processor_alias_table[i].flags & PTA_PCLMUL) != 0) && !(opts->x_ix86_isa_flags_explicit & OPTION_MASK_ISA_PCLMUL)) opts->x_ix86_isa_flags |= OPTION_MASK_ISA_PCLMUL; diff --git a/gcc/testsuite/gcc.target/i386/pr99464.c b/gcc/testsuite/gcc.target/i386/pr99464.c new file mode 100644 index 0000000..98dd938 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr99464.c @@ -0,0 +1,15 @@ +/* PR target/99464 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +#pragma GCC target("arch=cannonlake") + +#include + +volatile __m128i x; + +void extern +sha_test (void) +{ + x = _mm_sha1msg1_epu32 (x, x); +} -- cgit v1.1