summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2014-11-07 13:12:12 -0500
committerDavid Malcolm <dmalcolm@redhat.com>2014-11-07 13:12:12 -0500
commitb0ba00c0fac803f0d8dd2159689c4e57db9e3235 (patch)
tree667b0471b1a13a9f935e611a141468ed42c96acb
parentc93192ec765abbc0db9b22d52cc3cd8dc291745a (diff)
downloadgcc-b0ba00c0fac803f0d8dd2159689c4e57db9e3235.tar.gz
tree-outof-ssa.c: Use gassign
gcc/ChangeLog.gimple-classes: * tree-outof-ssa.c (ssa_is_replaceable_p): Rename param "stmt" to "gs", replacing is_gimple_assign with a dyn_cast, using it to reintroduce "stmt" as a gassign * for typesafety. Remove redundant is_gimple_call (stmt) test, since we've already checked for a GIMPLE_ASSIGN.
-rw-r--r--gcc/ChangeLog.gimple-classes8
-rw-r--r--gcc/tree-outof-ssa.c11
2 files changed, 12 insertions, 7 deletions
diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index ded675a3bce..723f8a6caf5 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,13 @@
2014-11-07 David Malcolm <dmalcolm@redhat.com>
+ * tree-outof-ssa.c (ssa_is_replaceable_p): Rename param "stmt" to
+ "gs", replacing is_gimple_assign with a dyn_cast, using it to
+ reintroduce "stmt" as a gassign * for typesafety. Remove
+ redundant is_gimple_call (stmt) test, since we've already checked
+ for a GIMPLE_ASSIGN.
+
+2014-11-07 David Malcolm <dmalcolm@redhat.com>
+
* ubsan.c (ubsan_expand_null_ifn): Rename local "stmt" to
"ubsan_null_call" and strengthen from gimple to gcall *.
Eliminate local gimple "g" in favor of new locals
diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c
index bb57053b474..6d6b6bb962d 100644
--- a/gcc/tree-outof-ssa.c
+++ b/gcc/tree-outof-ssa.c
@@ -64,17 +64,18 @@ along with GCC; see the file COPYING3. If not see
should be in cfgexpand.c. */
#include "expr.h"
-/* Return TRUE if expression STMT is suitable for replacement. */
+/* Return TRUE if expression GS is suitable for replacement. */
bool
-ssa_is_replaceable_p (gimple stmt)
+ssa_is_replaceable_p (gimple gs)
{
use_operand_p use_p;
tree def;
gimple use_stmt;
/* Only consider modify stmts. */
- if (!is_gimple_assign (stmt))
+ gassign *stmt = dyn_cast <gassign *> (gs);
+ if (!stmt)
return false;
/* If the statement may throw an exception, it cannot be replaced. */
@@ -109,10 +110,6 @@ ssa_is_replaceable_p (gimple stmt)
&& DECL_HARD_REGISTER (gimple_assign_rhs1 (stmt)))
return false;
- /* No function calls can be replaced. */
- if (is_gimple_call (stmt))
- return false;
-
/* Leave any stmt with volatile operands alone as well. */
if (gimple_has_volatile_ops (stmt))
return false;