blob: ee9b80fd9c3d6e6813a54a6c6dea33643e7c4577 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-reassoc1" } */
unsigned int
foo(unsigned int a, unsigned int b, unsigned int c, unsigned int d,
unsigned int e, unsigned int f, unsigned int g, unsigned int h)
{
/* Should be transformed into a + c + d + e + g + 15 */
unsigned int i = (a + 9) + (c + d);
unsigned int j = (e + 4) + (2 + g);
e = i + j;
return e;
}
/* { dg-final { scan-tree-dump-times "\\\+ 15" 1 "reassoc1"} } */
/* { dg-final { cleanup-tree-dump "reassoc1" } } */
|