debug/105158 - improve debug stmt retaining for forwarder removal
authorRichard Biener <rguenther@suse.de>
Tue, 5 Apr 2022 13:23:54 +0000 (15:23 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 4 May 2022 07:51:19 +0000 (09:51 +0200)
commit1ba68f78c9d2510eb095f7d8a90c87cd5fd4183d
tree4e1fb053f4fddbc9bcf465f41088e9d6d898613f
parentc4ae175881f773383f392ee39bad4ac1c0fa53ca
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.
gcc/tree-cfgcleanup.cc