diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-05-25 15:18:21 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-05-25 15:18:21 +0000 |
commit | d8021dea8c5ab8c689c7d60a28d4e2778c2996cb (patch) | |
tree | 870d4d98bd4ce2f44cd8355355fe3b936ee09108 /gcc/tree-ssa-alias.c | |
parent | 85d1c108d2214b4b329c1894066429a54ca9f6aa (diff) | |
download | gcc-d8021dea8c5ab8c689c7d60a28d4e2778c2996cb.tar.gz |
2009-05-25 Richard Guenther <rguenther@suse.de>
PR tree-optimization/36327
* tree-ssa-alias.c (walk_non_aliased_vuses): Add second walker
callback for reference translation or lookup at the point
of may-defs.
* tree-ssa-alias.h (walk_non_aliased_vuses): Adjust prototype.
* tree-ssa-sccvn.c (get_ref_from_reference_ops): Bail out
for union COMPONENT_REFs.
(vn_reference_lookup_3): New callback. Lookup from memset
and CONSTRUCTOR assignment, translate through struct copies.
(vn_reference_lookup_pieces): Make sure to not free the
passed operands array. Adjust walk_non_aliased_vuses call.
(vn_reference_lookup): Adjust walk_non_aliased_vuses call,
make sure we do not leak memory.
* gcc.dg/tree-ssa/ssa-fre-24.c: New testcase.
* gcc.dg/tree-ssa/ssa-fre-25.c: Likewise.
* gcc.dg/tree-ssa/sra-2.c: Disable FRE.
* gcc.dg/vect/no-vfa-vect-43.c: Adjust.
* gcc.dg/vect/vect-40.c: Likewise.
* gcc.dg/vect/vect-42.c: Likewise.
* gcc.dg/vect/vect-46.c: Likewise.
* gcc.dg/vect/vect-76.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147851 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 5be39f00398..5bb1f82ad9b 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -1086,11 +1086,19 @@ get_continuation_for_phi (gimple phi, tree ref, bitmap *visited) WALKER returns non-NULL the walk stops and its result is returned. At the end of a non-successful walk NULL is returned. + TRANSLATE if non-NULL is called with a pointer to REF, the virtual + use which definition is a statement that may clobber REF and DATA. + If TRANSLATE returns (void *)-1 the walk stops and NULL is returned. + If TRANSLATE returns non-NULL the walk stops and its result is returned. + If TRANSLATE returns NULL the walk continues and TRANSLATE is supposed + to adjust REF and *DATA to make that valid. + TODO: Cache the vector of equivalent vuses per ref, vuse pair. */ void * walk_non_aliased_vuses (tree ref, tree vuse, - void *(*walker)(tree, tree, void *), void *data) + void *(*walker)(tree, tree, void *), + void *(*translate)(tree *, tree, void *),void *data) { bitmap visited = NULL; void *res; @@ -1114,7 +1122,21 @@ walk_non_aliased_vuses (tree ref, tree vuse, else { if (stmt_may_clobber_ref_p (def_stmt, ref)) - break; + { + if (!translate) + break; + res = (*translate) (&ref, vuse, data); + /* Failed lookup and translation. */ + if (res == (void *)-1) + { + res = NULL; + break; + } + /* Lookup succeeded. */ + else if (res != NULL) + break; + /* Translation succeeded, continue walking. */ + } vuse = gimple_vuse (def_stmt); } } |