https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121093

            Bug ID: 121093
           Summary: Missed location of inlined function
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hubicka at gcc dot gnu.org
  Target Milestone: ---

In this testcase
static int p1(int a)
{
        return a+1;
}
static int p2(int a)
{
        return a+2;
}
int p3 (int a)
{
        return p1(p2(a));
}

We optimize the two additions into +3.   At optimized dump we have:

int p3 (int a)
{
  int _3;

  <bb 2> [local count: 1073741824]:
  [m.c:11:2] # DEBUG BEGIN_STMT
  [m.c:11:9] # DEBUG a => [m.c:7:10] a_2(D) + 2
  [m.c:1:12] # DEBUG INLINE_ENTRY p1
  [m.c:3:2] # DEBUG BEGIN_STMT
  [m.c:3:10] _3 = a_2(D) + 3;
  [m.c:11:9 discrim 1] # DEBUG a => NULL
  [m.c:11:9 discrim 3] return _3;

}


notice that p1 is present a INLINE_ENRY and corresponding debug stmt with
location m.c:3, but p2 is gone. It is taken away by clear_unused_block_pointer
since after combining the computations we no longer see an non-debug statement
associated with it.

auto-fdo would be happier if we output also location for m.c:7 and it would
make it possible to breakpoint in p2.

Reply via email to