aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaochen Jiang <haochen.jiang@intel.com>2025-02-10 16:53:27 +0800
committerHaochen Jiang <haochen.jiang@intel.com>2025-02-17 11:01:36 +0800
commite15216046dba02ffa1c3ae367cdc86d5fd3df0be (patch)
treebd78a27c8e4ad592ee64b23a8ad7e2f9b577edcf
parentae14d7d04da8c6cb542269722638071f999f94d8 (diff)
downloadgcc-e15216046dba02ffa1c3ae367cdc86d5fd3df0be.zip
gcc-e15216046dba02ffa1c3ae367cdc86d5fd3df0be.tar.gz
gcc-e15216046dba02ffa1c3ae367cdc86d5fd3df0be.tar.bz2
i386: Do not check vector size conflict when AVX512 is not explicitly set [PR 118815]
When AVX512 is not explicitly set, we should not take EVEX512 bit into consideration when checking vector size. It will solve the intrin header file reporting warnings when compiling with -Wsystem-headers. However, there is side effect on the usage for '-march=xxx -mavx10.1-256', where xxx is with AVX512. It will not report warning on vector size for now. Since it is a rare usage, we will take it. gcc/ChangeLog: PR target/118815 * config/i386/i386-options.cc (ix86_option_override_internal): Do not check vector size conflict when AVX512 is not explicitly set. gcc/testsuite/ChangeLog: PR target/118815 * gcc.target/i386/pr118815.c: New test.
-rw-r--r--gcc/config/i386/i386-options.cc1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr118815.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc
index 3467ab0..7e85334 100644
--- a/gcc/config/i386/i386-options.cc
+++ b/gcc/config/i386/i386-options.cc
@@ -2711,6 +2711,7 @@ ix86_option_override_internal (bool main_args_p,
"using 512 as max vector size");
}
else if (TARGET_AVX512F_P (opts->x_ix86_isa_flags)
+ && (opts->x_ix86_isa_flags_explicit & OPTION_MASK_ISA_AVX512F)
&& !(OPTION_MASK_ISA2_EVEX512
& opts->x_ix86_isa_flags2_explicit))
warning (0, "Vector size conflicts between AVX10.1 and AVX512, using "
diff --git a/gcc/testsuite/gcc.target/i386/pr118815.c b/gcc/testsuite/gcc.target/i386/pr118815.c
new file mode 100644
index 0000000..84308fc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr118815.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=x86-64-v3" } */
+
+#pragma GCC push_options
+#pragma GCC target("avx10.2-256")
+
+void foo();
+
+#pragma GCC pop_options