https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65317
--- Comment #6 from Oleg Endo <olegendo at gcc dot gnu.org> --- If larger constants are formed during 1st combine (note -- we now have a 2nd late combine pass after register allocation), they could be at least be hoisted out of loops. See also the latest patch https://gcc.gnu.org/bugzilla/attachment.cgi?id=55543 by Alex in PR 54089.