https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116812
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Tamar Christina <tnfch...@gcc.gnu.org>: https://gcc.gnu.org/g:09892448ebd8c396a26b2c09ba71f1e5a8dc42d7 commit r15-3792-g09892448ebd8c396a26b2c09ba71f1e5a8dc42d7 Author: Tamar Christina <tamar.christ...@arm.com> Date: Mon Sep 23 11:45:43 2024 +0100 middle-end: Insert invariant instructions before the gsi [PR116812] The new invariant statements should be inserted before the current statement and not after. This goes fine 99% of the time but when the current statement is a gcond the control flow gets corrupted. gcc/ChangeLog: PR tree-optimization/116812 * tree-vect-slp.cc (vect_slp_region): Fix insertion. gcc/testsuite/ChangeLog: PR tree-optimization/116812 * gcc.dg/vect/pr116812.c: New test.