OSDN Git Service

2011-05-08 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 8 May 2011 15:46:06 +0000 (15:46 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 8 May 2011 15:46:06 +0000 (15:46 +0000)
PR middle-end/48908
PR middle-end/48905
* expmed.c (expand_shift_1): Compute adjusted constant shift
amount manually.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173550 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/expmed.c

index c1a359d..5842b6a 100644 (file)
@@ -1,3 +1,10 @@
+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.
+
 2011-05-08  Eric Botcazou  <ebotcazou@adacore.com>
 
        * config/avr/avr.c (print_operand_address): Fix invalid RTL access.
index 4e1ea3a..18a6592 100644 (file)
@@ -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);