From: Richard Kenner Date: Tue, 25 Apr 1995 21:05:37 +0000 (-0400) Subject: (convert_move): Don't access a hard reg in an invalid mode when doing X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=34aa3599f159bba2ea3fdc9a08324402d8003b89;p=gcc.git (convert_move): Don't access a hard reg in an invalid mode when doing a truncation. From-SVN: r9447 --- diff --git a/gcc/expr.c b/gcc/expr.c index 656d8254002..c76feb01352 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -1081,6 +1081,9 @@ convert_move (to, from, unsignedp) || GET_CODE (from) == REG || GET_CODE (from) == SUBREG)) from = force_reg (from_mode, from); + if (GET_CODE (from) == REG && REGNO (from) < FIRST_PSEUDO_REGISTER + && ! HARD_REGNO_MODE_OK (REGNO (from), to_mode)) + from = copy_to_reg (from); emit_move_insn (to, gen_lowpart (to_mode, from)); return; }