view gcc/testsuite/gcc.dg/tree-ssa/slsr-36.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* Verify straight-line strength reduction for a candidate with a basis
   hidden by a phi dependences, having an unknown stride, and where the 
   phi has an argument which is a parameter.  */

/* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-optimized" } */

int
f (int s, int c, int i)
{
  int a1, a3, x1, x3, x;

  a1 = i * s;
  x1 = c + a1;

  if (x1 > 6)
    i = i + 2;

  i = i + 2;
  a3 = i * s;
  x3 = c + a3;

  x = x1 + x3;
  return x;
}

/* { dg-final { scan-tree-dump-times " \\* s" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times " \\* 2" 1 "optimized" } } */