aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr92712-1.c
blob: c19ff5cf29c6d52b40bf6df6668b00491b58e99a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* PR tree-optimization/92712 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
/* { dg-final { scan-tree-dump " = \[tv]_\[0-9]*\\\(D\\\) \\* \[tv]_\[0-9]*\\\(D\\\);" "optimized" } } */

static int
foo (int t, int v)
{
  int i, x = 0;
  for (int i = 0; i < t; ++i)
    x += v;
  return x;
}

int
bar (int t, int v)
{
  if (t < 0)
    __builtin_unreachable ();
  return foo (t, v);
}