summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-uncprop.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-uncprop.c')
-rw-r--r--gcc/tree-ssa-uncprop.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/gcc/tree-ssa-uncprop.c b/gcc/tree-ssa-uncprop.c
index 502614a37d6..307bb1fd134 100644
--- a/gcc/tree-ssa-uncprop.c
+++ b/gcc/tree-ssa-uncprop.c
@@ -1,5 +1,5 @@
/* Routines for discovering and unpropagating edge equivalences.
- Copyright (C) 2005-2015 Free Software Foundation, Inc.
+ Copyright (C) 2005-2016 Free Software Foundation, Inc.
This file is part of GCC.
@@ -94,23 +94,26 @@ associate_equivalences_with_edges (void)
can record an equivalence for OP0 rather than COND. */
if (TREE_CODE (op0) == SSA_NAME
&& !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (op0)
- && TREE_CODE (TREE_TYPE (op0)) == BOOLEAN_TYPE
+ && ssa_name_has_boolean_range (op0)
&& is_gimple_min_invariant (op1))
{
+ tree true_val = constant_boolean_node (true, TREE_TYPE (op0));
+ tree false_val = constant_boolean_node (false,
+ TREE_TYPE (op0));
if (code == EQ_EXPR)
{
equivalency = XNEW (struct edge_equivalency);
equivalency->lhs = op0;
equivalency->rhs = (integer_zerop (op1)
- ? boolean_false_node
- : boolean_true_node);
+ ? false_val
+ : true_val);
true_edge->aux = equivalency;
equivalency = XNEW (struct edge_equivalency);
equivalency->lhs = op0;
equivalency->rhs = (integer_zerop (op1)
- ? boolean_true_node
- : boolean_false_node);
+ ? true_val
+ : false_val);
false_edge->aux = equivalency;
}
else
@@ -118,15 +121,15 @@ associate_equivalences_with_edges (void)
equivalency = XNEW (struct edge_equivalency);
equivalency->lhs = op0;
equivalency->rhs = (integer_zerop (op1)
- ? boolean_true_node
- : boolean_false_node);
+ ? true_val
+ : false_val);
true_edge->aux = equivalency;
equivalency = XNEW (struct edge_equivalency);
equivalency->lhs = op0;
equivalency->rhs = (integer_zerop (op1)
- ? boolean_false_node
- : boolean_true_node);
+ ? false_val
+ : true_val);
false_edge->aux = equivalency;
}
}