(convert_move): Don't access a hard reg in an invalid mode when doing

a truncation.

From-SVN: r9447
This commit is contained in:
Richard Kenner 1995-04-25 17:05:37 -04:00
parent c89e8dc28f
commit 34aa3599f1

View File

@ -1081,6 +1081,9 @@ convert_move (to, from, unsignedp)
|| GET_CODE (from) == REG || GET_CODE (from) == REG
|| GET_CODE (from) == SUBREG)) || GET_CODE (from) == SUBREG))
from = force_reg (from_mode, from); 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)); emit_move_insn (to, gen_lowpart (to_mode, from));
return; return;
} }