1 /* PR37997 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-pre-details -fno-code-hoisting" } */
4
foo(int i,int b,int result)5 int foo (int i, int b, int result)
6 {
7 int mask;
8 if (b)
9 mask = -2;
10 else
11 mask = 0;
12 result = i + 1;
13 result = result & mask;
14 return result;
15 }
16
17 /* We should insert i + 1 into the if (b) path as well as the simplified
18 i + 1 & -2 expression. And do replacement with two PHI temps. */
19 /* With hoisting enabled we'd hoist i + 1 to before the if, retaining
20 only one PHI node. */
21
22 /* { dg-final { scan-tree-dump-times "with prephitmp" 2 "pre" } } */
23