[gcc(refs/users/pheeck/heads/sccp)] Modify test, to prevent the next patch breaking it

Filip Kastl pheeck@gcc.gnu.org
Wed Feb 15 10:17:13 GMT 2023


https://gcc.gnu.org/g:7796a5b1dc7a897a360fafbc5059b05018c661e6

commit 7796a5b1dc7a897a360fafbc5059b05018c661e6
Author: Andrew Carlotti <andrew.carlotti@arm.com>
Date:   Mon Nov 7 14:35:08 2022 +0000

    Modify test, to prevent the next patch breaking it
    
    The upcoming c[lt]z idiom recognition patch eliminates the need for a
    brute force computation of the iteration count of these loops. The test
    is intended to verify that ivcanon can determine the loop count when the
    condition is given by a chain of constant computations.
    
    We replace the constant operations with a more complicated chain that should
    resist future idiom recognition.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.dg/pr77975.c: Make tests more robust.

Diff:
---
 gcc/testsuite/gcc.dg/pr77975.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/pr77975.c b/gcc/testsuite/gcc.dg/pr77975.c
index 148cebdded9..a187ce2b50c 100644
--- a/gcc/testsuite/gcc.dg/pr77975.c
+++ b/gcc/testsuite/gcc.dg/pr77975.c
@@ -7,10 +7,11 @@
 unsigned int
 foo (unsigned int *b)
 {
-  unsigned int a = 3;
+  unsigned int a = 8;
   while (a)
     {
-      a >>= 1;
+      a += 5;
+      a &= 44;
       *b += a;
     }
   return a; 
@@ -21,10 +22,11 @@ foo (unsigned int *b)
 unsigned int
 bar (unsigned int *b)
 {
-  unsigned int a = 7;
+  unsigned int a = 3;
   while (a)
     {
-      a >>= 1;
+      a += 5;
+      a &= 44;
       *b += a;
     }
   return a;


More information about the Gcc-cvs mailing list