Commit Message

Hello,
The fix for PR52139 only papered over another problem: That things
from a basic block header were emitted into the insns stream. When
going out of cfglayout mode, these header-insn will be lost. It's
probably possible to construct a test case where e.g. a
NOTE_INSN_DELETED_DEBUG_LABEL is lost because of this, but I haven't
tried to do so.
The correct fix is to find a new home for the header and footer insn,
and the most logical place is to put them in the footer of the merged
block.
Bootstrapped&tested on x86_64-unknown-linux-gnu with current trunk,
and with r184004 (modified patch) to make sure the test case is fixed
(it doesn't fail on trunk even with r184005 reverted).
OK for trunk?
Ciao!
Steven
* cfgrtl.c (cfg_layout_merge_blocks): Revert r184005, implement
correct fix by moving header and footer insn to the footer of
the merged basic block. Clear BB_END of the merged-away block.