From 51d2abebc4155932e23becf6304628a8105a2c51 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Sat, 7 Jun 2014 11:59:18 +0000 Subject: tree-ssa-tail-merge.c (same_succ_hash): Hash the static chain of a call statement, if any. * tree-ssa-tail-merge.c (same_succ_hash): Hash the static chain of a call statement, if any. (gimple_equal_p) : Compare the static chain of the call statements, if any. Tidy up. From-SVN: r211342 --- gcc/tree-ssa-tail-merge.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'gcc/tree-ssa-tail-merge.c') diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c index 20fbebf..65b5a4e 100644 --- a/gcc/tree-ssa-tail-merge.c +++ b/gcc/tree-ssa-tail-merge.c @@ -481,7 +481,11 @@ same_succ_hash (const_same_succ e) hashval = iterative_hash_hashval_t ((hashval_t) gimple_call_internal_fn (stmt), hashval); else - hashval = iterative_hash_expr (gimple_call_fn (stmt), hashval); + { + hashval = iterative_hash_expr (gimple_call_fn (stmt), hashval); + if (gimple_call_chain (stmt)) + hashval = iterative_hash_expr (gimple_call_chain (stmt), hashval); + } for (i = 0; i < gimple_call_num_args (stmt); i++) { arg = gimple_call_arg (stmt, i); @@ -1121,18 +1125,23 @@ gimple_equal_p (same_succ same_succ, gimple s1, gimple s2) switch (gimple_code (s1)) { case GIMPLE_CALL: - if (gimple_call_num_args (s1) != gimple_call_num_args (s2)) - return false; if (!gimple_call_same_target_p (s1, s2)) return false; + t1 = gimple_call_chain (s1); + t2 = gimple_call_chain (s2); + if (!gimple_operand_equal_value_p (t1, t2)) + return false; + + if (gimple_call_num_args (s1) != gimple_call_num_args (s2)) + return false; + for (i = 0; i < gimple_call_num_args (s1); ++i) { t1 = gimple_call_arg (s1, i); t2 = gimple_call_arg (s2, i); - if (gimple_operand_equal_value_p (t1, t2)) - continue; - return false; + if (!gimple_operand_equal_value_p (t1, t2)) + return false; } lhs1 = gimple_get_lhs (s1); -- cgit v1.1