On 12/13/25 10:08 PM, Andrew Pinski wrote:
r16-5250-g88db06d7da393f901 changed which block was doing the
check on the label being a non-local dest or an eh landing pad.
Which is fine except then when we move labels we moved them to
before the label for the non-local dest/eh landing pad.
This can be fixed a few different ways.
Add back the check for the dest block or change where the other
labels are placed.
Since this case does not happen enough to care either way, I added
back the check for the dest block. This means there is no changes
from GCC 15 to now.
Bootstrapped and tested on x86_64-linux-gnu.
PR tree-optimization/123110
gcc/ChangeLog:
* tree-cfgcleanup.cc (maybe_remove_forwarder_block): Add back
check for eh landing pad or non-local dest on the dest.
gcc/testsuite/ChangeLog:
* gcc.dg/pr123110-1.c: New test.
I probably would have gone with the other approach you outlines, but
this is fine too.
Ok for the trunk.
Thanks,
Jeff