+017-03-27 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/80162
+ * tree-ssa-dom.c (derive_equivalences_from_bit_ior): Fix typo in
+ function name. Limit recursion depth.
+ (record_temporary_equivalences): Corresponding changes.
+
2017-03-27 Jonathan Wakely <jwakely@redhat.com>
* doc/invoke.texi (-Wno-narrowing): Reorder so default behavior is
}
/* Record NAME has the value zero and if NAME was set from a BIT_IOR_EXPR
- recurse into both operands recording their values as zero too. */
+ recurse into both operands recording their values as zero too.
+ RECURSION_DEPTH controls how far back we recurse through the operands
+ of the BIT_IOR_EXPR. */
static void
-derive_equivalencs_from_bit_ior (tree name, const_and_copies *const_and_copies)
+derive_equivalences_from_bit_ior (tree name,
+ const_and_copies *const_and_copies,
+ int recursion_limit)
{
+ if (recursion_limit == 0)
+ return;
+
if (TREE_CODE (name) == SSA_NAME)
{
tree value = fold_convert (TREE_TYPE (name), integer_zero_node);
if (is_gimple_assign (def_stmt)
&& gimple_assign_rhs_code (def_stmt) == BIT_IOR_EXPR)
{
- derive_equivalencs_from_bit_ior (gimple_assign_rhs1 (def_stmt),
- const_and_copies);
- derive_equivalencs_from_bit_ior (gimple_assign_rhs2 (def_stmt),
- const_and_copies);
+ derive_equivalences_from_bit_ior (gimple_assign_rhs1 (def_stmt),
+ const_and_copies,
+ recursion_limit - 1);
+ derive_equivalences_from_bit_ior (gimple_assign_rhs2 (def_stmt),
+ const_and_copies,
+ recursion_limit - 1);
}
}
}
enum tree_code code = eq->cond.ops.binary.op;
if ((code == EQ_EXPR && eq->value == boolean_true_node)
|| (code == NE_EXPR && eq->value == boolean_false_node))
- derive_equivalencs_from_bit_ior (op0, const_and_copies);
+ derive_equivalences_from_bit_ior (op0, const_and_copies, 4);
/* TODO: We could handle BIT_AND_EXPR in a similar fashion
recording that the operands have a nonzero value. */