aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>1999-02-14 15:13:11 -0800
committerRichard Henderson <rth@gcc.gnu.org>1999-02-14 15:13:11 -0800
commitc954bd01573a8027f9e07f5a56adc53ff3fc939d (patch)
tree97f25649ab1d5dea9f36d4534a92609e7ce2b18b
parent59be65f6b509eac7a00f2e60d608d510f3acb915 (diff)
downloadgcc-c954bd01573a8027f9e07f5a56adc53ff3fc939d.zip
gcc-c954bd01573a8027f9e07f5a56adc53ff3fc939d.tar.gz
gcc-c954bd01573a8027f9e07f5a56adc53ff3fc939d.tar.bz2
* i386.c (legitimate_address_p): Verify modes of base and index.
From-SVN: r25209
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/i386/i386.c14
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d0ca761..16b3998 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index ce05267..4d279b8 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -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)))
{