aboutsummaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorJ"orn Rennecke <amylaar@redhat.com>2001-01-19 09:20:14 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>2001-01-19 09:20:14 +0000
commit61f0131c68b026c24560d3b9adde5ab7c34c073c (patch)
treeb6bec1c4b2aae7a1debf11a5759969276bc5ae55 /gcc/alias.c
parent08c2df0f4f04b0f799842f66b68d17dce626fe02 (diff)
downloadgcc-61f0131c68b026c24560d3b9adde5ab7c34c073c.zip
gcc-61f0131c68b026c24560d3b9adde5ab7c34c073c.tar.gz
gcc-61f0131c68b026c24560d3b9adde5ab7c34c073c.tar.bz2
alias.c (find_base_value): Recognize TRUNCATE.
* alias.c (find_base_value): Recognize TRUNCATE. (record_set): In PLUS case, invalidate if other summand is also a base value. From-SVN: r39128
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index 235d299..a77e7c8 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -759,6 +759,10 @@ find_base_value (src)
return find_base_value (XEXP (src, 0));
return 0;
+ case TRUNCATE:
+ if (GET_MODE_SIZE (GET_MODE (src)) < GET_MODE_SIZE (Pmode))
+ break;
+ /* Fall through. */
case ZERO_EXTEND:
case SIGN_EXTEND: /* used for NT/Alpha pointers */
case HIGH:
@@ -832,11 +836,26 @@ record_set (dest, set, data)
switch (GET_CODE (src))
{
case LO_SUM:
- case PLUS:
case MINUS:
if (XEXP (src, 0) != dest && XEXP (src, 1) != dest)
new_reg_base_value[regno] = 0;
break;
+ case PLUS:
+ /* If the value we add in the PLUS is also a valid base value,
+ this might be the actual base value, and the original value
+ an index. */
+ {
+ rtx other = NULL_RTX;
+
+ if (XEXP (src, 0) == dest)
+ other = XEXP (src, 1);
+ else if (XEXP (src, 1) == dest)
+ other = XEXP (src, 0);
+
+ if (! other || find_base_value (other))
+ new_reg_base_value[regno] = 0;
+ break;
+ }
case AND:
if (XEXP (src, 0) != dest || GET_CODE (XEXP (src, 1)) != CONST_INT)
new_reg_base_value[regno] = 0;