aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2014-08-28 06:23:13 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2014-08-28 06:23:13 +0000
commit9021b8ec96cd58324a3cce6a7b756cd964f91aa1 (patch)
treed2d441830db8c826e4f804efe337774451b7ffee
parent3e971a9125be65a34233e6b7496f6c39419a6a5c (diff)
downloadgcc-9021b8ec96cd58324a3cce6a7b756cd964f91aa1.zip
gcc-9021b8ec96cd58324a3cce6a7b756cd964f91aa1.tar.gz
gcc-9021b8ec96cd58324a3cce6a7b756cd964f91aa1.tar.bz2
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
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/emit-rtl.c32
2 files changed, 18 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cd9fb2c..3d822a5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
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.
Return a bool, inverting the result so that 0/false means "not ok".
Use FOR_EACH_SUBRTX_PTR instead of for_each_rtx to iterate over
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 9abe56e..e47ef02 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -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;