summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2014-11-05 17:06:13 -0500
committerDavid Malcolm <dmalcolm@redhat.com>2014-11-05 17:06:13 -0500
commitf136180619350d64ff7fd6ef131ea041bb69e7e4 (patch)
tree7a9a681c675be54edea65cf9ffe9f556b21911e2 /gcc
parentb17b94b5d545bc75e2c6081b6151e70602ec9292 (diff)
downloadgcc-f136180619350d64ff7fd6ef131ea041bb69e7e4.tar.gz
predict.c: Use gassign
gcc/ChangeLog.gimple-classes: * predict.c (expr_expected_value_1): Replace is_gimple_assign with a dyn_cast, introducing local "def_assign" and using it in place of "def" for typesafety.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog.gimple-classes6
-rw-r--r--gcc/predict.c13
2 files changed, 13 insertions, 6 deletions
diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index 1ff615fd6e4..9f852606bb2 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,11 @@
2014-11-05 David Malcolm <dmalcolm@redhat.com>
+ * predict.c (expr_expected_value_1): Replace is_gimple_assign with
+ a dyn_cast, introducing local "def_assign" and using it in place
+ of "def" for typesafety.
+
+2014-11-05 David Malcolm <dmalcolm@redhat.com>
+
* omp-low.c (expand_omp_taskreg): Strengthen locals "parcopy_stmt"
and "stmt" from gimple to gassign *, replacing a check against
GIMPLE_ASSIGN with a dyn_cast.
diff --git a/gcc/predict.c b/gcc/predict.c
index ed8f352ffd4..ca6c7e009c7 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -1805,15 +1805,16 @@ expr_expected_value_1 (tree type, tree op0, enum tree_code code,
}
return val;
}
- if (is_gimple_assign (def))
+ if (gassign *def_assign = dyn_cast <gassign *> (def))
{
- if (gimple_assign_lhs (def) != op0)
+ if (gimple_assign_lhs (def_assign) != op0)
return NULL;
- return expr_expected_value_1 (TREE_TYPE (gimple_assign_lhs (def)),
- gimple_assign_rhs1 (def),
- gimple_assign_rhs_code (def),
- gimple_assign_rhs2 (def),
+ return expr_expected_value_1 (TREE_TYPE (
+ gimple_assign_lhs (def_assign)),
+ gimple_assign_rhs1 (def_assign),
+ gimple_assign_rhs_code (def_assign),
+ gimple_assign_rhs2 (def_assign),
visited, predictor);
}