aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload.c
diff options
context:
space:
mode:
authorJohn Wehle <john@feith.com>1998-05-31 15:13:36 +0000
committerJeff Law <law@gcc.gnu.org>1998-05-31 09:13:36 -0600
commit726e2d544cdcb3e91ac2e0ced52bf7ef592b18f3 (patch)
tree0c1c29104eec694d1022f9b5a1440651674fc445 /gcc/reload.c
parent7e5df0048fe26c97b06e9f7d8d4a2ea66e6d1ad6 (diff)
downloadgcc-726e2d544cdcb3e91ac2e0ced52bf7ef592b18f3.zip
gcc-726e2d544cdcb3e91ac2e0ced52bf7ef592b18f3.tar.gz
gcc-726e2d544cdcb3e91ac2e0ced52bf7ef592b18f3.tar.bz2
reload.c (find_reloads): Record the existing mode if operand_mode == VOIDmode before replacing a...
* 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. From-SVN: r20151
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 694c236..1604a7b 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)