summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dom.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2015-07-02 07:37:35 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2015-07-02 07:37:35 +0000
commit1464518be776d99cf3d4dac4317ee9593d873407 (patch)
treeda79f9f2b5d7561937a823eb7a573eb0f7aec873 /gcc/tree-ssa-dom.c
parentd69a4955403cbb9cf3332b8511be5c5629335843 (diff)
downloadgcc-1464518be776d99cf3d4dac4317ee9593d873407.tar.gz
2015-07-02 Richard Biener <rguenther@suse.de>
* tree-ssa-dom.c (build_and_record_new_cond): Add optional parameter to record a condition that is false. (record_conditions): When recording an extra NE_EXPR that is true also record a EQ_EXPR that is false. * gcc.dg/tree-ssa/ssa-dom-cse-4.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225299 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r--gcc/tree-ssa-dom.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index e45b78c411a..698f78a5239 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -813,7 +813,8 @@ free_all_edge_infos (void)
static void
build_and_record_new_cond (enum tree_code code,
tree op0, tree op1,
- vec<cond_equivalence> *p)
+ vec<cond_equivalence> *p,
+ bool val = true)
{
cond_equivalence c;
struct hashable_expr *cond = &c.cond;
@@ -826,7 +827,7 @@ build_and_record_new_cond (enum tree_code code,
cond->ops.binary.opnd0 = op0;
cond->ops.binary.opnd1 = op1;
- c.value = boolean_true_node;
+ c.value = val ? boolean_true_node : boolean_false_node;
p->safe_push (c);
}
@@ -865,6 +866,8 @@ record_conditions (struct edge_info *edge_info, tree cond, tree inverted)
op0, op1, &edge_info->cond_equivalences);
build_and_record_new_cond (NE_EXPR, op0, op1,
&edge_info->cond_equivalences);
+ build_and_record_new_cond (EQ_EXPR, op0, op1,
+ &edge_info->cond_equivalences, false);
break;
case GE_EXPR: