URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 154 |
Rev 816 |
/* A test for induction variable merging. */
|
/* A test for induction variable merging. */
|
|
|
/* { dg-do compile } */
|
/* { dg-do compile } */
|
/* { dg-options "-O1 -fdump-tree-optimized" } */
|
/* { dg-options "-O1 -fdump-tree-optimized" } */
|
|
|
void foo(long);
|
void foo(long);
|
|
|
void xxx(void)
|
void xxx(void)
|
{
|
{
|
long iter, jter;
|
long iter, jter;
|
|
|
for (iter = 0, jter = 2; iter < 100; iter++, jter++)
|
for (iter = 0, jter = 2; iter < 100; iter++, jter++)
|
{
|
{
|
foo (iter);
|
foo (iter);
|
foo (jter);
|
foo (jter);
|
}
|
}
|
}
|
}
|
|
|
/* Only iter variable should remain. */
|
/* Only iter variable should remain. */
|
|
|
/* { dg-final { scan-tree-dump-times "int iter" 1 "optimized" } } */
|
/* { dg-final { scan-tree-dump-times "int iter" 1 "optimized" } } */
|
/* { dg-final { scan-tree-dump-times "jter" 0 "optimized" } } */
|
/* { dg-final { scan-tree-dump-times "jter" 0 "optimized" } } */
|
|
|
/* And the use of jter should be replaced by iter + 2 */
|
/* And the use of jter should be replaced by iter + 2 */
|
|
|
/* { dg-final { scan-tree-dump-times " \\+ 2" 1 "optimized" } } */
|
/* { dg-final { scan-tree-dump-times " \\+ 2" 1 "optimized" } } */
|
|
|
/* { dg-final { cleanup-tree-dump "optimized" } } */
|
/* { dg-final { cleanup-tree-dump "optimized" } } */
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.