From: Richard Guenther Date: Sun, 8 May 2011 15:46:06 +0000 (+0000) Subject: re PR middle-end/48908 (build fails on cris-elf in libiberty:md5.c, shift-related) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5c04950727f2a7a0e00c07776a417f24aea7da9a;p=gcc.git re PR middle-end/48908 (build fails on cris-elf in libiberty:md5.c, shift-related) 2011-05-08 Richard Guenther PR middle-end/48908 PR middle-end/48905 * expmed.c (expand_shift_1): Compute adjusted constant shift amount manually. From-SVN: r173550 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c1a359d61d5..5842b6ab758 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2011-05-08 Richard Guenther + + PR middle-end/48908 + PR middle-end/48905 + * expmed.c (expand_shift_1): Compute adjusted constant shift + amount manually. + 2011-05-08 Eric Botcazou * config/avr/avr.c (print_operand_address): Fix invalid RTL access. diff --git a/gcc/expmed.c b/gcc/expmed.c index 4e1ea3a2b0a..18a65929f78 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);