]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
(expand_divmod): Put OP0 in a register when computing
authorTorbjorn Granlund <tege@gnu.org>
Fri, 1 Jul 1994 11:40:45 +0000 (11:40 +0000)
committerTorbjorn Granlund <tege@gnu.org>
Fri, 1 Jul 1994 11:40:45 +0000 (11:40 +0000)
remainder, or when OP1 is constant.

From-SVN: r7628

gcc/expmed.c

index 5df0188348961c0f83d268d7a11a7857a70c495c..50ebb674714470ff5053072cb059c053e83dbbf9 100644 (file)
@@ -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 ();