aboutsummaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-05-08 15:46:06 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-05-08 15:46:06 +0000
commit5c04950727f2a7a0e00c07776a417f24aea7da9a (patch)
treebf5044023402e0eca4e7207ffe7c361272c52bf4 /gcc/expmed.c
parent03a7c1de3106761bf92b22d13c6678d65181c5f0 (diff)
downloadgcc-5c04950727f2a7a0e00c07776a417f24aea7da9a.zip
gcc-5c04950727f2a7a0e00c07776a417f24aea7da9a.tar.gz
gcc-5c04950727f2a7a0e00c07776a417f24aea7da9a.tar.bz2
re PR middle-end/48908 (build fails on cris-elf in libiberty:md5.c, shift-related)
2011-05-08 Richard Guenther <rguenther@suse.de> PR middle-end/48908 PR middle-end/48905 * expmed.c (expand_shift_1): Compute adjusted constant shift amount manually. From-SVN: r173550
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r--gcc/expmed.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 4e1ea3a..18a6592 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -2142,10 +2142,14 @@ expand_shift_1 (enum tree_code code, enum machine_mode mode, rtx shifted,
rtx temp1;
new_amount = op1;
- other_amount
- = simplify_gen_binary (MINUS, GET_MODE (op1),
- GEN_INT (GET_MODE_BITSIZE (mode)),
- op1);
+ if (CONST_INT_P (op1))
+ other_amount = GEN_INT (GET_MODE_BITSIZE (mode)
+ - INTVAL (op1));
+ else
+ other_amount
+ = simplify_gen_binary (MINUS, GET_MODE (op1),
+ GEN_INT (GET_MODE_BITSIZE (mode)),
+ op1);
shifted = force_reg (mode, shifted);