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

--- Comment #17 from Richard Biener <rguenth at gcc dot gnu.org> ---
To add to all this - IMHO copyrename should go - it's purpose was to have more
SSA names with user-decls and thus debug info for them.  This should now
be dealt with debug insns (in a way better and correct way).

Yes, out-of-SSA coalescing could be changed to allow coalescing of SSA names
with a user-DECL and anonymous SSA names (or SSA names with a DECL_IGNORED_P
decl).  But that will make the conflict graph much larger(?).  The decision
past
then was to retain previous behavior which wouldn't have coalesced this
case (because the DECL of the now anonymous SSA name was different).

In theory we could just go for it, hoping the conflict graph will not get
much larger.  But it might happen that we end up coalescing things in a way
that there ends up being no DECL for a register and thus we lose in debug
quality (not sure if we could compensate by inserting debug stmts on the
edges to compensate for that - we couldn't do that if it requires splitting
the edge).  Not sure if always coalescing to the variable with the user-decl
won't make debug info wrong, like in

  bb1:
  _1 = 2 * _3;
  goto <bb 3>;

  bb2:
  i_4 = 5 / _3;

  bb3:
  _3 = PHI <i_4 (2), _1  (1)>

if we coalesce to _1 to i_4 then the expression 2 * _3 will be computed
to a register with decl 'i'.

So to avoid wrong debug we'd have to always coalesce to an anonymous
entity - but that would lose the association of 'i' to 5 / _3 in bb2
unless we manage to compensate for that somehow with debug-insns we
magically emit during RTL expansion.

Reply via email to