Commit 5f0c590d by Jeffrey A Law Committed by Jeff Law

pa.h (LEGITIMIZE_RELOAD_ADDRESS): Handle addresses created by LEGITIMIZE_RELOAD_ADDRESS.

        * pa.h (LEGITIMIZE_RELOAD_ADDRESS): Handle addresses created by
        LEGITIMIZE_RELOAD_ADDRESS.
        * tm.texi (LEGITIMIZE_RELOAD_ADDRESS): Note that this macro must be
        able to handle addresses created by previous invocations of the macro.

From-SVN: r21014
parent 2710ffc8
Wed Jul 8 21:43:14 1998 Jeffrey A Law (law@cygnus.com) Wed Jul 8 21:43:14 1998 Jeffrey A Law (law@cygnus.com)
* pa.h (LEGITIMIZE_RELOAD_ADDRESS): Handle addresses created by
LEGITIMIZE_RELOAD_ADDRESS.
* tm.texi (LEGITIMIZE_RELOAD_ADDRESS): Note that this macro must be
able to handle addresses created by previous invocations of the macro.
* flow.c (find_auto_inc): Remove most recent change. Real bug was * flow.c (find_auto_inc): Remove most recent change. Real bug was
elsewhere. elsewhere.
......
...@@ -1638,14 +1638,22 @@ extern struct rtx_def *hppa_builtin_saveregs (); ...@@ -1638,14 +1638,22 @@ extern struct rtx_def *hppa_builtin_saveregs ();
#define LEGITIMIZE_RELOAD_ADDRESS(AD, MODE, OPNUM, TYPE, IND, WIN) \ #define LEGITIMIZE_RELOAD_ADDRESS(AD, MODE, OPNUM, TYPE, IND, WIN) \
do { \ do { \
int offset, newoffset, mask; \ int offset, newoffset, mask; \
rtx new, temp = NULL_RTX; \
mask = GET_MODE_CLASS (MODE) == MODE_FLOAT ? 0x1f : 0x3fff; \ mask = GET_MODE_CLASS (MODE) == MODE_FLOAT ? 0x1f : 0x3fff; \
\ \
if (optimize \ if (optimize \
&& GET_CODE (AD) == PLUS \ && GET_CODE (AD) == PLUS) \
&& GET_CODE (XEXP (AD, 0)) == REG \ temp = simplify_binary_operation (PLUS, Pmode, \
&& GET_CODE (XEXP (AD, 1)) == CONST_INT) \ XEXP (AD, 0), XEXP (AD, 1)); \
\
new = temp ? temp : AD; \
\
if (optimize \
&& GET_CODE (new) == PLUS \
&& GET_CODE (XEXP (new, 0)) == REG \
&& GET_CODE (XEXP (new, 1)) == CONST_INT) \
{ \ { \
offset = INTVAL (XEXP ((AD), 1)); \ offset = INTVAL (XEXP ((new), 1)); \
\ \
/* Choose rounding direction. Round up if we are >= halfway. */ \ /* Choose rounding direction. Round up if we are >= halfway. */ \
if ((offset & mask) >= ((mask + 1) / 2)) \ if ((offset & mask) >= ((mask + 1) / 2)) \
...@@ -1656,11 +1664,8 @@ do { \ ...@@ -1656,11 +1664,8 @@ do { \
if (newoffset != 0 \ if (newoffset != 0 \
&& VAL_14_BITS_P (newoffset)) \ && VAL_14_BITS_P (newoffset)) \
{ \ { \
rtx temp; \
\ \
/* Unshare the sum as well. */ \ temp = gen_rtx_PLUS (Pmode, XEXP (new, 0), \
AD = copy_rtx (AD); \
temp = gen_rtx_PLUS (Pmode, XEXP (AD, 0), \
GEN_INT (newoffset)); \ GEN_INT (newoffset)); \
AD = gen_rtx_PLUS (Pmode, temp, GEN_INT (offset - newoffset));\ AD = gen_rtx_PLUS (Pmode, temp, GEN_INT (offset - newoffset));\
push_reload (XEXP (AD, 0), 0, &XEXP (AD, 0), 0, \ push_reload (XEXP (AD, 0), 0, &XEXP (AD, 0), 0, \
......
...@@ -4310,6 +4310,10 @@ to know something of how reload works in order to effectively use this, ...@@ -4310,6 +4310,10 @@ to know something of how reload works in order to effectively use this,
and it is quite easy to produce macros that build in too much knowledge and it is quite easy to produce macros that build in too much knowledge
of reload internals. of reload internals.
@emph{Note}: This macro must be able to reload an address created by a
previous invocation of this macro. If it fails to handle such addresses
then the compiler may generate incorrect code or abort.
@findex push_reload @findex push_reload
The macro definition should use @code{push_reload} to indicate parts that The macro definition should use @code{push_reload} to indicate parts that
need reloading; @var{opnum}, @var{type} and @var{ind_levels} are usually need reloading; @var{opnum}, @var{type} and @var{ind_levels} are usually
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment