aboutsummaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2001-11-07 13:35:16 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2001-11-07 12:35:16 +0000
commitb972dd0201d69cfd0a422292706c1d0b8b4f1b2d (patch)
tree03db7da381d0f1ca3f877597e7c68578266a36ab /gcc/expmed.c
parentab901443dc4df860aef92b4f4b8189771663f994 (diff)
downloadgcc-b972dd0201d69cfd0a422292706c1d0b8b4f1b2d.zip
gcc-b972dd0201d69cfd0a422292706c1d0b8b4f1b2d.tar.gz
gcc-b972dd0201d69cfd0a422292706c1d0b8b4f1b2d.tar.bz2
expmed.c (expand_mult): Force operand to register before computing cost.
* expmed.c (expand_mult): Force operand to register before computing cost. * i386.c (x86_decompose_lea): New global vairable. * i386.h (x86_decompose_lea): Declare. (TARGET_DECOMPOSE_LEA): New macro. (RTX_COST): Handle leas properly. From-SVN: r46823
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r--gcc/expmed.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 10c5141..9435a62 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -2406,6 +2406,10 @@ expand_mult (mode, op0, op1, target, unsignedp)
int mult_cost;
enum {basic_variant, negate_variant, add_variant} variant = basic_variant;
+ /* op0 must be register to make mult_cost match the precomputed
+ shiftadd_cost array. */
+ op0 = force_reg (mode, op0);
+
/* Try to do the computation three ways: multiply by the negative of OP1
and then negate, do the multiplication directly, or do multiplication
by OP1 - 1. */