http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54200

             Bug #: 54200
           Summary: copyrename generates wrong debuginfo
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: wrong-debug
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: rgue...@gcc.gnu.org


For gcc.target/i386/pad-10.c copyrename transforms

foo2 (int z, int x)
{
  int D.1754;

<bb 2>:
  if (x_2(D) == 1)
    goto <bb 3>;
  else
    goto <bb 4>;

<bb 3>:
  bar ();
  D.1754_4 = z_3(D);
  goto <bb 5>;

<bb 4>:
  D.1754_5 = x_2(D) + z_3(D);

<bb 5>:
  # D.1754_1 = PHI <D.1754_4(3), D.1754_5(4)>
  return D.1754_1;
}

to

foo2 (int z, int x)
{
<bb 2>:
  if (x_2(D) == 1)
    goto <bb 3>;
  else
    goto <bb 4>;

<bb 3>:
  bar ();
  z_4 = z_3(D);
  goto <bb 5>;

<bb 4>:
  z_5 = x_2(D) + z_3(D);

<bb 5>:
  # z_1 = PHI <z_4(3), z_5(4)>
  return z_1;
}

note the bogus stmts

   z_5 = x_2(D) + z_3(D);

<bb 5>:
   # z_1 = PHI <z_4(3), z_5(4)>
   return z_1;

which assign to z values different from the incoming parameter value.

[the question is if copyrename is still useful now that we have VTA
and will insert debug stmts for assignments to names we'd loose over
a copyprop/dce combo]

Reply via email to