summaryrefslogtreecommitdiff
path: root/gcc/reload.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-05-31 15:13:36 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-05-31 15:13:36 +0000
commita69791114b5f3f5e750145d5b06955757c0a7868 (patch)
tree0c1c29104eec694d1022f9b5a1440651674fc445 /gcc/reload.c
parent2b32c30c62908c0c0f8294046ae23d86924efe50 (diff)
downloadgcc-a69791114b5f3f5e750145d5b06955757c0a7868.tar.gz
* 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
Diffstat (limited to 'gcc/reload.c')
-rw-r--r--gcc/reload.c12
1 files changed, 10 insertions, 2 deletions
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)