summaryrefslogtreecommitdiffstats
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authorwehle <wehle@138bc75d-0d04-0410-961f-82ee72b054a4>2000-08-23 03:54:23 +0000
committerwehle <wehle@138bc75d-0d04-0410-961f-82ee72b054a4>2000-08-23 03:54:23 +0000
commit002fe3cb431c43bdaa5b5973cf02e80733f04fe3 (patch)
treeb033d3e0a235bd6b290d0387a72344825b7163b6 /gcc/rtlanal.c
parent82582c28be9c26a6340dcb351872b1b2a7c324c2 (diff)
downloadppe42-gcc-002fe3cb431c43bdaa5b5973cf02e80733f04fe3.tar.gz
ppe42-gcc-002fe3cb431c43bdaa5b5973cf02e80733f04fe3.zip
* rtlanal.c (rtx_unstable_p): The pic register is stable
(within one function) and the actual rtx should be used when checking the registers. (rtx_addr_can_trap_p): Pic memory addresses can't trap. * alias.c (true_dependence, write_dependence_p): Fix bug in previous patch. * i386.c (ix86_GOT_alias_set): New. (legitimize_pic_address): Use it. * rtlanal.c (rtx_unstable_p): An unchanging MEM is only stable if its address is stable. (rtx_varies_p): An unchanging MEM can't vary if its address doesn't vary. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35900 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 5c69a506b55..8424b8e2cde 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -53,7 +53,7 @@ rtx_unstable_p (x)
register const char *fmt;
if (code == MEM)
- return ! RTX_UNCHANGING_P (x);
+ return ! RTX_UNCHANGING_P (x) || rtx_unstable_p (XEXP (x, 0));
if (code == QUEUED)
return 1;
@@ -62,9 +62,9 @@ rtx_unstable_p (x)
return 0;
if (code == REG)
- return ! (REGNO (x) == FRAME_POINTER_REGNUM
- || REGNO (x) == HARD_FRAME_POINTER_REGNUM
- || REGNO (x) == ARG_POINTER_REGNUM
+ /* As in rtx_varies_p, we have to use the actual rtx, not reg number. */
+ return ! (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
+ || x == arg_pointer_rtx || x == pic_offset_table_rtx
|| RTX_UNCHANGING_P (x));
fmt = GET_RTX_FORMAT (code);
@@ -101,6 +101,8 @@ rtx_varies_p (x)
switch (code)
{
case MEM:
+ return ! RTX_UNCHANGING_P (x) || rtx_varies_p (XEXP (x, 0));
+
case QUEUED:
return 1;
@@ -174,9 +176,12 @@ rtx_addr_can_trap_p (x)
case PLUS:
/* An address is assumed not to trap if it is an address that can't
- trap plus a constant integer. */
- return (rtx_addr_can_trap_p (XEXP (x, 0))
- || GET_CODE (XEXP (x, 1)) != CONST_INT);
+ trap plus a constant integer or it is the pic register plus a
+ constant. */
+ return ! ((! rtx_addr_can_trap_p (XEXP (x, 0))
+ && GET_CODE (XEXP (x, 1)) == CONST_INT)
+ || (XEXP (x, 0) == pic_offset_table_rtx
+ && CONSTANT_P (XEXP (x, 1))));
case LO_SUM:
return rtx_addr_can_trap_p (XEXP (x, 1));
OpenPOWER on IntegriCloud