diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-17 10:38:38 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-17 10:38:38 +0000 |
commit | 87af2d007d4270d3bdec1de8bcd22fac1d191fcd (patch) | |
tree | f7c316bdd47a7c81826047b8a1a4be5dcd48454f /gcc/tree-ssa-tail-merge.c | |
parent | 1b174c023e91ad50589d2a036a4db34a964eada9 (diff) | |
download | gcc-87af2d007d4270d3bdec1de8bcd22fac1d191fcd.tar.gz |
PR tree-optimization/51877
* tree-ssa-tail-merge.c (gimple_equal_p): Don't return true whenever
call arguments and fndecls compare equal, instead return false if they
don't. Return true only if lhs1 and lhs2 are either both NULL, or
both SSA_NAMEs that are valueized the same, or they satisfy
operand_equal_p.
* gcc.c-torture/execute/pr51877.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183237 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-tail-merge.c')
-rw-r--r-- | gcc/tree-ssa-tail-merge.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c index 7452266af2b..47dc0a6ffc8 100644 --- a/gcc/tree-ssa-tail-merge.c +++ b/gcc/tree-ssa-tail-merge.c @@ -1,5 +1,5 @@ /* Tail merging for gimple. - Copyright (C) 2011 Free Software Foundation, Inc. + Copyright (C) 2011, 2012 Free Software Foundation, Inc. Contributed by Tom de Vries (tom@codesourcery.com) This file is part of GCC. @@ -1071,14 +1071,18 @@ gimple_equal_p (same_succ same_succ, gimple s1, gimple s2) equal = false; break; } - if (equal) - return true; + if (!equal) + return false; lhs1 = gimple_get_lhs (s1); lhs2 = gimple_get_lhs (s2); - return (lhs1 != NULL_TREE && lhs2 != NULL_TREE - && TREE_CODE (lhs1) == SSA_NAME && TREE_CODE (lhs2) == SSA_NAME - && vn_valueize (lhs1) == vn_valueize (lhs2)); + if (lhs1 == NULL_TREE && lhs2 == NULL_TREE) + return true; + 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 operand_equal_p (lhs1, lhs2, 0); case GIMPLE_ASSIGN: lhs1 = gimple_get_lhs (s1); |