blob: 1105594a9f91d86414e1135bba5bfa5f7154a521 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized -fpredictive-commoning" } */
double in;
extern void Write (double);
void foo (void)
{
static double X[9];
int i;
X[1] = in * in;
for (i = 2; i <= 8; i++)
X[i] = X[i - 1] * X[1];
Write (X[5]);
}
/* Load of X[i - i] can be omitted by reusing X[i] in previous iteration. */
/* { dg-final { scan-tree-dump-not ".* = MEM.*;" "optimized" } } */
|