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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-04-06
                 CC|                            |aoliva at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
This is the same issue as PR105158 but this time there is really no place to
put the debug stmt since the predecessor has two successors and the successor
has two predecessors.  Since we want to generate the same code for -g and -g0
the only option would be to never remove a forwarder block in such case, but
that would
cause an artificial unconditional jump in the assembly (that would then be
the place the variable becomes live).

Alternatively we could do liveness analysis for the special case of the
successor having a backedge predecessor and see whether the variable
can get a different value from that edge or not (in this case it can not).

Maybe var-tracking dataflow would in the end compute this but then we'd have
to arrange for the debug stmts to live on CFG edges (to avoid the empty
forwarder block).

We could also retain the forwarder and make sure it ends up fall-thru, then
_maybe_ that's enough to not cause worse code generation.

Alex - any thoughts on the code-gen/var-tracking issue?  I suppose we really
don't want to go down adding debug stmts to edges, but retaining the forwarder
(at least with -Og?) would also avoid re-creating/re-removing it with each
critical edge splitting.

Reply via email to