summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr86064.c
blob: 3397427256922deaccd29d6994e480a6bb77ebf3 (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
/* { dg-do compile } */
/* { dg-skip-if "split DWARF unsupported" { *-*-darwin* } } */
/* { dg-options "-g -O2 -fno-var-tracking-assignments -gsplit-dwarf" } */

/* This used to fail with location views (implicitly) enabled, because
   var-tracking (not at assignments) creates a range for d starting at
   the load after the first call, and we did not split the range,
   despite its crossing between hot and cold partitions, because it's
   a single range, that we normally extend to the entire function.
   However, because the range starts at a (presumed) nonzero view, we
   end up outputting a loclist instead of a single location entry.
   But then, -gsplit-dwarf selects (startx,length) loclist entries,
   and the length ends up computing the difference between symbols in
   different subsections.  */

int a;
__attribute__((__cold__)) void b();

void e(int *);
int f();

void c() {
  int d;
  e(&d);
  a = d;
  if (f())
    b();
}