summaryrefslogtreecommitdiff
path: root/gcc/reload.c
diff options
context:
space:
mode:
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-01 16:17:32 +0000
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-01 16:17:32 +0000
commit2843e2239a77d704022c76084a6c34c9ee5c3e34 (patch)
tree07a2d383d9f35ac0378a58c573b4e81245aee0ae /gcc/reload.c
parent589d17e746d3c9c37c689a2dd64791e3a412b496 (diff)
downloadgcc-2843e2239a77d704022c76084a6c34c9ee5c3e34.tar.gz
* reload.c (find_reloads_address): Split addresses of type
(plus (plus (reg) (reg)) (const_int)) only if one register is either a valid base register or else one of the stack frame related registers (sp/fp/ap). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74107 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reload.c')
-rw-r--r--gcc/reload.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/reload.c b/gcc/reload.c
index 33167eaed2f..b448ff2d967 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -4905,6 +4905,15 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
&& GET_CODE (XEXP (ad, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (ad, 0), 0)) == REG
&& REGNO (XEXP (XEXP (ad, 0), 0)) < FIRST_PSEUDO_REGISTER
+ && (REG_MODE_OK_FOR_BASE_P (XEXP (XEXP (ad, 0), 0), mode)
+ || XEXP (XEXP (ad, 0), 0) == frame_pointer_rtx
+#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
+ || XEXP (XEXP (ad, 0), 0) == hard_frame_pointer_rtx
+#endif
+#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
+ || XEXP (XEXP (ad, 0), 0) == arg_pointer_rtx
+#endif
+ || XEXP (XEXP (ad, 0), 0) == stack_pointer_rtx)
&& ! maybe_memory_address_p (mode, ad, &XEXP (XEXP (ad, 0), 1)))
{
*loc = ad = gen_rtx_PLUS (GET_MODE (ad),
@@ -4924,6 +4933,15 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
&& GET_CODE (XEXP (ad, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (ad, 0), 1)) == REG
&& REGNO (XEXP (XEXP (ad, 0), 1)) < FIRST_PSEUDO_REGISTER
+ && (REG_MODE_OK_FOR_BASE_P (XEXP (XEXP (ad, 0), 1), mode)
+ || XEXP (XEXP (ad, 0), 1) == frame_pointer_rtx
+#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
+ || XEXP (XEXP (ad, 0), 1) == hard_frame_pointer_rtx
+#endif
+#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
+ || XEXP (XEXP (ad, 0), 1) == arg_pointer_rtx
+#endif
+ || XEXP (XEXP (ad, 0), 1) == stack_pointer_rtx)
&& ! maybe_memory_address_p (mode, ad, &XEXP (XEXP (ad, 0), 0)))
{
*loc = ad = gen_rtx_PLUS (GET_MODE (ad),