diff options
author | Richard Guenther <rguenther@suse.de> | 2007-11-23 14:28:59 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2007-11-23 14:28:59 +0000 |
commit | 27fa4044f10f2a28e3e33b8b126462276f8fdc4f (patch) | |
tree | 48a10a4d1d5afd593e94941b3bf4da1a06912d68 /gcc/tree-ssa-sccvn.c | |
parent | bdcfbbfccba6c7f843908b7b5d1bef1acd23ccbc (diff) | |
download | gcc-27fa4044f10f2a28e3e33b8b126462276f8fdc4f.tar.gz |
re PR tree-optimization/34176 (SCCVN breaks gettext)
2007-11-23 Richard Guenther <rguenther@suse.de>
Michael Matz <matz@suse.de>
PR tree-optimization/34176
* alloc-pool.h (empty_alloc_pool): Declare.
* alloc-pool.c (empty_alloc_pool): New function.
* tree-ssa-sccvn.c (vn_reference_lookup): Also lookup from the
valid table if a lookup from the optimistic table failed.
(vn_unary_op_lookup): Likewise.
(vn_binary_op_lookup): Likewise.
(vn_phi_lookup): Likewise.
(process_scc): Clear optimistic tables before every iteration.
* gcc.c-torture/execute/pr34176.c: New testcase.
Co-Authored-By: Michael Matz <matz@suse.de>
From-SVN: r130379
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r-- | gcc/tree-ssa-sccvn.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index b4fb014b76d..8edd03b9ad7 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -655,6 +655,9 @@ vn_reference_lookup (tree op, VEC (tree, gc) *vuses) vr1.hashcode = vn_reference_compute_hash (&vr1); slot = htab_find_slot_with_hash (current_info->references, &vr1, vr1.hashcode, NO_INSERT); + if (!slot && current_info == optimistic_info) + slot = htab_find_slot_with_hash (valid_info->references, &vr1, vr1.hashcode, + NO_INSERT); if (!slot) return NULL_TREE; @@ -742,6 +745,9 @@ vn_unary_op_lookup (tree op) vuo1.hashcode = vn_unary_op_compute_hash (&vuo1); slot = htab_find_slot_with_hash (current_info->unary, &vuo1, vuo1.hashcode, NO_INSERT); + if (!slot && current_info == optimistic_info) + slot = htab_find_slot_with_hash (valid_info->unary, &vuo1, vuo1.hashcode, + NO_INSERT); if (!slot) return NULL_TREE; return ((vn_unary_op_t)*slot)->result; @@ -834,6 +840,9 @@ vn_binary_op_lookup (tree op) vbo1.hashcode = vn_binary_op_compute_hash (&vbo1); slot = htab_find_slot_with_hash (current_info->binary, &vbo1, vbo1.hashcode, NO_INSERT); + if (!slot && current_info == optimistic_info) + slot = htab_find_slot_with_hash (valid_info->binary, &vbo1, vbo1.hashcode, + NO_INSERT); if (!slot) return NULL_TREE; return ((vn_binary_op_t)*slot)->result; @@ -960,6 +969,9 @@ vn_phi_lookup (tree phi) vp1.hashcode = vn_phi_compute_hash (&vp1); slot = htab_find_slot_with_hash (current_info->phis, &vp1, vp1.hashcode, NO_INSERT); + if (!slot && current_info == optimistic_info) + slot = htab_find_slot_with_hash (valid_info->phis, &vp1, vp1.hashcode, + NO_INSERT); if (!slot) return NULL_TREE; return ((vn_phi_t)*slot)->result; @@ -1799,6 +1811,14 @@ process_scc (VEC (tree, heap) *scc) { changed = false; iterations++; + htab_empty (optimistic_info->unary); + htab_empty (optimistic_info->binary); + htab_empty (optimistic_info->phis); + htab_empty (optimistic_info->references); + empty_alloc_pool (optimistic_info->unary_op_pool); + empty_alloc_pool (optimistic_info->binary_op_pool); + empty_alloc_pool (optimistic_info->phis_pool); + empty_alloc_pool (optimistic_info->references_pool); for (i = 0; VEC_iterate (tree, scc, i, var); i++) changed |= visit_use (var); } |