(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
pr77975.c
       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
       8  foo (unsigned int *b)
       9  {
      10    unsigned int a = 8;
      11    while (a)
      12      {
      13        a += 5;
      14        a &= 44;
      15        *b += a;
      16      }
      17    return a; 
      18  }
      19  
      20  /* { dg-final { scan-tree-dump-times "Proved that loop 1 iterates 2 times using brute force" 1 "ivcanon" } } */
      21  
      22  unsigned int
      23  bar (unsigned int *b)
      24  {
      25    unsigned int a = 3;
      26    while (a)
      27      {
      28        a += 5;
      29        a &= 44;
      30        *b += a;
      31      }
      32    return a; 
      33  }