https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106705
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Note the cost for constant loading usually is expensive which is why this case is usually ignored ... It is more costly on in-order chips though, especially RISCV where constant forming takes 3 instructions while on most take 2 (or 1 on some).