https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105158
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:1ba68f78c9d2510eb095f7d8a90c87cd5fd4183d commit r13-99-g1ba68f78c9d2510eb095f7d8a90c87cd5fd4183d Author: Richard Biener <rguent...@suse.de> Date: Tue Apr 5 15:23:54 2022 +0200 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 <rguent...@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.