]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix test to not depend on DECL_UIDs
authorJeff Law <jeffreyalaw@gmail.com>
Sun, 20 Nov 2022 01:47:20 +0000 (20:47 -0500)
committerJeff Law <jeffreyalaw@gmail.com>
Sun, 20 Nov 2022 01:49:56 +0000 (20:49 -0500)
The tester started tripping this on s390-linux-gnu:

Tests that now fail, but worked before (19 tests):

gcc.dg/pr96542.c scan-tree-dump-times evrp "254" 2

The problem is we search for "254" in the dump file.  The dump file contains
UIDs for function declarations.  So changes in the number of predefined DECL
nodes can make the test pass or file depending on whether or not a decl with
a UID containing "254" shows up.  Like this:

;; Function foo (foo, funcdef_no=0, decl_uid=2542, cgraph_uid=1, symbol_order=0)

ISTM the test wants to look for a "return 254" rather than just "254".
I added a change for that to the tester.  Naturally that fixed the test on
s390 and the dozen or so targets I tested didn't show any regressions.

gcc/testsuite
* gcc.dg/pr96542.c: Avoid falsely matching DECL_UIDs with
the number 254 in them.

gcc/testsuite/gcc.dg/pr96542.c

index 5014f2acad8348368335bd1ecb425947afe6a494..0aad2e9494e7f7a9ca8e1a6e7fa5a204ffe0d34e 100644 (file)
@@ -22,6 +22,6 @@ baz (unsigned int x)
   return (-1U >> x) * 16;
 }
 
-/* { dg-final { scan-tree-dump-times  "254" 2 "evrp" } }  */
+/* { dg-final { scan-tree-dump-times  "return 254" 2 "evrp" } }  */
 /* { dg-final { scan-tree-dump "= PHI <32.*, 4294967280" "evrp" } }  */