summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-strlen.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-30 12:41:17 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-30 12:41:17 +0000
commit6c6bd1703dc3ac30d5fd007a014930bd34dfd905 (patch)
tree54be20e071ba593541b99d863786e7130f9104e0 /gcc/tree-ssa-strlen.c
parent15ff9e2f26a52378f7c3b21896bab011abcf882c (diff)
downloadgcc-6c6bd1703dc3ac30d5fd007a014930bd34dfd905.tar.gz
PR tree-optimization/58277
* tree-ssa-strlen.c (strlen_enter_block): If do_invalidate gave up after seeing too many stmts with vdef in between dombb and current bb, invalidate everything. * gcc.c-torture/execute/pr58277-1.c: New test. * gcc.c-torture/execute/pr58277-2.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202104 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-strlen.c')
-rw-r--r--gcc/tree-ssa-strlen.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index 75d27f1989b..5c21b92ec68 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -1952,6 +1952,28 @@ strlen_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
int count_vdef = 100;
do_invalidate (dombb, phi, visited, &count_vdef);
BITMAP_FREE (visited);
+ if (count_vdef == 0)
+ {
+ /* If there were too many vdefs in between immediate
+ dominator and current bb, invalidate everything.
+ If stridx_to_strinfo has been unshared, we need
+ to free it, otherwise just set it to NULL. */
+ if (!strinfo_shared ())
+ {
+ unsigned int i;
+ strinfo si;
+
+ for (i = 1;
+ vec_safe_iterate (stridx_to_strinfo, i, &si);
+ ++i)
+ {
+ free_strinfo (si);
+ (*stridx_to_strinfo)[i] = NULL;
+ }
+ }
+ else
+ stridx_to_strinfo = NULL;
+ }
break;
}
}