summaryrefslogtreecommitdiff
path: root/gcc/store-motion.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-28 06:24:48 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-28 06:24:48 +0000
commit65a67d18979cce16d64474d0fb574211c48e99f4 (patch)
tree7e7cb1561b8b2ed28dd0ac593270cdc855ceaf38 /gcc/store-motion.c
parent6121af960d3f36030a6d812f11e47ff3cb6bb7d7 (diff)
downloadgcc-65a67d18979cce16d64474d0fb574211c48e99f4.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214660 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/store-motion.c')
-rw-r--r--gcc/store-motion.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/gcc/store-motion.c b/gcc/store-motion.c
index fdbc6b3631c..70adfa93735 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;
}