aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-tail-merge.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2014-06-07 11:59:18 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2014-06-07 11:59:18 +0000
commit51d2abebc4155932e23becf6304628a8105a2c51 (patch)
treeaad08d05304a8159d0d41e15ffb5048e7c480502 /gcc/tree-ssa-tail-merge.c
parent25608e3a5fb6849e2f90207c1836359df0b79b43 (diff)
downloadgcc-51d2abebc4155932e23becf6304628a8105a2c51.zip
gcc-51d2abebc4155932e23becf6304628a8105a2c51.tar.gz
gcc-51d2abebc4155932e23becf6304628a8105a2c51.tar.bz2
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) <GIMPLE_CALL>: Compare the static chain of the call statements, if any. Tidy up. From-SVN: r211342
Diffstat (limited to 'gcc/tree-ssa-tail-merge.c')
-rw-r--r--gcc/tree-ssa-tail-merge.c21
1 files changed, 15 insertions, 6 deletions
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);