This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] fix target/44606, reload bug on SPE
- From: Nathan Froyd <froydnj at codesourcery dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org, bernds at codesourcery dot com
- Date: Tue, 5 Oct 2010 10:36:25 -0700
- Subject: Re: [PATCH] fix target/44606, reload bug on SPE
- References: <20100930182927.GL32503@codesourcery.com> <201010010016.50677.ebotcazou@adacore.com>
On Fri, Oct 01, 2010 at 12:16:50AM +0200, Eric Botcazou wrote:
> > Bootstrapping in progress on x86-64. OK to commit and backport to 4.5
> > and 4.4?
> >
> > gcc/
> > * reload1.c (emit_reload_insns): Adjust prototype. Check for
> > inherited output reloads.
>
> The return value must be documented.
>
> > (reload_as_needed): Delete insn if emit_reload_insns returns
> > true.
> > (choose_reload_regs): Save equiv in reload_override_in for
> > output reloads. Set reg_rtx from reload_override_in.
>
> I think that deleting new insns in reload is too risky on the branches. Can't
> we tighten the above condition instead on the branches so that it will return
> false in this case?
Returning to this thread, are you indicating that the deleting insns
approach is OK for trunk (I will post another patch addressing comments
if so), but you'd like to see something like the following (untested)
patch for release branches? Or would you like to see something
different for trunk as well? Please clarify. Thanks.
-Nathan
PR target/44606
* reload.c (find_equiv_reg): Delete code that attempts to find
equivalences from CONST_DOUBLEs.
Index: reload.c
===================================================================
--- reload.c (revision 300577)
+++ reload.c (working copy)
@@ -6838,33 +6838,9 @@ find_equiv_reg (rtx goal, rtx insn, enum
into a reg, we can use that reg. */
|| (goal_const && REG_NOTES (p) != 0
&& (tem = find_reg_note (p, REG_EQUIV, NULL_RTX))
- && ((rtx_equal_p (XEXP (tem, 0), goal)
- && (valueno
- = true_regnum (valtry = SET_DEST (pat))) >= 0)
- || (REG_P (SET_DEST (pat))
- && GET_CODE (XEXP (tem, 0)) == CONST_DOUBLE
- && SCALAR_FLOAT_MODE_P (GET_MODE (XEXP (tem, 0)))
- && CONST_INT_P (goal)
- && 0 != (goaltry
- = operand_subword (XEXP (tem, 0), 0, 0,
- VOIDmode))
- && rtx_equal_p (goal, goaltry)
- && (valtry
- = operand_subword (SET_DEST (pat), 0, 0,
- VOIDmode))
- && (valueno = true_regnum (valtry)) >= 0)))
- || (goal_const && (tem = find_reg_note (p, REG_EQUIV,
- NULL_RTX))
- && REG_P (SET_DEST (pat))
- && GET_CODE (XEXP (tem, 0)) == CONST_DOUBLE
- && SCALAR_FLOAT_MODE_P (GET_MODE (XEXP (tem, 0)))
- && CONST_INT_P (goal)
- && 0 != (goaltry = operand_subword (XEXP (tem, 0), 1, 0,
- VOIDmode))
- && rtx_equal_p (goal, goaltry)
- && (valtry
- = operand_subword (SET_DEST (pat), 1, 0, VOIDmode))
- && (valueno = true_regnum (valtry)) >= 0)))
+ && (rtx_equal_p (XEXP (tem, 0), goal)
+ && (valueno
+ = true_regnum (valtry = SET_DEST (pat))) >= 0))))
{
if (other >= 0)
{