https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122493
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Created attachment 62767 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62767&action=edit Patch set which I am testing Ignore the last patch, it was needed as bootstrap was broken at the time I created this set. There is a few testcase failures, for tree-ssa: ``` FAIL: gcc.dg/tree-ssa/predcom-dse-10.c scan-tree-dump-not pcom "Invalid sum" FAIL: gcc.dg/tree-ssa/predcom-dse-5.c scan-tree-dump-not pcom "Invalid sum" FAIL: gcc.dg/tree-ssa/predcom-dse-6.c scan-tree-dump-not pcom "Invalid sum" FAIL: gcc.dg/tree-ssa/predcom-dse-7.c scan-tree-dump-not pcom "Invalid sum" FAIL: gcc.dg/tree-ssa/predcom-dse-8.c scan-tree-dump-not pcom "Invalid sum" FAIL: gcc.dg/tree-ssa/ssa-dom-thread-7.c scan-tree-dump thread2 "Jumps threaded: 8" FAIL: gcc.dg/tree-ssa/ssa-sink-18.c scan-tree-dump-times sink2 "Sunk statements: 5" 1 ``` The predcom-dse-* ones happen because I think merge 2 edges which were not merge d before and the code in remove_forwarder_block/redirect_edge_and_branch didn't not update the count correctly; I have not looked into that just yet. I am thinking gimple_try_redirect_by_replacing_jump/redirect_edge_succ_nodup needs code to update the count .
