Commit 67f07489 by Paul Brook Committed by Paul Brook

reload1.c (choose_reload_regs): Check for all RTX_AUTOINC operators.

2006-03-29  Paul Brook  <paul@codesourcery.com>

	* reload1.c (choose_reload_regs): Check for all RTX_AUTOINC operators.
	(inc_for_reload): Handle PRE_MODIFY and POST_MODIFY addresses.

From-SVN: r112500
parent 531e214a
2006-03-29 Paul Brook <paul@codesourcery.com>
* reload1.c (choose_reload_regs): Check for all RTX_AUTOINC operators.
(inc_for_reload): Handle PRE_MODIFY and POST_MODIFY addresses.
2006-03-29 Paul Brook <paul@codesourcery.com>
PR middle-end/23623
* targhooks.c (default_narrow_bitfield): New fuction.
* targhooks.h (default_narrow_bitfield): add prototype.
......
......@@ -5505,10 +5505,7 @@ choose_reload_regs (struct insn_chain *chain)
mode = GET_MODE (rld[r].in_reg);
}
#ifdef AUTO_INC_DEC
else if ((GET_CODE (rld[r].in_reg) == PRE_INC
|| GET_CODE (rld[r].in_reg) == PRE_DEC
|| GET_CODE (rld[r].in_reg) == POST_INC
|| GET_CODE (rld[r].in_reg) == POST_DEC)
else if (GET_RTX_CLASS (GET_CODE (rld[r].in_reg)) == RTX_AUTOINC
&& REG_P (XEXP (rld[r].in_reg, 0)))
{
regno = REGNO (XEXP (rld[r].in_reg, 0));
......@@ -8115,7 +8112,8 @@ inc_for_reload (rtx reloadreg, rtx in, rtx value, int inc_amount)
/* REG or MEM to be copied and incremented. */
rtx incloc = XEXP (value, 0);
/* Nonzero if increment after copying. */
int post = (GET_CODE (value) == POST_DEC || GET_CODE (value) == POST_INC);
int post = (GET_CODE (value) == POST_DEC || GET_CODE (value) == POST_INC
|| GET_CODE (value) == POST_MODIFY);
rtx last;
rtx inc;
rtx add_insn;
......@@ -8130,10 +8128,18 @@ inc_for_reload (rtx reloadreg, rtx in, rtx value, int inc_amount)
if (REG_P (incloc))
reg_last_reload_reg[REGNO (incloc)] = 0;
if (GET_CODE (value) == PRE_DEC || GET_CODE (value) == POST_DEC)
inc_amount = -inc_amount;
if (GET_CODE (value) == PRE_MODIFY || GET_CODE (value) == POST_MODIFY)
{
gcc_assert (GET_CODE (XEXP (value, 1)) == PLUS);
inc = XEXP (XEXP (value, 1), 1);
}
else
{
if (GET_CODE (value) == PRE_DEC || GET_CODE (value) == POST_DEC)
inc_amount = -inc_amount;
inc = GEN_INT (inc_amount);
inc = GEN_INT (inc_amount);
}
/* If this is post-increment, first copy the location to the reload reg. */
if (post && real_in != reloadreg)
......@@ -8193,7 +8199,10 @@ inc_for_reload (rtx reloadreg, rtx in, rtx value, int inc_amount)
emit_insn (gen_add2_insn (reloadreg, inc));
store = emit_insn (gen_move_insn (incloc, reloadreg));
emit_insn (gen_add2_insn (reloadreg, GEN_INT (-inc_amount)));
if (GET_CODE (inc) == CONST_INT)
emit_insn (gen_add2_insn (reloadreg, GEN_INT (-INTVAL(inc))));
else
emit_insn (gen_sub2_insn (reloadreg, inc));
}
return store;
......
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