+2018-08-02 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/86816
+ * tree-ssa-tail-merge.c (tail_merge_valueize): New function
+ which checks for value availability before querying it.
+ (gvn_uses_equal): Use it.
+ (same_succ_hash): Likewise.
+ (gimple_equal_p): Likewise.
+
2018-08-02 Nick Clifton <nickc@redhat.com>
PR target/86789
+2018-08-02 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/86816
+ * g++.dg/torture/pr86816.C: New testcase.
+
2018-08-02 Richard Sandiford <richard.sandiford@arm.com>
* gcc.target/aarch64/f16_mov_immediate_1.c: Expect fmov immediate
#define BB_VOP_AT_EXIT(bb) (((struct aux_bb_info *)bb->aux)->vop_at_exit)
#define BB_DEP_BB(bb) (((struct aux_bb_info *)bb->aux)->dep_bb)
+/* Valueization helper querying the VN lattice. */
+
+static tree
+tail_merge_valueize (tree name)
+{
+ if (TREE_CODE (name) == SSA_NAME
+ && has_VN_INFO (name))
+ {
+ tree tem = VN_INFO (name)->valnum;
+ if (tem != VN_TOP)
+ return tem;
+ }
+ return name;
+}
+
/* Returns true if the only effect a statement STMT has, is to define locally
used SSA_NAMEs. */
if (val1 == val2)
return true;
- if (vn_valueize (val1) != vn_valueize (val2))
+ if (tail_merge_valueize (val1) != tail_merge_valueize (val2))
return false;
return ((TREE_CODE (val1) == SSA_NAME || CONSTANT_CLASS_P (val1))
for (i = 0; i < gimple_call_num_args (stmt); i++)
{
arg = gimple_call_arg (stmt, i);
- arg = vn_valueize (arg);
+ arg = tail_merge_valueize (arg);
inchash::add_expr (arg, hstate);
}
}
if (lhs1 == NULL_TREE || lhs2 == NULL_TREE)
return false;
if (TREE_CODE (lhs1) == SSA_NAME && TREE_CODE (lhs2) == SSA_NAME)
- return vn_valueize (lhs1) == vn_valueize (lhs2);
+ return tail_merge_valueize (lhs1) == tail_merge_valueize (lhs2);
return operand_equal_p (lhs1, lhs2, 0);
case GIMPLE_ASSIGN: