On 11/29/25 1:24 AM, Dimitar Dimitrov wrote:
Starting with r16-4438-ga93f80feeef744, the edge sorting order was
switched to lowest execution frequency first. But the "bbro"
optimization pass chooses the first edge as a fallthrough. Thus the
most unlikely branches were optimized to fallthroughs.
Fix by restoring the sorting order prior to r16-4438-ga93f80feeef744.
Now the branches most likely to be executed are picked as fallthroughs.
There are no regressions for C and C++ on x86_64-pc-linux-gnu.
The new tests fail for the respective targets without this patch, and
pass with it.
PR rtl-optimization/122675
gcc/ChangeLog:
* bb-reorder.cc (edge_order): Fix BB edge ordering to be
descending.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/pr122675-1.c: New test.
* gcc.target/i386/pr122675-1.c: New test.
* gcc.target/riscv/pr122675-1.c: New test.
Signed-off-by: Dimitar Dimitrov<[email protected]>
THanks. I pushed this to the trunk.
jeff