OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [loop-5.c] - Rev 12

Compare with Previous | Blame | View Log

/* A test for induction variable merging.  */
 
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-vars" } */
 
void foo(long);
 
void xxx(void)
{
  long iter, jter;
 
  for (iter = 0, jter = 2; iter < 100; iter++, jter++)
    {
      foo (iter);
      foo (jter);
    }
}
 
/* Only iter variable should remain.  */
 
/* { dg-final { scan-tree-dump-times "int iter" 1 "vars" } } */
/* { dg-final { scan-tree-dump-times "jter" 0 "vars" } } */
 
/* And the use of jter should be replaced by iter + 2 */
 
/* { dg-final { scan-tree-dump-times " \\+ 2" 1 "vars" } } */
 
/* { dg-final { cleanup-tree-dump "vars" } } */
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.