1 /* PR tree-optimization/59358 */ 2 3 __attribute__((noinline, noclone)) int foo(int * x,int y)4foo (int *x, int y) 5 { 6 int z = *x; 7 if (y > z && y <= 16) 8 while (y > z) 9 z *= 2; 10 return z; 11 } 12 13 int main()14main () 15 { 16 int i; 17 for (i = 1; i < 17; i++) 18 { 19 int j = foo (&i, 16); 20 int k; 21 if (i >= 8 && i <= 15) 22 k = 16 + (i - 8) * 2; 23 else if (i >= 4 && i <= 7) 24 k = 16 + (i - 4) * 4; 25 else if (i == 3) 26 k = 24; 27 else 28 k = 16; 29 if (j != k) 30 __builtin_abort (); 31 j = foo (&i, 7); 32 if (i >= 7) 33 k = i; 34 else if (i >= 4) 35 k = 8 + (i - 4) * 2; 36 else if (i == 3) 37 k = 12; 38 else 39 k = 8; 40 if (j != k) 41 __builtin_abort (); 42 } 43 return 0; 44 } 45