https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122959
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Tamar Christina <[email protected]>: https://gcc.gnu.org/g:4a1247a3b070cdb02910826a5effb505457a6e73 commit r16-5849-g4a1247a3b070cdb02910826a5effb505457a6e73 Author: Tamar Christina <[email protected]> Date: Wed Dec 3 10:55:40 2025 +0000 vect: delay identification of update_e until after skip_epilog [PR122959] The testcase attached in the PR shows that for some reason the test openmp_vv.sum when doing OpenMP offloading creates an intermediate empty block after the skip_epilog split. This means we should just simply delay setting update_e for the non-early break case. For early break we have to do it early still otherwise the skip_epilog edge would make us find the wrong edge. I haven't been able to replicate this on a C testcase and the attached reduction works fine on AArch64 and x86_64 but have been able to verify the fixed code with ./gcc/f951 -fopenmp test2.f90 -O3 -o - -march=sm_30 on an --target=nvptx-none --enable-as-accelerator-for=x86_64-pc-linux-gnu configured cc1. If I manage to create a testcase will push it too. gcc/ChangeLog: PR middle-end/122959 * tree-vect-loop-manip.cc (vect_do_peeling): Delay setting update_e.
