https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114232
--- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Either change those too, or the splitter needs some variant what to do if there is a mismatch. Though, optimize_size implies optimize_function_for_size_p (cfun), so if a named pattern uses && optimize_size and the insn it splits into uses optimize_function_for_size_p (cfun), it shouldn't fail. The other direction is not always true, optimize_function_for_size_p (cfun) can be true just because the function is cold, not just because it is -Os.