combine.c (subst): Use simplify_subreg_regno rather than REG_CANNOT_CHANGE_MODE_P...
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 22 Sep 2014 07:36:59 +0000 (07:36 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 22 Sep 2014 07:36:59 +0000 (07:36 +0000)
gcc/
* combine.c (subst): Use simplify_subreg_regno rather than
REG_CANNOT_CHANGE_MODE_P to detect invalid mode changes.

From-SVN: r215448

gcc/ChangeLog
gcc/combine.c

index 9227427c161bf9e05ec10a0f089d26635d962ace..830b2efad7497584489ca5b6e2caa754e05847ea 100644 (file)
@@ -1,3 +1,8 @@
+2014-09-22  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * combine.c (subst): Use simplify_subreg_regno rather than
+       REG_CANNOT_CHANGE_MODE_P to detect invalid mode changes.
+
 2014-09-22  Richard Sandiford  <richard.sandiford@arm.com>
 
        * rtl.h (subreg_info): Expand commentary
index bce5545099381441f5b68762ccbbac271cbe568d..13284865a497275e260d5eff54286d410f160e27 100644 (file)
@@ -5121,15 +5121,13 @@ subst (rtx x, rtx from, rtx to, int in_dest, int in_cond, int unique_copy)
                      )
                    return gen_rtx_CLOBBER (VOIDmode, const0_rtx);
 
-#ifdef CANNOT_CHANGE_MODE_CLASS
                  if (code == SUBREG
                      && REG_P (to)
                      && REGNO (to) < FIRST_PSEUDO_REGISTER
-                     && REG_CANNOT_CHANGE_MODE_P (REGNO (to),
-                                                  GET_MODE (to),
-                                                  GET_MODE (x)))
+                     && simplify_subreg_regno (REGNO (to), GET_MODE (to),
+                                               SUBREG_BYTE (x),
+                                               GET_MODE (x)) < 0)
                    return gen_rtx_CLOBBER (VOIDmode, const0_rtx);
-#endif
 
                  new_rtx = (unique_copy && n_occurrences ? copy_rtx (to) : to);
                  n_occurrences++;