aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sccvn.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-02-07 16:58:17 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-02-07 16:58:17 +0000
commit1ec87690545eefc5c1453b225c62f5adcbbe1f49 (patch)
tree97360474f30c6761309e34c3f16854fbc0320127 /gcc/tree-ssa-sccvn.c
parentb46ae6da882b09242d230d4ec532e534c9bd1323 (diff)
downloadgcc-1ec87690545eefc5c1453b225c62f5adcbbe1f49.zip
gcc-1ec87690545eefc5c1453b225c62f5adcbbe1f49.tar.gz
gcc-1ec87690545eefc5c1453b225c62f5adcbbe1f49.tar.bz2
re PR tree-optimization/47615 (ICE: too deep recursion in phi_translate/phi_translate_1 with -ftree-pre -fno-tree-fre -fno-tree-sra)
2011-02-07 Richard Guenther <rguenther@suse.de> PR tree-optimization/47615 * tree-ssa-sccvn.h (run_scc_vn): Take a vn-walk mode argument. * tree-ssa-sccvn.c (default_vn_walk_kind): New global. (run_scc_vn): Initialize it. (visit_reference_op_load): Use it. * tree-ssa-pre.c (execute_pre): Use VN_WALK if in PRE. * g++.dg/opt/pr47615.C: New testcase. From-SVN: r169888
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r--gcc/tree-ssa-sccvn.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index e37668e..9222cb5 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -1244,6 +1244,7 @@ vn_reference_lookup_1 (vn_reference_t vr, vn_reference_t *vnresult)
static tree *last_vuse_ptr;
static vn_lookup_kind vn_walk_kind;
+static vn_lookup_kind default_vn_walk_kind;
/* Callback for walk_non_aliased_vuses. Adjusts the vn_reference_t VR_
with the current VUSE and performs the expression lookup. */
@@ -2261,14 +2262,15 @@ visit_reference_op_load (tree lhs, tree op, gimple stmt)
last_vuse = gimple_vuse (stmt);
last_vuse_ptr = &last_vuse;
- result = vn_reference_lookup (op, gimple_vuse (stmt), VN_WALKREWRITE, NULL);
+ result = vn_reference_lookup (op, gimple_vuse (stmt),
+ default_vn_walk_kind, NULL);
last_vuse_ptr = NULL;
/* If we have a VCE, try looking up its operand as it might be stored in
a different type. */
if (!result && TREE_CODE (op) == VIEW_CONVERT_EXPR)
result = vn_reference_lookup (TREE_OPERAND (op, 0), gimple_vuse (stmt),
- VN_WALKREWRITE, NULL);
+ default_vn_walk_kind, NULL);
/* We handle type-punning through unions by value-numbering based
on offset and size of the access. Be prepared to handle a
@@ -3463,15 +3465,18 @@ set_hashtable_value_ids (void)
}
/* Do SCCVN. Returns true if it finished, false if we bailed out
- due to resource constraints. */
+ due to resource constraints. DEFAULT_VN_WALK_KIND_ specifies
+ how we use the alias oracle walking during the VN process. */
bool
-run_scc_vn (void)
+run_scc_vn (vn_lookup_kind default_vn_walk_kind_)
{
size_t i;
tree param;
bool changed = true;
+ default_vn_walk_kind = default_vn_walk_kind_;
+
init_scc_vn ();
current_info = valid_info;