diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-03 12:20:28 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-03 12:20:28 +0000 |
commit | 726308b5517a327b7084a942e9febfea63f942fd (patch) | |
tree | dd6ceff8e833ad9425c409f0ba7747c4569b0689 /gcc/tree-ssa-structalias.c | |
parent | 1e05186137cab6a35dc39f9cc4091fc58010efa1 (diff) | |
download | gcc-726308b5517a327b7084a942e9febfea63f942fd.tar.gz |
2010-11-03 Richard Guenther <rguenther@suse.de>
PR tree-optimization/46286
* tree-ssa-structalias.c (get_constraint_for_1): Avoid referencing
re-allocated vector data.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166241 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 315bef6f0da..45efd55b755 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -3339,7 +3339,7 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p, { case MEM_REF: { - struct constraint_expr *c; + struct constraint_expr cs; varinfo_t vi, curr; tree off = double_int_to_tree (sizetype, mem_ref_offset (t)); get_constraint_for_ptr_offset (TREE_OPERAND (t, 0), off, results); @@ -3347,12 +3347,12 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p, /* If we are not taking the address then make sure to process all subvariables we might access. */ - c = VEC_last (ce_s, *results); + cs = *VEC_last (ce_s, *results); if (address_p - || c->type != SCALAR) + || cs.type != SCALAR) return; - vi = get_varinfo (c->var); + vi = get_varinfo (cs.var); curr = vi->next; if (!vi->is_full_var && curr) @@ -3366,7 +3366,6 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p, { if (curr->offset - vi->offset < size) { - struct constraint_expr cs = *c; cs.var = curr->id; VEC_safe_push (ce_s, heap, *results, &cs); } |