https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117974
--- Comment #9 from Edwin Lu <ewlu at rivosinc dot com> --- After talking with Palmer a bit about this, it looks like there might be an issue with regards to insn scheduler. With -fno-schedule-insns the vsetvl is inserted after the branch instead of before https://godbolt.org/z/Ea358Mj5K. Sent a patch here https://gcc.gnu.org/pipermail/gcc-patches/2025-February/675622.html