]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* i386.c (legitimate_address_p): Verify modes of base and index.
authorRichard Henderson <rth@cygnus.com>
Sun, 14 Feb 1999 23:13:11 +0000 (15:13 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Sun, 14 Feb 1999 23:13:11 +0000 (15:13 -0800)
From-SVN: r25209

gcc/ChangeLog
gcc/config/i386/i386.c

index d0ca76115bd18317369acc4d3bc8441b4b10345d..16b3998716d482286e3b59eaf512e36d11478c72 100644 (file)
@@ -1,3 +1,7 @@
+Sun Feb 14 23:12:10 1999  Richard Henderson  <rth@cygnus.com>
+
+       * i386.c (legitimate_address_p): Verify modes of base and index.
+
 Sun Feb 14 23:01:28 1999  Richard Henderson  <rth@cygnus.com>
 
        * i386.c (legitimate_pic_address_disp_p): Remove static.
index ce05267dfa74f6546e2131905487511902c9b398..4d279b892a569c6a4591067dbb3cdd313c00e121 100644 (file)
@@ -2601,7 +2601,7 @@ legitimate_address_p (mode, addr, strict)
     }
 
   if (GET_CODE (addr) == REG || GET_CODE (addr) == SUBREG)
-      base = addr;
+    base = addr;
 
   else if (GET_CODE (addr) == PLUS)
     {
@@ -2691,6 +2691,12 @@ legitimate_address_p (mode, addr, strict)
          return FALSE;
        }
 
+      if (GET_MODE (base) != Pmode)
+       {
+         ADDR_INVALID ("Base is not in Pmode.\n", base);
+         return FALSE;
+       }
+
       if ((strict && ! REG_OK_FOR_BASE_STRICT_P (base))
          || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (base)))
        {
@@ -2712,6 +2718,12 @@ legitimate_address_p (mode, addr, strict)
          return FALSE;
        }
 
+      if (GET_MODE (indx) != Pmode)
+       {
+         ADDR_INVALID ("Index is not in Pmode.\n", indx);
+         return FALSE;
+       }
+
       if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (indx))
          || (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (indx)))
        {