This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: enable LEGITIMIZE_RELOAD_ADDRESS on all MEM addresses
- To: gcc-patches at gcc dot gnu dot org
- Subject: PATCH: enable LEGITIMIZE_RELOAD_ADDRESS on all MEM addresses
- From: <lehotsky at tiac dot net>
- Date: Mon, 20 Nov 2000 16:00:08 -0500 (EST)
- reply-to: alehotsky at cygnus dot com
When reload does various substitutions of MEM's for pseudos, it
calls find_reloads_address () to process the address expression. In
THREE places, it passes a null pointer down for the MEMREFLOC
argument.
When this is NULL, the LEGITIMIZE_RELOAD_ADDRESS macro is not invoked,
as the call is guarded by
if (memrefloc)
There are actually FOUR places that call find_reloads_address() with a
NULL, but the other place is in handling the 'p' constraint. And in
this case, you won't have a MEM, just the address beneath.
I've built my compiler and run regression tests (my target machine HAS
to let LEGITIMIZE_RELOAD_ADDRESS see these addresses or we end up with
unrecognized instructions with illegitimate addresses.
ChangeLog entry:
2000-11-20 Alan Lehotsky <alehotsky@cygnus.com>
reload.c (get_secondary_mem, find_reloads_address,
find_reloads_address_1): Pass address of pointer to MEM so that
LEGITIMIZE_RELOAD_ADDRESS will be run on the substituted address.
-------------
Index: reload.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/reload.c,v
retrieving revision 1.191
diff -c -r1.191 reload.c
*** reload.c 2000/11/13 22:30:40 1.191
--- reload.c 2000/11/20 20:53:08
***************
*** 634,640 ****
: type == RELOAD_FOR_OUTPUT ? RELOAD_FOR_OUTPUT_ADDRESS
: RELOAD_OTHER);
! find_reloads_address (mode, NULL_PTR, XEXP (loc, 0), &XEXP (loc, 0),
opnum, type, 0, 0);
}
--- 634,640 ----
: type == RELOAD_FOR_OUTPUT ? RELOAD_FOR_OUTPUT_ADDRESS
: RELOAD_OTHER);
! find_reloads_address (mode, &loc, XEXP (loc, 0), &XEXP (loc, 0),
opnum, type, 0, 0);
}
***************
*** 4496,4502 ****
tem = make_memloc (ad, regno);
if (! strict_memory_address_p (GET_MODE (tem), XEXP (tem, 0)))
{
! find_reloads_address (GET_MODE (tem), NULL_PTR, XEXP (tem, 0),
&XEXP (tem, 0), opnum, ADDR_TYPE (type),
ind_levels, insn);
}
--- 4496,4502 ----
tem = make_memloc (ad, regno);
if (! strict_memory_address_p (GET_MODE (tem), XEXP (tem, 0)))
{
! find_reloads_address (GET_MODE (tem), &tem, XEXP (tem, 0),
&XEXP (tem, 0), opnum, ADDR_TYPE (type),
ind_levels, insn);
}
***************
*** 5179,5185 ****
We can't use ADDR_TYPE (type) here, because we need to
write back the value after reading it, hence we actually
need two registers. */
! find_reloads_address (GET_MODE (tem), 0, XEXP (tem, 0),
&XEXP (tem, 0), opnum,
RELOAD_OTHER,
ind_levels, insn);
--- 5179,5185 ----
We can't use ADDR_TYPE (type) here, because we need to
write back the value after reading it, hence we actually
need two registers. */
! find_reloads_address (GET_MODE (tem), &tem, XEXP (tem, 0),
&XEXP (tem, 0), opnum,
RELOAD_OTHER,
ind_levels, insn);