]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Make pr104992.c irrelated to target vector feature [PR113418]
authorXi Ruoyao <xry111@xry111.site>
Tue, 23 Jan 2024 11:58:21 +0000 (19:58 +0800)
committerXi Ruoyao <xry111@xry111.site>
Mon, 4 Mar 2024 09:47:32 +0000 (17:47 +0800)
The vect_int_mod target selector is evaluated with the options in
DEFAULT_VECTCFLAGS in effect, but these options are not automatically
passed to tests out of the vect directories.  So this test fails on
targets where integer vector modulo operation is supported but requiring
an option to enable, for example LoongArch.

In this test case, the only expected optimization not happened in
original is in corge because it needs forward propogation.  So we can
scan the forwprop2 dump (where the vector operation is not expanded to
scalars yet) instead of optimized, then we don't need to consider
vect_int_mod or not.

gcc/testsuite/ChangeLog:

PR testsuite/113418
* gcc.dg/pr104992.c (dg-options): Use -fdump-tree-forwprop2
instead of -fdump-tree-optimized.
(dg-final): Scan forwprop2 dump instead of optimized, and remove
the use of vect_int_mod.
* lib/target-supports.exp (check_effective_target_vect_int_mod):
Remove because it's not used anymore.

gcc/testsuite/gcc.dg/pr104992.c
gcc/testsuite/lib/target-supports.exp

index 82f8c75559ca0338958c6a3934e42a504f047264..6fd513d34b2200a2f839e337b7d31a0fc08710f2 100644 (file)
@@ -1,6 +1,6 @@
 /* PR tree-optimization/104992 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wno-psabi -fdump-tree-optimized" } */
+/* { dg-options "-O2 -Wno-psabi -fdump-tree-forwprop2" } */
 
 #define vector __attribute__((vector_size(4*sizeof(int))))
 
@@ -54,5 +54,4 @@ __attribute__((noipa)) unsigned waldo (unsigned x, unsigned y, unsigned z) {
     return x / y * z == x;
 }
 
-/* { dg-final { scan-tree-dump-times " % " 9 "optimized" { target { ! vect_int_mod } } } } */
-/* { dg-final { scan-tree-dump-times " % " 6 "optimized" { target vect_int_mod } } } */
+/* { dg-final { scan-tree-dump-times " % " 6 "forwprop2" } } */
index 4138cc9a6629f5fd38aec5cf07181feb24639c01..ae33c4f1e3af03495606f4149c044aef5ffbde42 100644 (file)
@@ -9064,19 +9064,6 @@ proc check_effective_target_vect_long_mult { } {
     return $answer
 }
 
-# Return 1 if the target supports vector int modulus, 0 otherwise.
-
-proc check_effective_target_vect_int_mod { } {
-    return [check_cached_effective_target_indexed vect_int_mod {
-      expr { ([istarget powerpc*-*-*]
-             && [check_effective_target_has_arch_pwr10])
-             || [istarget amdgcn-*-*]
-             || ([istarget loongarch*-*-*]
-                && [check_effective_target_loongarch_sx])
-             || ([istarget riscv*-*-*]
-                && [check_effective_target_riscv_v]) }}]
-}
-
 # Return 1 if the target supports vector even/odd elements extraction, 0 otherwise.
 
 proc check_effective_target_vect_extract_even_odd { } {