]> git.feebdaed.xyz Git - 0xmirror/gcc.git/commit
vect: Fix dominator update [PR123152]
authorVictor Do Nascimento <victor.donascimento@arm.com>
Wed, 17 Dec 2025 15:42:59 +0000 (15:42 +0000)
committerVictor Do Nascimento <victor.donascimento@arm.com>
Fri, 19 Dec 2025 23:26:32 +0000 (23:26 +0000)
commit57acdcf3fb3ec8915142e85a35dc88a0f4ec5d68
treefb8d19e5f4f0bad9e05045781b6d7fe8f428afee
parent15f7c5896191818a02c65f958edb5af3f527ebf0
vect: Fix dominator update [PR123152]

The `recompute_dominator' function used in the code fragment within
this patch assumes correctness in the rest of the CFG. Consequently,
it is wrong to rely upon it before the subsequent updates are made in
the "Update dominators for multiple exits" loop in the function.

Furthermore, if `loop_exit' == `scalar_exit', the "Update dominators for
multiple exits" logic will already take care of updating the
dominator for `scalar_exit->dest', such that the moved statement is
unnecessary.

gcc/ChangeLog:

PR tree-optimization/123152
* tree-vect-loop-manip.cc
(slpeel_tree_duplicate_loop_to_edge_cfg): Correct order of
dominator update.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/vect-uncounted-prolog-peel_2.c: New.
* gcc.dg/vect/vect-uncounted-prolog-peel_3.c: Likewise.
* g++.dg/vect/vect-uncounted-prolog-peel_1.cc: Likewise.
gcc/testsuite/g++.dg/vect/vect-uncounted-prolog-peel_1.cc [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-uncounted-prolog-peel_2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/vect-uncounted-prolog-peel_3.c [new file with mode: 0644]
gcc/tree-vect-loop-manip.cc