Commit ea471af0 by Joseph Myers Committed by Joseph Myers

re PR target/36780 (Wrong reload generated for subreg address on SH)

	PR target/36780
	PR target/36827
	* reload.c (find_reloads_subreg_address): Only reload address if
	reloaded == 0, not for reloaded != 1.

	Revert:
	2008-07-16  Joseph Myers  <joseph@codesourcery.com>
	* config/m32c/m32c.c (BIG_FB_ADJ): Move definition earlier.
	(m32c_legitimate_address_p): Handle "++rii" addresses created by
	m32c_legitimize_reload_address.

	2008-07-15  Kaz Kojima  <kkojima@gcc.gnu.org>
	* config/sh/sh.h (GO_IF_LEGITIMATE_ADDRESS): Allow
	(plus (plus (reg) (const_int)) (const_int)) when reload_in_progress.

From-SVN: r137976
parent fa8884d8
2008-07-19 Joseph Myers <joseph@codesourcery.com>
PR target/36780
PR target/36827
* reload.c (find_reloads_subreg_address): Only reload address if
reloaded == 0, not for reloaded != 1.
Revert:
2008-07-16 Joseph Myers <joseph@codesourcery.com>
* config/m32c/m32c.c (BIG_FB_ADJ): Move definition earlier.
(m32c_legitimate_address_p): Handle "++rii" addresses created by
m32c_legitimize_reload_address.
2008-07-15 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.h (GO_IF_LEGITIMATE_ADDRESS): Allow
(plus (plus (reg) (const_int)) (const_int)) when reload_in_progress.
2008-07-19 Olivier Hainque <hainque@adacore.com> 2008-07-19 Olivier Hainque <hainque@adacore.com>
* dwarf2out.c (add_subscript_info): New explicit COLLAPSE_P * dwarf2out.c (add_subscript_info): New explicit COLLAPSE_P
......
...@@ -1778,8 +1778,6 @@ m32c_init_libfuncs (void) ...@@ -1778,8 +1778,6 @@ m32c_init_libfuncs (void)
/* Addressing Modes */ /* Addressing Modes */
#define BIG_FB_ADJ 0
/* Used by GO_IF_LEGITIMATE_ADDRESS. The r8c/m32c family supports a /* Used by GO_IF_LEGITIMATE_ADDRESS. The r8c/m32c family supports a
wide range of non-orthogonal addressing modes, including the wide range of non-orthogonal addressing modes, including the
ability to double-indirect on *some* of them. Not all insns ability to double-indirect on *some* of them. Not all insns
...@@ -1897,17 +1895,6 @@ m32c_legitimate_address_p (enum machine_mode mode, rtx x, int strict) ...@@ -1897,17 +1895,6 @@ m32c_legitimate_address_p (enum machine_mode mode, rtx x, int strict)
return 0; return 0;
} }
} }
if (RTX_IS ("++rii"))
{
rtx reg = patternr[2];
HOST_WIDE_INT offs = INTVAL (patternr[3]);
/* Avoid reloads for addresses generated by
m32c_legitimize_reload_address being generated by
find_reloads_subreg_address. */
if (REGNO (reg) == FB_REGNO && offs == -BIG_FB_ADJ)
return 1;
}
return 0; return 0;
} }
...@@ -1955,6 +1942,8 @@ m32c_reg_ok_for_base_p (rtx x, int strict) ...@@ -1955,6 +1942,8 @@ m32c_reg_ok_for_base_p (rtx x, int strict)
frame, so the third case seems best. Note that we subtract the frame, so the third case seems best. Note that we subtract the
zero, but detect that in the addhi3 pattern. */ zero, but detect that in the addhi3 pattern. */
#define BIG_FB_ADJ 0
/* Implements LEGITIMIZE_ADDRESS. The only address we really have to /* Implements LEGITIMIZE_ADDRESS. The only address we really have to
worry about is frame base offsets, as $fb has a limited worry about is frame base offsets, as $fb has a limited
displacement range. We deal with this by attempting to reload $fb displacement range. We deal with this by attempting to reload $fb
......
...@@ -2501,19 +2501,6 @@ struct sh_args { ...@@ -2501,19 +2501,6 @@ struct sh_args {
goto LABEL; \ goto LABEL; \
} \ } \
} \ } \
/* FIXME: This is a temporary hack which should be removed. \
When reload in progress, find_reloads_subreg_address tries to \
make a new reload for some types of address. Unfortunately it \
generates wrong code on SH. See PR36780. The following is to \
avoid this issue. */ \
if (!TARGET_SHMEDIA && reload_in_progress \
&& GET_CODE (X) == PLUS \
&& (GET_MODE_SIZE (MODE) == 4 || GET_MODE_SIZE (MODE) == 8) \
&& GET_CODE (XEXP ((X), 0)) == PLUS \
&& GET_CODE (XEXP (XEXP ((X), 0), 1)) == CONST_INT \
&& BASE_REGISTER_RTX_P (XEXP (XEXP ((X), 0), 0)) \
&& GET_CODE (XEXP ((X), 1)) == CONST_INT) \
goto LABEL; \
} }
/* Try machine-dependent ways of modifying an illegitimate address /* Try machine-dependent ways of modifying an illegitimate address
......
...@@ -6103,7 +6103,7 @@ find_reloads_subreg_address (rtx x, int force_replace, int opnum, ...@@ -6103,7 +6103,7 @@ find_reloads_subreg_address (rtx x, int force_replace, int opnum,
doesn't find any, then we may have just converted a doesn't find any, then we may have just converted a
valid address into an invalid one. Check for that valid address into an invalid one. Check for that
here. */ here. */
if (reloaded != 1 if (reloaded == 0
&& !strict_memory_address_p (GET_MODE (tem), && !strict_memory_address_p (GET_MODE (tem),
XEXP (tem, 0))) XEXP (tem, 0)))
push_reload (XEXP (tem, 0), NULL_RTX, &XEXP (tem, 0), (rtx*) 0, push_reload (XEXP (tem, 0), NULL_RTX, &XEXP (tem, 0), (rtx*) 0,
......
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