https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110316
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- See https://gcc.gnu.org/pipermail/gcc-patches/2023-July/625180.html thread too which is exactly about this issue. Basically what is happening is after inlining, there is now fused multiple subtract being used and that causes issues. This is why it is not seen on x86 (without using --with-cpu=).