aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/pr119614-3.c
blob: 59ed36b0ab538201b7c907073fafc6ca4f969d8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* PR tree-optimization/119614 */
/* { dg-do compile { target musttail } } */
/* { dg-options "-O2" } */

volatile int v;

[[gnu::noinline]] double
foo (int x)
{
  v += x;
  return 0.5;
}

double
bar (int x)
{
  if (x == 42)
    [[gnu::musttail]] return foo (42);
  [[gnu::musttail]] return foo (32);
}

double
baz (int x)
{
  if (x == 5)
    return foo (42);
  return foo (32);
}