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

            Bug ID: 120310
           Summary: Missing location for initially addressable variable
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

Consider -O2 -g -dA
volatile int v;
void foo () { int a = 42; int *b = &a; ++v; }
struct S { int *p; int q; };
void bar () { int a = 42; ++a; struct S b = { &a, -42 }; int *c = &a; --v; }

In foo, ssa pass adds debug for b:
  b_5 = &a;
  # DEBUG b => b_5
and ccp1 rewrites a into ssa:
  a_8 = 42;
  # DEBUG a => a_8
  # DEBUG b => &a
But in bar, esra adds debug stmts for the b parts:
  # DEBUG b$p => &a
  b.p = &a;
  # DEBUG b$q => -42
  b.q = -42;
and mergephi still has
  a = 42;
(still addressable, because there is
  b.p = &a;
) and then dse1 comes and just deletes the store without adding any debug
stmts,
so unlike the foo case we loose the info that on --v a has value 43 and *b.p
has also value 43.

Reply via email to