1 /* PR tree-optimization/29738. We used not to realize that "i" can never 2 become nonzero. */ 3 4 /* { dg-do compile } */ 5 /* { dg-options "-O2 -fdump-tree-optimized" } */ 6 7 int i; 8 9 void foo (void); bar(void)10void bar (void) 11 { 12 int j; 13 i = 0; 14 for (j = 0; j < 10000; j++) 15 if (i) 16 foo (); 17 } 18 19 /* Everything except for the "i = 0" assignment should get removed. */ 20 /* { dg-final { scan-tree-dump-times "if" 0 "optimized" { xfail *-*-* } } } */ 21