aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr88087.c
blob: c48dba5bf21c339197d337b616f5fd71a08cd45e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile } */
/* { dg-options "-O2 -fno-code-hoisting -fdump-tree-pre-stats" } */

int f();
int d;
void c(int x)
{
  int (*fp)() __attribute__((const)) = (void *)f;
  if (x)
    d = fp ();
  int tem = fp ();
  f();
  d = tem;
}

/* We shouldn't ICE and PRE the const call.  */
/* { dg-final { scan-tree-dump "Eliminated: 1" "pre" } } */