combine.c (simplify_rtx): Do not replace TRUNCATE with a SUBREG if truncation is...
authorJeff Law <law@gcc.gnu.org>
Mon, 5 Oct 1998 09:05:58 +0000 (03:05 -0600)
committerJeff Law <law@gcc.gnu.org>
Mon, 5 Oct 1998 09:05:58 +0000 (03:05 -0600)
8
        * combine.c (simplify_rtx): Do not replace TRUNCATE with a SUBREG if
        truncation is not a no-op.

From-SVN: r22835

gcc/combine.c

index ce488e294c41ea561defed7633ad9e973963bde9..420a60fca5ff6880231b2dd2e41e76fa3f9a94ad 100644 (file)
@@ -3773,9 +3773,12 @@ simplify_rtx (x, op0_mode, last, in_dest)
        return SUBREG_REG (XEXP (x, 0));
 
       /* If we know that the value is already truncated, we can
-         replace the TRUNCATE with a SUBREG.  */
-      if (num_sign_bit_copies (XEXP (x, 0), GET_MODE (XEXP (x, 0)))
-         >= GET_MODE_BITSIZE (mode) + 1)
+         replace the TRUNCATE with a SUBREG if TRULY_NOOP_TRUNCATION is
+        nonzero for the corresponding modes.  */
+      if (TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode),
+                                GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0))))
+         && num_sign_bit_copies (XEXP (x, 0), GET_MODE (XEXP (x, 0)))
+            >= GET_MODE_BITSIZE (mode) + 1)
        return gen_lowpart_for_combine (mode, XEXP (x, 0));
 
       /* A truncate of a comparison can be replaced with a subreg if