debug/105158 - improve debug stmt retaining for forwarder removal
Currently when we cannot move debug stmt from a forwarder to the
destination block we drop/reset them. But in some cases as for
the testcase we can move them to the predecessor when that has
a single successor and we can insert after the last stmt of the
block. That allows us to preserve debug info here.
2022-04-05 Richard Biener <rguenther@suse.de>
PR debug/105158
* tree-cfgcleanup.cc (move_debug_stmts_from_forwarder):
Move debug stmts to the predecessor if moving to the
destination is not possible.
(remove_forwarder_block): Adjust.
(remove_forwarder_block_with_phi): Likewise.