File: inlinehint-3.c

package info (click to toggle)
gcc-riscv64-unknown-elf 8.3.0.2019.08%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 680,956 kB
  • sloc: ansic: 3,237,715; cpp: 896,882; ada: 772,854; f90: 144,254; asm: 68,788; makefile: 67,456; sh: 29,743; exp: 28,045; objc: 15,273; fortran: 11,885; python: 7,369; pascal: 5,375; awk: 3,725; perl: 2,872; yacc: 316; xml: 311; ml: 285; lex: 198; haskell: 122
file content (40 lines) | stat: -rw-r--r-- 734 bytes parent folder | download | duplicates (6)
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
29
30
31
32
33
34
35
36
37
38
39
40
/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining -fno-ipa-cp"  } */
/* { dg-add-options bind_pic_locally } */

void abort (void);
int scc_entry (int);
int sum;
int a[10];
int
scc_next (int c)
{
  int i;
  for (i=0;i<c;i++)
    a[i]=c;
  scc_entry (c);
}
int
scc_entry (int c)
{
  int i;
  for (i=0;i<c;i++)
    sum+=a[i];
  if (c--)
    scc_next (c);
  return sum;
}
int
main()
{
  int sum;
  int i;
  for (i=0;i<10;i++)
    scc_entry (i);
  if (sum < 0)
    abort ();
  return 0;
}
/* { dg-final { scan-ipa-dump "in_scc"  "inline"  } } */
/* { dg-final { scan-ipa-dump "same_scc"  "inline"  } } */
/* Main is not in scc, the two functions are.  */
/* { dg-final { scan-ipa-dump-times "In SCC" 2 "inline"  } } */