emit-rtl.c: Include rtl-iter.h.

gcc/
	* emit-rtl.c: Include rtl-iter.h.
	(find_auto_inc): Turn from being a for_each_rtx callback to being
	a function that examines each subrtx itself.  Assume the first operand
	to an RTX_AUTOINC is the automodified register.
	(try_split): Update call accordingly.

From-SVN: r214638
This commit is contained in:
Richard Sandiford 2014-08-28 06:23:13 +00:00 committed by Richard Sandiford
parent 3e971a9125
commit 9021b8ec96
2 changed files with 18 additions and 22 deletions

View File

@ -1,3 +1,11 @@
2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
* emit-rtl.c: Include rtl-iter.h.
(find_auto_inc): Turn from being a for_each_rtx callback to being
a function that examines each subrtx itself. Assume the first operand
to an RTX_AUTOINC is the automodified register.
(try_split): Update call accordingly.
2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
* dwarf2out.c (resolve_one_addr): Remove unused data parameter.

View File

@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see
#include "params.h"
#include "target.h"
#include "builtins.h"
#include "rtl-iter.h"
struct target_rtl default_target_rtl;
#if SWITCHABLE_TARGET
@ -3505,30 +3506,17 @@ prev_cc0_setter (rtx insn)
/* Find a RTX_AUTOINC class rtx which matches DATA. */
static int
find_auto_inc (rtx *xp, void *data)
find_auto_inc (const_rtx x, const_rtx reg)
{
rtx x = *xp;
rtx reg = (rtx) data;
if (GET_RTX_CLASS (GET_CODE (x)) != RTX_AUTOINC)
return 0;
switch (GET_CODE (x))
subrtx_iterator::array_type array;
FOR_EACH_SUBRTX (iter, array, x, NONCONST)
{
case PRE_DEC:
case PRE_INC:
case POST_DEC:
case POST_INC:
case PRE_MODIFY:
case POST_MODIFY:
if (rtx_equal_p (reg, XEXP (x, 0)))
return 1;
break;
default:
gcc_unreachable ();
const_rtx x = *iter;
if (GET_RTX_CLASS (GET_CODE (x)) == RTX_AUTOINC
&& rtx_equal_p (reg, XEXP (x, 0)))
return true;
}
return -1;
return false;
}
#endif
@ -3715,7 +3703,7 @@ try_split (rtx pat, rtx trial, int last)
{
rtx reg = XEXP (note, 0);
if (!FIND_REG_INC_NOTE (insn, reg)
&& for_each_rtx (&PATTERN (insn), find_auto_inc, reg) > 0)
&& find_auto_inc (PATTERN (insn), reg))
add_reg_note (insn, REG_INC, reg);
}
break;