aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2014-08-28 06:24:48 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2014-08-28 06:24:48 +0000
commit638e18a4f236204b61e6a6e74583f689926ec812 (patch)
tree7e7cb1561b8b2ed28dd0ac593270cdc855ceaf38
parent34a1e300b8989528d92ca84eaf7f713859893e2c (diff)
downloadgcc-638e18a4f236204b61e6a6e74583f689926ec812.zip
gcc-638e18a4f236204b61e6a6e74583f689926ec812.tar.gz
gcc-638e18a4f236204b61e6a6e74583f689926ec812.tar.bz2
store-motion.c: Include rtl-iter.h.
gcc/ * store-motion.c: Include rtl-iter.h. (extract_mentioned_regs_1): Delete. (extract_mentioned_regs): Use FOR_EACH_SUBRTX_VAR rather than for_each_rtx to iterate over subrtxes. From-SVN: r214660
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/store-motion.c22
2 files changed, 15 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 95c7fb89..4a271d5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
+ * store-motion.c: Include rtl-iter.h.
+ (extract_mentioned_regs_1): Delete.
+ (extract_mentioned_regs): Use FOR_EACH_SUBRTX_VAR rather than
+ for_each_rtx to iterate over subrtxes.
+
+2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
+
* sel-sched.c: Include rtl-iter.h
(count_occurrences_1): Delete.
(count_occurrences_equiv): Turn rtxes into const_rtxes.
diff --git a/gcc/store-motion.c b/gcc/store-motion.c
index fdbc6b3..70adfa93 100644
--- a/gcc/store-motion.c
+++ b/gcc/store-motion.c
@@ -42,6 +42,7 @@ along with GCC; see the file COPYING3. If not see
#include "hash-table.h"
#include "df.h"
#include "dbgcnt.h"
+#include "rtl-iter.h"
/* This pass implements downward store motion.
As of May 1, 2009, the pass is not enabled by default on any target,
@@ -278,19 +279,6 @@ store_ops_ok (const_rtx x, int *regs_set)
return true;
}
-/* Helper for extract_mentioned_regs. */
-
-static int
-extract_mentioned_regs_1 (rtx *loc, void *data)
-{
- rtx *mentioned_regs_p = (rtx *) data;
-
- if (REG_P (*loc))
- *mentioned_regs_p = alloc_EXPR_LIST (0, *loc, *mentioned_regs_p);
-
- return 0;
-}
-
/* Returns a list of registers mentioned in X.
FIXME: A regset would be prettier and less expensive. */
@@ -298,7 +286,13 @@ static rtx
extract_mentioned_regs (rtx x)
{
rtx mentioned_regs = NULL;
- for_each_rtx (&x, extract_mentioned_regs_1, &mentioned_regs);
+ subrtx_var_iterator::array_type array;
+ FOR_EACH_SUBRTX_VAR (iter, array, x, NONCONST)
+ {
+ rtx x = *iter;
+ if (REG_P (x))
+ mentioned_regs = alloc_EXPR_LIST (0, x, mentioned_regs);
+ }
return mentioned_regs;
}