aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTorbjorn Granlund <tege@gnu.org>1994-07-01 11:40:45 +0000
committerTorbjorn Granlund <tege@gnu.org>1994-07-01 11:40:45 +0000
commitab0b65811bd9a0ed2408e16d756c712818d9a8d8 (patch)
tree1ca7498e0f6ebe70a9687650f3a5cfa8ad806238 /gcc
parente9c1141151358c5713eefd54d900a816db88fa22 (diff)
downloadgcc-ab0b65811bd9a0ed2408e16d756c712818d9a8d8.zip
gcc-ab0b65811bd9a0ed2408e16d756c712818d9a8d8.tar.gz
gcc-ab0b65811bd9a0ed2408e16d756c712818d9a8d8.tar.bz2
(expand_divmod): Put OP0 in a register when computing
remainder, or when OP1 is constant. From-SVN: r7628
Diffstat (limited to 'gcc')
-rw-r--r--gcc/expmed.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 5df0188..50ebb67 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -2680,9 +2680,10 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
if (GET_CODE (op1) == MEM && MEM_VOLATILE_P (op1))
op1 = force_reg (compute_mode, op1);
-#if 0
- op0 = force_reg (mode, op0);
-#endif
+ /* If we need the remainder or if OP1 is constant, we need to
+ put OP0 in a register in case it has any queued subexpressions. */
+ if (rem_flag || op1_is_constant)
+ op0 = force_reg (compute_mode, op0);
last = get_last_insn ();