https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118182
--- Comment #11 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Alexandre Oliva <aol...@gcc.gnu.org>: https://gcc.gnu.org/g:14fa625bcb91028cb97f3575d2e394401bbb4a3a commit r16-59-g14fa625bcb91028cb97f3575d2e394401bbb4a3a Author: Alexandre Oliva <ol...@adacore.com> Date: Mon Apr 21 22:48:55 2025 -0300 [riscv] vec_dup immediate constants in pred_broadcast expand [PR118182] pr118182-2.c fails on gcc-14 because it lacks the late_combine passes, particularly the one that runs after register allocation. Even in the trunk, the predicate broadcast for the add reduction is expanded and register-allocated as _zvfh, taking up an unneeded scalar register to hold the constant to be vec_duplicated. It is the late combine pass after register allocation that substitutes this unneeded scalar register into the vec_duplicate, resolving to the _zero or _imm insns. It's easy enough and more efficient to expand pred_broadcast to the insns that take the already-duplicated vector constant, when the operands satisfy the predicates of the _zero or _imm insns. for gcc/ChangeLog PR target/118182 * config/riscv/vector.md (@pred_broadcast<mode>): Expand to _zero and _imm variants without vec_duplicate.