diff options
author | Richard Guenther <rguenther@suse.de> | 2005-12-18 22:20:31 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2005-12-18 22:20:31 +0000 |
commit | 04743a370f720221d93f28807ec3349a6faf21ac (patch) | |
tree | e745e65511f8d0afe36387f1e609e401ff896981 /gcc/tree-ssa-structalias.c | |
parent | 15ed7b52cb0be60cd8f845648a265b2cffe4f963 (diff) | |
download | gcc-04743a370f720221d93f28807ec3349a6faf21ac.zip gcc-04743a370f720221d93f28807ec3349a6faf21ac.tar.gz gcc-04743a370f720221d93f28807ec3349a6faf21ac.tar.bz2 |
re PR tree-optimization/25481 (Segfault in tree-ssa-structalias.c)
2005-12-18 Richard Guenther <rguenther@suse.de>
PR tree-optimization/25481
* tree-ssa-structalias.c (handle_ptr_arith): Handle
accesses we don't have a varinfo for.
* gcc.dg/torture/pr25481.c: New testcase.
From-SVN: r108763
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index cf30759..b4251d6 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -3184,9 +3184,13 @@ handle_ptr_arith (VEC (ce_s, heap) *lhsc, tree expr) if (c2->type == ADDRESSOF && rhsoffset != 0) { varinfo_t temp = get_varinfo (c2->var); - - gcc_assert (first_vi_for_offset (temp, rhsoffset) != NULL); - c2->var = first_vi_for_offset (temp, rhsoffset)->id; + + /* An access one after the end of an array is valid, + so simply punt on accesses we cannot resolve. */ + temp = first_vi_for_offset (temp, rhsoffset); + if (temp == NULL) + continue; + c2->var = temp->id; c2->offset = 0; } else |