blob: fd5376220a5e26a3de443d719131d3a36ca3c601 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
/* { dg-do compile } */
/* { dg-options "-fdump-tree-original" } */
int foo (int i)
{
return 2 + i * 4;
}
/* We do _not_ want the above to be canonicalized to (i * 2 + 1) * 2. */
int bar (int i)
{
return 4 + i * 2;
}
/* But eventually this to be canonicalized to (i + 2) * 2. */
/* { dg-final { scan-tree-dump "i \\\* 4 \\\+ 2" "original" } } */
/* { dg-final { scan-tree-dump "\\\(i \\\+ 2\\\) \\\* 2" "original" } } */
/* { dg-final { cleanup-tree-dump "original" } } */
|