diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index c4d0e36e9c0a2256f5dde1f4dc021c0328aa0cba..477dd007ea80272680751b61e35cc3eec79b66c3 100644 --- a/gcc/config/i386/i386.cc +++ b/gcc/config/i386/i386.cc @@ -19682,7 +19682,15 @@ ix86_can_change_mode_class (machine_mode from, machine_mode to, /* x87 registers can't do subreg at all, as all values are reformatted to extended precision. */ - if (MAYBE_FLOAT_CLASS_P (regclass)) + if (MAYBE_FLOAT_CLASS_P (regclass) + && VALID_FP_MODE_P (from) + && VALID_FP_MODE_P (to)) + return false; + + /* Reject integer modes if the sizes aren't the same. It would have + normally exited above. */ + if (MAYBE_FLOAT_CLASS_P (regclass) + && GET_MODE_SIZE (from) != GET_MODE_SIZE (to)) return false; if (MAYBE_SSE_CLASS_P (regclass) || MAYBE_MMX_CLASS_P (regclass))