aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Carlotti <andrew.carlotti@arm.com>2022-11-07 14:35:08 +0000
committerAndrew Carlotti <andrew.carlotti@arm.com>2022-11-21 16:00:51 +0000
commit2aec4088835ae5996ef818b326a0ff133307dbc5 (patch)
treeae61e5cda81a5165b736fea2cedbb4a923b688a4
parenteea52e38dd81b6632546b7cf933479986c972c69 (diff)
downloadgcc-2aec4088835ae5996ef818b326a0ff133307dbc5.zip
gcc-2aec4088835ae5996ef818b326a0ff133307dbc5.tar.gz
gcc-2aec4088835ae5996ef818b326a0ff133307dbc5.tar.bz2
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.
-rw-r--r--gcc/testsuite/gcc.dg/pr77975.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/testsuite/gcc.dg/pr77975.c b/gcc/testsuite/gcc.dg/pr77975.c
index 148cebd..a187ce2 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;