Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / gcc.dg / no-strict-overflow-8.c
blob51df1c4470ceedcb0703b80f64d09d1dd21fa658
1 /* { dg-do compile } */
2 /* { dg-options "-fno-strict-overflow -O2 -fdump-tree-optimized" } */
4 /* We cannot fold i > 0 because p->a - p->b can be larger than INT_MAX
5 and thus i can wrap. Dual of Wstrict-overflow-18.c */
7 struct c { unsigned int a; unsigned int b; };
8 extern void bar (struct c *);
9 int
10 foo (struct c *p)
12 int i;
13 int sum = 0;
15 for (i = 0; i < p->a - p->b; ++i)
17 if (i > 0)
18 sum += 2;
19 bar (p);
21 return sum;
24 /* { dg-final { scan-tree-dump "i_.* > 0" "optimized" } } */