aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sccvn.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-04-15 13:28:08 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-04-15 13:28:08 +0000
commit649caaad399d6f4865a4d0015a1ac76c3cce7eb0 (patch)
tree9098d5ac54a9f0a83f6c1809c9d7cb33b7f481de /gcc/tree-ssa-sccvn.c
parent462c31ef75b495fd95f18a91864c471d2cb76494 (diff)
downloadgcc-649caaad399d6f4865a4d0015a1ac76c3cce7eb0.zip
gcc-649caaad399d6f4865a4d0015a1ac76c3cce7eb0.tar.gz
gcc-649caaad399d6f4865a4d0015a1ac76c3cce7eb0.tar.bz2
tree-ssa-sccvn.h (vn_reference_lookup): Adjust prototype.
2008-04-15 Richard Guenther <rguenther@suse.de> * tree-ssa-sccvn.h (vn_reference_lookup): Adjust prototype. * tree-ssa-sccvn.c (vn_reference_lookup): New parameter maywalk. (visit_reference_op_load): Do walk vuse-vdef chains on vn_reference_lookup. (visit_reference_op_store): But do not here. * tree-vn.c (vn_lookup): Do not walk vuse-vdef chains on vn_reference_lookup. (vn_lookup_with_vuses): But do so here. From-SVN: r134314
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r--gcc/tree-ssa-sccvn.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index b613b2b..849eade 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -735,7 +735,7 @@ vn_reference_lookup_1 (vn_reference_t vr)
it does not exist in the hash table. */
tree
-vn_reference_lookup (tree op, VEC (tree, gc) *vuses)
+vn_reference_lookup (tree op, VEC (tree, gc) *vuses, bool maywalk)
{
struct vn_reference_s vr1;
tree result, def_stmt;
@@ -748,6 +748,7 @@ vn_reference_lookup (tree op, VEC (tree, gc) *vuses)
/* If there is a single defining statement for all virtual uses, we can
use that, following virtual use-def chains. */
if (!result
+ && maywalk
&& vr1.vuses
&& VEC_length (tree, vr1.vuses) >= 1
&& !get_call_expr_in (op)
@@ -1188,7 +1189,7 @@ static bool
visit_reference_op_load (tree lhs, tree op, tree stmt)
{
bool changed = false;
- tree result = vn_reference_lookup (op, shared_vuses_from_stmt (stmt));
+ tree result = vn_reference_lookup (op, shared_vuses_from_stmt (stmt), true);
/* We handle type-punning through unions by value-numbering based
on offset and size of the access. Be prepared to handle a
@@ -1294,7 +1295,7 @@ visit_reference_op_store (tree lhs, tree op, tree stmt)
Otherwise, the vdefs for the store are used when inserting into
the table, since the store generates a new memory state. */
- result = vn_reference_lookup (lhs, shared_vuses_from_stmt (stmt));
+ result = vn_reference_lookup (lhs, shared_vuses_from_stmt (stmt), false);
if (result)
{