+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.
+
2015-07-02 Bin Cheng <bin.cheng@arm.com>
* tree-ssa-loop-ivopts.c (struct ivopts_data): New field iv_obstack.
+2015-07-02 Richard Biener <rguenther@suse.de>
+
+ * gcc.dg/tree-ssa/ssa-dom-cse-4.c: New testcase.
+
2015-07-01 H.J. Lu <hongjiu.lu@intel.com>
* gcc.target/i386/mpx/pr66568.c (exit): New prototype.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+extern void abort (void);
+
+unsigned int
+foo (unsigned int x, unsigned int y)
+{
+ unsigned int z;
+
+ if (x >= y)
+ return 1;
+
+ if (y == x)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-not "abort" "optimized" } } */
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;
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);
}
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: