Commit 04743a37 by Richard Guenther Committed by Richard Biener

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
parent 15ed7b52
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.
2005-12-17 Jon Grimm <jgrimm2@us.ibm.com> 2005-12-17 Jon Grimm <jgrimm2@us.ibm.com>
Janis Johnson <janis187@us.ibm.com> Janis Johnson <janis187@us.ibm.com>
Ben Elliston <bje@au.ibm.com> Ben Elliston <bje@au.ibm.com>
......
2005-12-18 Richard Guenther <rguenther@suse.de>
PR tree-optimization/25481
* gcc.dg/torture/pr25481.c: New testcase.
2005-12-18 Ulrich Weigand <uweigand@de.ibm.com> 2005-12-18 Ulrich Weigand <uweigand@de.ibm.com>
PR rtl-optimization/21041 PR rtl-optimization/21041
/* { dg-do compile } */
struct s {
int *blah;
};
static struct s array[] = {
{ 0 }
};
void
foo (struct s *p)
{
unsigned int n = 1;
struct s *q = &array[n];
while (p < q)
p++;
}
...@@ -3184,9 +3184,13 @@ handle_ptr_arith (VEC (ce_s, heap) *lhsc, tree expr) ...@@ -3184,9 +3184,13 @@ handle_ptr_arith (VEC (ce_s, heap) *lhsc, tree expr)
if (c2->type == ADDRESSOF && rhsoffset != 0) if (c2->type == ADDRESSOF && rhsoffset != 0)
{ {
varinfo_t temp = get_varinfo (c2->var); varinfo_t temp = get_varinfo (c2->var);
gcc_assert (first_vi_for_offset (temp, rhsoffset) != NULL); /* An access one after the end of an array is valid,
c2->var = first_vi_for_offset (temp, rhsoffset)->id; 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; c2->offset = 0;
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment