(convert_move): When {zero,sign}_extending, allow a wider intermediate
authorRichard Kenner <kenner@gcc.gnu.org>
Mon, 16 May 1994 20:16:12 +0000 (16:16 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Mon, 16 May 1994 20:16:12 +0000 (16:16 -0400)
than to_mode if truncation is a no-op.

From-SVN: r7306

gcc/expr.c

index 38789ffecc98b768ebe7b305743569d90abb0068..f6317ee267de5b693ef459077191fafd1b675ab4 100644 (file)
@@ -1043,8 +1043,10 @@ convert_move (to, from, unsignedp)
          /* Search for a mode to convert via.  */
          for (intermediate = from_mode; intermediate != VOIDmode;
               intermediate = GET_MODE_WIDER_MODE (intermediate))
-           if ((can_extend_p (to_mode, intermediate, unsignedp)
-                != CODE_FOR_nothing)
+           if (((can_extend_p (to_mode, intermediate, unsignedp)
+                 != CODE_FOR_nothing)
+                || (GET_MODE_SIZE (to_mode) < GET_MODE_SIZE (intermediate)
+                    && TRULY_NOOP_TRUNCATION (to_mode, intermediate)))
                && (can_extend_p (intermediate, from_mode, unsignedp)
                    != CODE_FOR_nothing))
              {