public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/pheeck/heads/sccp)] Modify test, to prevent the next patch breaking it
@ 2023-02-15 10:17 Filip Kastl
  0 siblings, 0 replies; only message in thread
From: Filip Kastl @ 2023-02-15 10:17 UTC (permalink / raw)
  To: gcc-cvs

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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-15 10:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-15 10:17 [gcc(refs/users/pheeck/heads/sccp)] Modify test, to prevent the next patch breaking it Filip Kastl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).