aboutsummaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2006-07-19 05:13:56 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2006-07-19 05:13:56 +0000
commitcb2eb96f4d81b3ce61fd0070b59bfaf568c04f31 (patch)
tree3487eac9da851d55f914f10ff317d63bd8311b83 /gcc/expmed.c
parentf604fc3b2ea1d6738af942668d16ddd5cd2663a8 (diff)
downloadgcc-cb2eb96f4d81b3ce61fd0070b59bfaf568c04f31.zip
gcc-cb2eb96f4d81b3ce61fd0070b59bfaf568c04f31.tar.gz
gcc-cb2eb96f4d81b3ce61fd0070b59bfaf568c04f31.tar.bz2
re PR middle-end/28283 (SuperH: Very unoptimal code generated for 64-bit ints)
PR middle-end/28283 * expmed.c (expand_shift): Additionally check that the shift_cost is not MAX_COST and that INTVAL(op1) is less than MAX_BITS_PER_WORD before implementing a LSHIFT_EXPR as a sequence of additions. * config/sh/sh.c (shift_costs): Return MAX_COST to inform the middle-end that DImode shifts need to be synthesized by expand. From-SVN: r115578
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r--gcc/expmed.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 6f4e331..0f3a14d 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -2217,7 +2217,9 @@ expand_shift (enum tree_code code, enum machine_mode mode, rtx shifted,
&& GET_CODE (op1) == CONST_INT
&& INTVAL (op1) > 0
&& INTVAL (op1) < GET_MODE_BITSIZE (mode)
- && shift_cost[mode][INTVAL (op1)] > INTVAL (op1) * add_cost[mode])
+ && INTVAL (op1) < MAX_BITS_PER_WORD
+ && shift_cost[mode][INTVAL (op1)] > INTVAL (op1) * add_cost[mode]
+ && shift_cost[mode][INTVAL (op1)] != MAX_COST)
{
int i;
for (i = 0; i < INTVAL (op1); i++)