blob: 1105594a9f91d86414e1135bba5bfa5f7154a521 [file] [log] [blame]
/* { 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" } } */