]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm.c (thumb2_legitimate_index_p): Initialize val after checking for integers.
authorRamana Radhakrishnan <ramana.radhakrishnan@arm.com>
Thu, 4 Jun 2009 14:59:12 +0000 (14:59 +0000)
committerRamana Radhakrishnan <ramana@gcc.gnu.org>
Thu, 4 Jun 2009 14:59:12 +0000 (14:59 +0000)
2009-06-04  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

* config/arm/arm.c (thumb2_legitimate_index_p): Initialize
val after checking for integers.

From-SVN: r148170

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

index 84bf21958d0c1f35926b73906330be5dcd7d36fe..9c3de317f309ea1ba17e8fc74420aba2d3c4cad3 100644 (file)
@@ -1,3 +1,8 @@
+2009-06-04  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
+
+       * config/arm/arm.c (thumb2_legitimate_index_p): Initialize
+       val after checking for integers.
+
 2009-06-04  Uros Bizjak  <ubizjak@gmail.com>
 
        * config/i386/i386.h (X86_64_MS_REGPARM_MAX): Rename from
index 141a4b846a61ead0b71a9b421e4ad4b8013e83eb..1f5c3ae9e8d81325a690cbedff728add44e4e515 100644 (file)
@@ -4266,15 +4266,17 @@ thumb2_legitimate_index_p (enum machine_mode mode, rtx index, int strict_p)
 
   if (mode == DImode || mode == DFmode)
     {
-      HOST_WIDE_INT val = INTVAL (index);
-      /* ??? Can we assume ldrd for thumb2?  */
-      /* Thumb-2 ldrd only has reg+const addressing modes.  */
-      if (code != CONST_INT)
+      if (code == CONST_INT)
+       {
+         HOST_WIDE_INT val = INTVAL (index);
+         /* ??? Can we assume ldrd for thumb2?  */
+         /* Thumb-2 ldrd only has reg+const addressing modes.  */
+         /* ldrd supports offsets of +-1020.
+            However the ldr fallback does not.  */
+         return val > -256 && val < 256 && (val & 3) == 0;
+       }
+      else
        return 0;
-
-      /* ldrd supports offsets of +-1020.
-         However the ldr fallback does not.  */
-      return val > -256 && val < 256 && (val & 3) == 0;
     }
 
   if (code == MULT)