Using specific SSA names in pattern matching in `dg-final' makes tests
"unstable", in that changes in passes prior to the pass whose dump is
analyzed in the particular test may change the numbering of the SSA
variables, causing the test to start failing spuriously.

We thus switch from specific SSA names to the use of a multi-line
regular expression making use of capture groups for matching particular
variables across different statements, ensuring the test will pass
more consistently across different versions of GCC.

        PR testsuite/118597

gcc/testsuite/ChangeLog:

        * gcc.dg/vect/vect-fncall-mask.c: Update test directives.
---
 gcc/testsuite/gcc.dg/vect/vect-fncall-mask.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/vect/vect-fncall-mask.c 
b/gcc/testsuite/gcc.dg/vect/vect-fncall-mask.c
index 554488e0630..ba1886da5ca 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-fncall-mask.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-fncall-mask.c
@@ -1,7 +1,7 @@
 /* { dg-do compile { target { aarch64*-*-* } } } */
-/* { dg-additional-options "-march=armv8.2-a+sve -fdump-tree-ifcvt-raw -Ofast" 
{ target { aarch64*-*-* } } } */
+/* { dg-additional-options "-march=armv8.2-a+sve -fdump-tree-ifcvt -Ofast" { 
target { aarch64*-*-* } } } */
 
-extern int __attribute__ ((simd, const)) fn (int);
+extern int __attribute__ ((simd, const)) fn (float);
 
 const int N = 20;
 const float lim = 101.0;
@@ -26,6 +26,4 @@ int main (void)
   return (0);
 }
 
-/* { dg-final { scan-tree-dump {gimple_assign <gt_expr, _12, _1, 1.01e\+2, 
NULL>} ifcvt } } */
-/* { dg-final { scan-tree-dump {gimple_assign <bit_not_expr, _34, _12, NULL, 
NULL>} ifcvt } } */
-/* { dg-final { scan-tree-dump {gimple_call <.MASK_CALL, _3, fn, _2, _34>} 
ifcvt } } */
+/* { dg-final { scan-tree-dump {(_\d+) = (_\d+) > 1.01e\+2;\n\s*(_\d+) = 
~\1;\n\s*_\d+ = .MASK_CALL \(fn, \2, \3\);} ifcvt } } */
-- 
2.43.0

Reply via email to