aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dom.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-07-02 07:37:35 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-07-02 07:37:35 +0000
commita003896684c5b8269eed6b472c2b35fe238294bc (patch)
treeda79f9f2b5d7561937a823eb7a573eb0f7aec873 /gcc/tree-ssa-dom.c
parent53ac92c3e040789d34c7aabf4f2a98709de47c17 (diff)
downloadgcc-a003896684c5b8269eed6b472c2b35fe238294bc.zip
gcc-a003896684c5b8269eed6b472c2b35fe238294bc.tar.gz
gcc-a003896684c5b8269eed6b472c2b35fe238294bc.tar.bz2
tree-ssa-dom.c (build_and_record_new_cond): Add optional parameter to record a condition that is false.
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. From-SVN: r225299
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 e45b78c..698f78a 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: