]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix profile updating bug in tree-ssa-threadupdate
authorJan Hubicka <jh@suse.cz>
Thu, 10 Aug 2023 16:39:33 +0000 (18:39 +0200)
committerJan Hubicka <jh@suse.cz>
Thu, 10 Aug 2023 16:39:33 +0000 (18:39 +0200)
commit546bf79bd72df0e024323345a5d08f9ceba513f6
tree07253b4f0aa9d70b08393a5e45c5299016d4b1ca
parente41103081bfa341bdb1037e94d6b8f7a0af39067
Fix profile updating bug in tree-ssa-threadupdate

ssa_fix_duplicate_block_edges later calls update_profile to correct profile after threading.
In the testcase this does not work since we lose track of the duplicated edge.  This
happens because redirect_edge_and_branch returns NULL if the edge already has correct
destination which is the case.

gcc/ChangeLog:

* tree-ssa-threadupdate.cc (ssa_fix_duplicate_block_edges): Fix profile update.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/phi_on_compare-1.c: Check profile consistency.
gcc/testsuite/gcc.dg/tree-ssa/phi_on_compare-1.c
gcc/tree-ssa-threadupdate.cc