summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-07-08 22:05:40 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-07-08 22:05:40 +0000
commit861aa17f68218185c84428e02699ec8c051844aa (patch)
treeee82a667b2d0822e966814febc004b38df6148a1
parentd3aba6ce7c3445f3508d74e90aaa908414986e3f (diff)
downloadppe42-gcc-861aa17f68218185c84428e02699ec8c051844aa.tar.gz
ppe42-gcc-861aa17f68218185c84428e02699ec8c051844aa.zip
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@21014 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/pa/pa.h21
-rw-r--r--gcc/tm.texi4
3 files changed, 22 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ced4434fdd4..964f026d0d9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
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
elsewhere.
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 21d817d483d..fb65b403fcb 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -1638,14 +1638,22 @@ extern struct rtx_def *hppa_builtin_saveregs ();
#define LEGITIMIZE_RELOAD_ADDRESS(AD, MODE, OPNUM, TYPE, IND, WIN) \
do { \
int offset, newoffset, mask; \
+ rtx new, temp = NULL_RTX; \
mask = GET_MODE_CLASS (MODE) == MODE_FLOAT ? 0x1f : 0x3fff; \
\
if (optimize \
- && GET_CODE (AD) == PLUS \
- && GET_CODE (XEXP (AD, 0)) == REG \
- && GET_CODE (XEXP (AD, 1)) == CONST_INT) \
+ && GET_CODE (AD) == PLUS) \
+ temp = simplify_binary_operation (PLUS, Pmode, \
+ 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. */ \
if ((offset & mask) >= ((mask + 1) / 2)) \
@@ -1656,11 +1664,8 @@ do { \
if (newoffset != 0 \
&& VAL_14_BITS_P (newoffset)) \
{ \
- rtx temp; \
\
- /* Unshare the sum as well. */ \
- AD = copy_rtx (AD); \
- temp = gen_rtx_PLUS (Pmode, XEXP (AD, 0), \
+ temp = gen_rtx_PLUS (Pmode, XEXP (new, 0), \
GEN_INT (newoffset)); \
AD = gen_rtx_PLUS (Pmode, temp, GEN_INT (offset - newoffset));\
push_reload (XEXP (AD, 0), 0, &XEXP (AD, 0), 0, \
diff --git a/gcc/tm.texi b/gcc/tm.texi
index cfff3a0e63c..32c5a75d053 100644
--- a/gcc/tm.texi
+++ b/gcc/tm.texi
@@ -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
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
The macro definition should use @code{push_reload} to indicate parts that
need reloading; @var{opnum}, @var{type} and @var{ind_levels} are usually
OpenPOWER on IntegriCloud