From: Richard Kenner Date: Mon, 16 May 1994 20:16:12 +0000 (-0400) Subject: (convert_move): When {zero,sign}_extending, allow a wider intermediate X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=930b4e398ec14f8ea10acb0451655802ed4bb134;p=gcc.git (convert_move): When {zero,sign}_extending, allow a wider intermediate than to_mode if truncation is a no-op. From-SVN: r7306 --- diff --git a/gcc/expr.c b/gcc/expr.c index 38789ffecc9..f6317ee267d 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -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)) {