1 /* PR tree-optimization/61839. */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-evrp" } */
4 /* { dg-require-effective-target int32plus } */
6 __attribute__ ((noinline
))
10 volatile unsigned b
= 1U;
12 c
= (a
+ 972195718) / (b
? 2 : 0);
20 __attribute__ ((noinline
))
24 volatile unsigned b
= 1U;
26 c
= (a
+ 972195718) % (b
? 2 : 0);
34 __attribute__ ((noinline
))
38 volatile unsigned b
= 1U;
40 c
= (a
+ 972195716) % (b
? 1 : 2);
49 /* Dont optimize 972195717 / 0 in function foo. */
50 /* { dg-final { scan-tree-dump-times "972195717 / " 1 "evrp" } } */
51 /* Dont optimize 972195717 % 0 in function bar. */
52 /* { dg-final { scan-tree-dump-times "972195717 % " 1 "evrp" } } */
53 /* May optimize in function bar2, but EVRP doesn't perform this yet. */
54 /* { dg-final { scan-tree-dump-times "972195715 % " 0 "evrp" { xfail *-*-* } } } */