except.c (verify_eh_tree): Fix handling of fun!=cfun; be ready for removed regions.

* except.c (verify_eh_tree): Fix handling of fun!=cfun; be ready
	for removed regions.

From-SVN: r145232
This commit is contained in:
Jan Hubicka 2009-03-29 15:20:20 +02:00 committed by Jan Hubicka
parent 13a9fa4483
commit 98f358e55f
2 changed files with 44 additions and 34 deletions

View File

@ -1,3 +1,8 @@
2009-03-29 Jan Hubicka <jh@suse.cz>
* except.c (verify_eh_tree): Fix handling of fun!=cfun; be ready
for removed regions.
2009-03-29 Jan Hubicka <jh@suse.cz> 2009-03-29 Jan Hubicka <jh@suse.cz>
* except.c (dump_eh_tree): Dump all datastructures. * except.c (dump_eh_tree): Dump all datastructures.

View File

@ -3968,23 +3968,25 @@ verify_eh_tree (struct function *fun)
int j; int j;
int depth = 0; int depth = 0;
i = fun->eh->region_tree; if (!fun->eh->region_tree)
if (! i)
return; return;
for (j = fun->eh->last_region_number; j > 0; --j) for (j = fun->eh->last_region_number; j > 0; --j)
if ((i = VEC_index (eh_region, cfun->eh->region_array, j))) if ((i = VEC_index (eh_region, fun->eh->region_array, j)))
{ {
count++; if (i->region_number == j)
if (i->region_number != j) count++;
if (i->region_number != j && (!i->aka || !bitmap_bit_p (i->aka, j)))
{ {
error ("region_array is corrupted for region %i", i->region_number); error ("region_array is corrupted for region %i",
i->region_number);
err = true; err = true;
} }
} }
i = fun->eh->region_tree;
while (1) while (1)
{ {
if (VEC_index (eh_region, cfun->eh->region_array, i->region_number) != i) if (VEC_index (eh_region, fun->eh->region_array, i->region_number) != i)
{ {
error ("region_array is corrupted for region %i", i->region_number); error ("region_array is corrupted for region %i", i->region_number);
err = true; err = true;
@ -3996,8 +3998,9 @@ verify_eh_tree (struct function *fun)
} }
if (i->may_contain_throw && outer && !outer->may_contain_throw) if (i->may_contain_throw && outer && !outer->may_contain_throw)
{ {
error ("region %i may contain throw and is contained in region that may not", error
i->region_number); ("region %i may contain throw and is contained in region that may not",
i->region_number);
err = true; err = true;
} }
if (depth < 0) if (depth < 0)
@ -4005,7 +4008,7 @@ verify_eh_tree (struct function *fun)
error ("negative nesting depth of region %i", i->region_number); error ("negative nesting depth of region %i", i->region_number);
err = true; err = true;
} }
nvisited ++; nvisited++;
/* If there are sub-regions, process them. */ /* If there are sub-regions, process them. */
if (i->inner) if (i->inner)
outer = i, i = i->inner, depth++; outer = i, i = i->inner, depth++;
@ -4015,30 +4018,32 @@ verify_eh_tree (struct function *fun)
/* Otherwise, step back up the tree to the next peer. */ /* Otherwise, step back up the tree to the next peer. */
else else
{ {
do { do
i = i->outer; {
depth--; i = i->outer;
if (i == NULL) depth--;
{ if (i == NULL)
if (depth != -1) {
{ if (depth != -1)
error ("tree list ends on depth %i", depth + 1); {
err = true; error ("tree list ends on depth %i", depth + 1);
} err = true;
if (count != nvisited) }
{ if (count != nvisited)
error ("array does not match the region tree"); {
err = true; error ("array does not match the region tree");
} err = true;
if (err) }
{ if (err)
dump_eh_tree (stderr, fun); {
internal_error ("verify_eh_tree failed"); dump_eh_tree (stderr, fun);
} internal_error ("verify_eh_tree failed");
return; }
} return;
outer = i->outer; }
} while (i->next_peer == NULL); outer = i->outer;
}
while (i->next_peer == NULL);
i = i->next_peer; i = i->next_peer;
} }
} }