mips.c (mips_split_const): Don't accept bare PLUS expressions.
authorRichard Sandiford <richard@codesourcery.com>
Sun, 22 Oct 2006 09:28:01 +0000 (09:28 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sun, 22 Oct 2006 09:28:01 +0000 (09:28 +0000)
gcc/
* config/mips/mips.c (mips_split_const): Don't accept bare PLUS
expressions.

From-SVN: r117950

gcc/ChangeLog
gcc/config/mips/mips.c

index 8f2f384c93627ada1cbf13ad4b7c89f9c5238a03..d5eaf5b3696815bd2b818b300507b0826b721eb9 100644 (file)
@@ -1,3 +1,8 @@
+2006-10-22  Richard Sandiford  <richard@codesourcery.com>
+
+       * config/mips/mips.c (mips_split_const): Don't accept bare PLUS
+       expressions.
+
 2006-10-21  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/i386/i386.md (UNSPEC_LDQQU): Renamed to ...
index 26ea020d0b820bc135caa874a07f344ab5605724..05498c2c21dc9eccffbd434ff4ced270a02a9bb4 100644 (file)
@@ -1282,12 +1282,13 @@ mips_split_const (rtx x, rtx *base, HOST_WIDE_INT *offset)
   *offset = 0;
 
   if (GET_CODE (x) == CONST)
-    x = XEXP (x, 0);
-
-  if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT)
     {
-      *offset += INTVAL (XEXP (x, 1));
       x = XEXP (x, 0);
+      if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT)
+       {
+         *offset += INTVAL (XEXP (x, 1));
+         x = XEXP (x, 0);
+       }
     }
   *base = x;
 }