arm.c (arm_legitimize_address): Limit the value passed to bit_count to 32 bits.
authorNicolas Pitre <nico@cam.org>
Fri, 2 Sep 2005 19:09:33 +0000 (19:09 +0000)
committerNicolas Pitre <nico@gcc.gnu.org>
Fri, 2 Sep 2005 19:09:33 +0000 (19:09 +0000)
* config/arm/arm.c (arm_legitimize_address): Limit the value passed
to bit_count to 32 bits.

From-SVN: r103792

gcc/ChangeLog
gcc/config/arm/arm.c

index c7dccbd65b26504a04139de7dbb7db13611f9a3a..50ac07f45adecd43a3430c1210332baf8c78be73 100644 (file)
@@ -1,3 +1,8 @@
+2005-09-02  Nicolas Pitre <nico@cam.org>
+
+       * config/arm/arm.c (arm_legitimize_address): Limit the value passed
+       to bit_count to 32 bits.
+
 2005-08-31  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/23167
index 128edb699e292f99677888d075deeb3c8518e80b..7df3aba1c23c0c24097a66734e05dcdfb8df5d6e 100644 (file)
@@ -3772,7 +3772,7 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
       mask = (1 << bits) - 1;
       base = INTVAL (x) & ~mask;
       index = INTVAL (x) & mask;
-      if (bit_count (base) > (32 - bits)/2)
+      if (bit_count (base & 0xffffffff) > (32 - bits)/2)
         {
          /* It'll most probably be more efficient to generate the base
             with more bits set and use a negative index instead. */