Patch to dwarf2out.c:scope_die_for

Jason Merrill jason@cygnus.com
Thu Feb 25 21:25:00 GMT 1999


This broke if we got called to emit the info for a nested type while in a
member function; the logical scope of the function doesn't match the actual
DIE nesting, so we failed.  In that situation, the right thing to do is to
stick the nested type at file scope, so just do it.  Applied.

Thu Feb 25 21:23:06 1999  Jason Merrill  <jason@yorick.cygnus.com>

	* dwarf2out.c (scope_die_for): Set scope_die to comp_unit_die
	rather than asserting it.

Index: dwarf2out.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/dwarf2out.c,v
retrieving revision 1.85
diff -c -p -r1.85 dwarf2out.c
*** dwarf2out.c	1999/02/24 17:48:42	1.85
--- dwarf2out.c	1999/02/26 05:23:02
*************** scope_die_for (t, context_die)
*** 7682,7693 ****
  
        if (i < 0)
  	{
! 	  if (scope_die != comp_unit_die
! 	      || TREE_CODE_CLASS (TREE_CODE (containing_scope)) != 't')
  	    abort ();
  	  if (debug_info_level > DINFO_LEVEL_TERSE
  	      && !TREE_ASM_WRITTEN (containing_scope))
  	    abort ();
  	}
      }
  
--- 7682,7695 ----
  
        if (i < 0)
  	{
! 	  if (TREE_CODE_CLASS (TREE_CODE (containing_scope)) != 't')
  	    abort ();
  	  if (debug_info_level > DINFO_LEVEL_TERSE
  	      && !TREE_ASM_WRITTEN (containing_scope))
  	    abort ();
+ 
+ 	  /* If none of the current dies are suitable, we get file scope.  */
+ 	  scope_die = comp_unit_die;
  	}
      }
  


More information about the Gcc-patches mailing list