gcc/ChangeLog.gimple-classes:
* tree-ssa-sink.c (statement_sink_location): Rename param "stmt"
to "gs", reintroducing "stmt" as a local gassign * via a dyn_cast
for typesafety.
---
gcc/ChangeLog.gimple-classes | 6 ++++++
gcc/tree-ssa-sink.c | 9 +++++----
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index 382bd3d..2c78ce0 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,11 @@
2014-11-06 David Malcolm <[email protected]>
+ * tree-ssa-sink.c (statement_sink_location): Rename param "stmt"
+ to "gs", reintroducing "stmt" as a local gassign * via a dyn_cast
+ for typesafety.
+
+2014-11-06 David Malcolm <[email protected]>
+
* tree-ssa-propagate.c
(substitute_and_fold_dom_walker::before_dom_children): Add checked
cast. Replace is_gimple_assign with a dyn_cast, introducing local
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index c6d8712..968ab27 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -256,13 +256,13 @@ select_best_block (basic_block early_bb,
return early_bb;
}
-/* Given a statement (STMT) and the basic block it is currently in (FROMBB),
+/* Given a statement (GS) and the basic block it is currently in (FROMBB),
determine the location to sink the statement to, if any.
Returns true if there is such location; in that case, TOGSI points to the
- statement before that STMT should be moved. */
+ statement before that GS should be moved. */
static bool
-statement_sink_location (gimple stmt, basic_block frombb,
+statement_sink_location (gimple gs, basic_block frombb,
gimple_stmt_iterator *togsi)
{
gimple use;
@@ -274,7 +274,8 @@ statement_sink_location (gimple stmt, basic_block frombb,
imm_use_iterator imm_iter;
/* We only can sink assignments. */
- if (!is_gimple_assign (stmt))
+ gassign *stmt = dyn_cast <gassign *> (gs);
+ if (!stmt)
return false;
/* We only can sink stmts with a single definition. */
--
1.7.11.7