tree-chrec.h (evolution_function_is_constant_p): Remove redundant check.
authorRichard Biener <rguenther@suse.de>
Mon, 30 Apr 2018 10:16:11 +0000 (10:16 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 30 Apr 2018 10:16:11 +0000 (10:16 +0000)
2018-04-30  Richard Biener  <rguenther@suse.de>

* 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
gcc/tree-cfg.c
gcc/tree-chrec.h

index 11b7a83e5084289783f7c3b86e5009c0a82549a0..5edb052836a4d63ceeec884f0395bf84331c6286 100644 (file)
@@ -1,3 +1,9 @@
+2018-04-30  Richard Biener  <rguenther@suse.de>
+
+       * 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  <rguenther@suse.de>
 
        PR bootstrap/85571
index 8726a530aafcf4fa7c23b4187147d632b11338c4..19a378a7da95c87729e61eff341fa99873f132a7 100644 (file)
@@ -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;
index b2efa339af58e7e15ddfb77ffb9fc77779d7ab5a..e6e16491781a98ca59ab98ed72511f729a5b95d1 100644 (file)
@@ -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);
 }