1 /* PR tree-optimization/77975 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-ivcanon-details" } */
4 
5 /* { dg-final { scan-tree-dump-times "Proved that loop 1 iterates 1 times using brute force" 1 "ivcanon" } } */
6 
7 unsigned int
foo(unsigned int * b)8 foo (unsigned int *b)
9 {
10   unsigned int a = 3;
11   while (a)
12     {
13       a >>= 1;
14       *b += a;
15     }
16   return a;
17 }
18 
19 /* { dg-final { scan-tree-dump-times "Proved that loop 1 iterates 2 times using brute force" 1 "ivcanon" } } */
20 
21 unsigned int
bar(unsigned int * b)22 bar (unsigned int *b)
23 {
24   unsigned int a = 7;
25   while (a)
26     {
27       a >>= 1;
28       *b += a;
29     }
30   return a;
31 }
32