From 5885f02733f9bab7e9508bfebbeed5b3c9254aaa Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 30 Apr 2018 10:16:11 +0000 Subject: [PATCH] tree-chrec.h (evolution_function_is_constant_p): Remove redundant check. 2018-04-30 Richard Biener * tree-chrec.h (evolution_function_is_constant_p): Remove redundant check. * tree-cfg.c (tree_node_can_be_shared): Re-order checks. From-SVN: r259756 --- gcc/ChangeLog | 6 ++++++ gcc/tree-cfg.c | 11 ++++------- gcc/tree-chrec.h | 2 -- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 11b7a83e508..5edb052836a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-04-30 Richard Biener + + * tree-chrec.h (evolution_function_is_constant_p): Remove + redundant check. + * tree-cfg.c (tree_node_can_be_shared): Re-order checks. + 2018-04-30 Richard Biener PR bootstrap/85571 diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 8726a530aaf..19a378a7da9 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -5212,16 +5212,13 @@ static bool tree_node_can_be_shared (tree t) { if (IS_TYPE_OR_DECL_P (t) - || is_gimple_min_invariant (t) || TREE_CODE (t) == SSA_NAME - || t == error_mark_node - || TREE_CODE (t) == IDENTIFIER_NODE) + || TREE_CODE (t) == IDENTIFIER_NODE + || TREE_CODE (t) == CASE_LABEL_EXPR + || is_gimple_min_invariant (t)) return true; - if (TREE_CODE (t) == CASE_LABEL_EXPR) - return true; - - if (DECL_P (t)) + if (t == error_mark_node) return true; return false; diff --git a/gcc/tree-chrec.h b/gcc/tree-chrec.h index b2efa339af5..e6e16491781 100644 --- a/gcc/tree-chrec.h +++ b/gcc/tree-chrec.h @@ -170,8 +170,6 @@ evolution_function_is_constant_p (const_tree chrec) if (chrec == NULL_TREE) return false; - if (CONSTANT_CLASS_P (chrec)) - return true; return is_gimple_min_invariant (chrec); } -- 2.30.2