From a69791114b5f3f5e750145d5b06955757c0a7868 Mon Sep 17 00:00:00 2001 From: law Date: Sun, 31 May 1998 15:13:36 +0000 Subject: * reload.c (find_reloads): Record the existing mode if operand_mode == VOIDmode before replacing a register with a constant. * i386.md (tstsi, tsthi, tstqi, tstsf, tstdf, tstxf): Set i386_compare_op1 to const0_rtx for the benefit of the conditional move patterns. (movsicc, movhicc, movsfcc, movdfcc, movxfcc, movdicc): Rewrite based on suggestions from Jim Wilson. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@20151 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/reload.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'gcc/reload.c') diff --git a/gcc/reload.c b/gcc/reload.c index 694c23601b6..1604a7b0ba0 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -2641,8 +2641,16 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) register int regno = REGNO (recog_operand[i]); if (reg_equiv_constant[regno] != 0 && (set == 0 || &SET_DEST (set) != recog_operand_loc[i])) - substed_operand[i] = recog_operand[i] - = reg_equiv_constant[regno]; + { + /* Record the existing mode so that the check if constants are + allowed will work when operand_mode isn't specified. */ + + if (operand_mode[i] == VOIDmode) + operand_mode[i] = GET_MODE (recog_operand[i]); + + substed_operand[i] = recog_operand[i] + = reg_equiv_constant[regno]; + } #if 0 /* This might screw code in reload1.c to delete prior output-reload that feeds this insn. */ if (reg_equiv_mem[regno] != 0) -- cgit v1.2.1