pretty-ipa merge 10: verify_eh_tree fixes

Jan Hubicka hubicka@ucw.cz
Sun Mar 29 00:07:00 GMT 2009


Hi,
this patch fixes several verify_eh_tree bugs.  It now can handle AKA
bitmaps and works correctly when fun != cfun.

Bootstrapped/regtested x86_64-linux, will commit it as obvious.
Honza

	* except.c (verify_eh_tree): Fix handling of fun!=cfun; be ready
	for removed regions.
Index: except.c
===================================================================
*** except.c	(revision 145204)
--- except.c	(working copy)
*************** verify_eh_tree (struct function *fun)
*** 3858,3880 ****
    int j;
    int depth = 0;
  
!   i = fun->eh->region_tree;
!   if (! i)
      return;
    for (j = fun->eh->last_region_number; j > 0; --j)
!     if ((i = VEC_index (eh_region, cfun->eh->region_array, j)))
        {
! 	count++;
! 	if (i->region_number != j)
  	  {
  	    error ("region_array is corrupted for region %i", i->region_number);
  	    err = true;
  	  }
        }
  
    while (1)
      {
!       if (VEC_index (eh_region, cfun->eh->region_array, i->region_number) != i)
  	{
  	  error ("region_array is corrupted for region %i", i->region_number);
  	  err = true;
--- 4178,4202 ----
    int j;
    int depth = 0;
  
!   if (! fun->eh->region_tree)
      return;
    for (j = fun->eh->last_region_number; j > 0; --j)
!     if ((i = VEC_index (eh_region, fun->eh->region_array, 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);
  	    err = true;
  	  }
        }
+   i = fun->eh->region_tree;
  
    while (1)
      {
!       if (VEC_index (eh_region, fun->eh->region_array, i->region_number) != i)
  	{
  	  error ("region_array is corrupted for region %i", i->region_number);
  	  err = true;



More information about the Gcc-patches mailing list