rtlanal.c (rtx_unstable_p): The pic register is stable (within one function) and the actual rtx should be...

* 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.

From-SVN: r35900
This commit is contained in:
John Wehle 2000-08-23 03:54:23 +00:00 committed by John Wehle
parent aac625acc6
commit 55efb413f8
4 changed files with 56 additions and 21 deletions

View File

@ -1,3 +1,21 @@
Tue Aug 22 23:53:27 EDT 2000 John Wehle (john@feith.com)
* 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.
2000-08-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* c-parse.in (unop +): Restrict -Wtraditional warnings to user code.

View File

@ -1584,18 +1584,18 @@ true_dependence (mem, mem_mode, x, varies)
if (RTX_UNCHANGING_P (x) && ! RTX_UNCHANGING_P (mem))
return 0;
base = find_base_term (x);
if (base && (GET_CODE (base) == LABEL_REF
|| (GET_CODE (base) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (base))))
return 0;
if (mem_mode == VOIDmode)
mem_mode = GET_MODE (mem);
x_addr = get_addr (XEXP (x, 0));
mem_addr = get_addr (XEXP (mem, 0));
base = find_base_term (x_addr);
if (base && (GET_CODE (base) == LABEL_REF
|| (GET_CODE (base) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (base))))
return 0;
if (! base_alias_check (x_addr, mem_addr, GET_MODE (x), mem_mode))
return 0;
@ -1645,22 +1645,21 @@ write_dependence_p (mem, x, writep)
/* If MEM is an unchanging read, then it can't possibly conflict with
the store to X, because there is at most one store to MEM, and it must
have occurred somewhere before MEM. */
if (! writep && RTX_UNCHANGING_P (mem))
return 0;
x_addr = get_addr (XEXP (x, 0));
mem_addr = get_addr (XEXP (mem, 0));
if (! writep)
{
if (RTX_UNCHANGING_P (mem))
return 0;
base = find_base_term (mem);
base = find_base_term (mem_addr);
if (base && (GET_CODE (base) == LABEL_REF
|| (GET_CODE (base) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (base))))
return 0;
}
x_addr = get_addr (XEXP (x, 0));
mem_addr = get_addr (XEXP (mem, 0));
if (! base_alias_check (x_addr, mem_addr, GET_MODE (x),
GET_MODE (mem)))
return 0;

View File

@ -427,6 +427,7 @@ static void ix86_emit_restore_regs_using_mov PARAMS ((rtx, int));
static void ix86_emit_epilogue_esp_adjustment PARAMS((int));
static void ix86_sched_reorder_pentium PARAMS((rtx *, rtx *));
static void ix86_sched_reorder_ppro PARAMS((rtx *, rtx *));
static HOST_WIDE_INT ix86_GOT_alias_set PARAMS ((void));
struct ix86_address
{
@ -2553,6 +2554,17 @@ report_error:
return FALSE;
}
/* Return an unique alias set for the GOT. */
static HOST_WIDE_INT
ix86_GOT_alias_set ()
{
static HOST_WIDE_INT set = -1;
if (set == -1)
set = new_alias_set ();
return set;
}
/* Return a legitimate reference for ORIG (an address) using the
register REG. If REG is 0, a new pseudo is generated.
@ -2610,6 +2622,7 @@ legitimize_pic_address (orig, reg)
new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);
new = gen_rtx_MEM (Pmode, new);
RTX_UNCHANGING_P (new) = 1;
MEM_ALIAS_SET (new) = ix86_GOT_alias_set ();
if (reg == 0)
reg = gen_reg_rtx (Pmode);

View File

@ -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));