* regmove.c (optimize_reg_copy_3): Honor TRULY_NOOP_TRUNCATION.
authorJeffrey A Law <law@cygnus.com>
Sat, 10 Oct 1998 16:03:44 +0000 (16:03 +0000)
committerJeff Law <law@gcc.gnu.org>
Sat, 10 Oct 1998 16:03:44 +0000 (10:03 -0600)
From-SVN: r22977

gcc/ChangeLog
gcc/regmove.c

index 45908ac864278029ad37d457d9c5018d6b5f4798..a60d9eed2c705fd5030680ae23e5b7b810512b5e 100644 (file)
@@ -1,3 +1,7 @@
+Sat Oct 10 17:01:42 1998  Jeffrey A Law  (law@cygnus.com)
+
+       * regmove.c (optimize_reg_copy_3): Honor TRULY_NOOP_TRUNCATION.
+
 Fri Oct  9 22:08:05 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * fp-bit.c (SFtype): Don't implicitly use int in declaration.
index 41235f137041f6d0c81d6d90f0b0125c6cffb4dc..35ddf12d6f3917bd8a33eaaaef53eaa9aaacb4f9 100644 (file)
@@ -552,6 +552,14 @@ optimize_reg_copy_3 (insn, dest, src)
       || GET_CODE (SET_SRC (set)) != MEM
       || SET_DEST (set) != src_reg)
     return;
+
+  /* Do not use a SUBREG to truncate from one mode to another if truncation
+     is not a nop.  */
+  if (GET_MODE_BITSIZE (GET_MODE (src_reg)) <= GET_MODE_BITSIZE (GET_MODE (src))
+      && !TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (GET_MODE (src)),
+                                GET_MODE_BITSIZE (GET_MODE (src_reg))))
+    return;
+
   old_mode = GET_MODE (src_reg);
   PUT_MODE (src_reg, GET_MODE (src));
   XEXP (src, 0) = SET_SRC (set);