PATCH: Fix outstanding dwarf2-related PCH issues exposed by [...].dg

Loren James Rittle rittle@latour.rsch.comm.mot.com
Tue Apr 22 21:56:00 GMT 2003


(I only did the final tweaking/testing on *-unknown-freebsd[45]*; also
 tested on sparc-sun-solaris2.9 with --with-dwarf2 configuration by
 Andreas Tobler.  Fixes various PCH-related testsuite failures.)

Geoff, approved to commit (basically) your patch to mainline? ;-)

2003-04-22  Geoffrey Keating  <geoffk@apple.com>
	    [Loren J. Rittle  <ljrittle@acm.org>]

	* dwarf2out.c (fde_table_allocated): Mark with GTY.
	(decl_die_table_allocated): Likewise.
	(abbrev_die_table_allocated): Likewise.
	(line_info_table_allocated): Likewise.
	(separate_line_info_table_allocated): Likewise.
	(pubname_table_allocated): Likewise.
	(arange_table_allocated): Likewise.
	(ranges_table_allocated): Likewise.
	(decl_die_table_in_use): Unconditionalize; mark with GTY.
	(abbrev_die_table_in_use): Likewise.
	(line_info_table_in_use): Likewise.
	(separate_line_info_table_in_use): Likewise.
	(pubname_table_in_use): Likewise.
	(arange_table_in_use): Likewise.
	(ranges_table_in_use): Likewise.
	(have_location_lists): Likewise.
	(emitcount): New GTY-marked static, moved...
	(maybe_emit_file): ...from here.
	(label_num): New GTY-marked static, moved...
	(gen_internal_sym): ...from here.

Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.421
diff -c -r1.421 dwarf2out.c
*** dwarf2out.c	21 Apr 2003 20:39:04 -0000	1.421
--- dwarf2out.c	22 Apr 2003 21:30:17 -0000
***************
*** 289,295 ****
  static GTY((length ("fde_table_allocated"))) dw_fde_ref fde_table;
  
  /* Number of elements currently allocated for fde_table.  */
! static unsigned fde_table_allocated;
  
  /* Number of elements in fde_table currently in use.  */
  static GTY(()) unsigned fde_table_in_use;
--- 289,295 ----
  static GTY((length ("fde_table_allocated"))) dw_fde_ref fde_table;
  
  /* Number of elements currently allocated for fde_table.  */
! static GTY(()) unsigned fde_table_allocated;
  
  /* Number of elements in fde_table currently in use.  */
  static GTY(()) unsigned fde_table_in_use;
***************
*** 3485,3496 ****
  static GTY((length ("decl_die_table_allocated"))) dw_die_ref *decl_die_table;
  
  /* Number of elements currently allocated for the decl_die_table.  */
! static unsigned decl_die_table_allocated;
  
- #ifdef DWARF2_DEBUGGING_INFO
  /* Number of elements in decl_die_table currently in use.  */
! static unsigned decl_die_table_in_use;
! #endif
  
  /* Size (in elements) of increments by which we may expand the
     decl_die_table.  */
--- 3485,3494 ----
  static GTY((length ("decl_die_table_allocated"))) dw_die_ref *decl_die_table;
  
  /* Number of elements currently allocated for the decl_die_table.  */
! static GTY(()) unsigned decl_die_table_allocated;
  
  /* Number of elements in decl_die_table currently in use.  */
! static GTY(()) unsigned decl_die_table_in_use;
  
  /* Size (in elements) of increments by which we may expand the
     decl_die_table.  */
***************
*** 3503,3514 ****
    dw_die_ref *abbrev_die_table;
  
  /* Number of elements currently allocated for abbrev_die_table.  */
! static unsigned abbrev_die_table_allocated;
  
- #ifdef DWARF2_DEBUGGING_INFO
  /* Number of elements in type_die_table currently in use.  */
! static unsigned abbrev_die_table_in_use;
! #endif
  
  /* Size (in elements) of increments by which we may expand the
     abbrev_die_table.  */
--- 3501,3510 ----
    dw_die_ref *abbrev_die_table;
  
  /* Number of elements currently allocated for abbrev_die_table.  */
! static GTY(()) unsigned abbrev_die_table_allocated;
  
  /* Number of elements in type_die_table currently in use.  */
! static GTY(()) unsigned abbrev_die_table_in_use;
  
  /* Size (in elements) of increments by which we may expand the
     abbrev_die_table.  */
***************
*** 3520,3531 ****
       dw_line_info_ref line_info_table;
  
  /* Number of elements currently allocated for line_info_table.  */
! static unsigned line_info_table_allocated;
  
- #ifdef DWARF2_DEBUGGING_INFO
  /* Number of elements in line_info_table currently in use.  */
! static unsigned line_info_table_in_use;
! #endif
  
  /* A pointer to the base of a table that contains line information
     for each source code line outside of .text in the compilation unit.  */
--- 3516,3525 ----
       dw_line_info_ref line_info_table;
  
  /* Number of elements currently allocated for line_info_table.  */
! static GTY(()) unsigned line_info_table_allocated;
  
  /* Number of elements in line_info_table currently in use.  */
! static GTY(()) unsigned line_info_table_in_use;
  
  /* A pointer to the base of a table that contains line information
     for each source code line outside of .text in the compilation unit.  */
***************
*** 3533,3544 ****
       dw_separate_line_info_ref separate_line_info_table;
  
  /* Number of elements currently allocated for separate_line_info_table.  */
! static unsigned separate_line_info_table_allocated;
  
- #ifdef DWARF2_DEBUGGING_INFO
  /* Number of elements in separate_line_info_table currently in use.  */
! static unsigned separate_line_info_table_in_use;
! #endif
  
  /* Size (in elements) of increments by which we may expand the
     line_info_table.  */
--- 3527,3536 ----
       dw_separate_line_info_ref separate_line_info_table;
  
  /* Number of elements currently allocated for separate_line_info_table.  */
! static GTY(()) unsigned separate_line_info_table_allocated;
  
  /* Number of elements in separate_line_info_table currently in use.  */
! static GTY(()) unsigned separate_line_info_table_in_use;
  
  /* Size (in elements) of increments by which we may expand the
     line_info_table.  */
***************
*** 3549,3560 ****
  static GTY ((length ("pubname_table_allocated"))) pubname_ref pubname_table;
  
  /* Number of elements currently allocated for pubname_table.  */
! static unsigned pubname_table_allocated;
  
- #ifdef DWARF2_DEBUGGING_INFO
  /* Number of elements in pubname_table currently in use.  */
! static unsigned pubname_table_in_use;
! #endif
  
  /* Size (in elements) of increments by which we may expand the
     pubname_table.  */
--- 3541,3550 ----
  static GTY ((length ("pubname_table_allocated"))) pubname_ref pubname_table;
  
  /* Number of elements currently allocated for pubname_table.  */
! static GTY(()) unsigned pubname_table_allocated;
  
  /* Number of elements in pubname_table currently in use.  */
! static GTY(()) unsigned pubname_table_in_use;
  
  /* Size (in elements) of increments by which we may expand the
     pubname_table.  */
***************
*** 3564,3575 ****
  static GTY((length ("arange_table_allocated"))) dw_die_ref *arange_table;
  
  /* Number of elements currently allocated for arange_table.  */
! static unsigned arange_table_allocated;
  
- #ifdef DWARF2_DEBUGGING_INFO
  /* Number of elements in arange_table currently in use.  */
! static unsigned arange_table_in_use;
! #endif
  
  /* Size (in elements) of increments by which we may expand the
     arange_table.  */
--- 3554,3563 ----
  static GTY((length ("arange_table_allocated"))) dw_die_ref *arange_table;
  
  /* Number of elements currently allocated for arange_table.  */
! static GTY(()) unsigned arange_table_allocated;
  
  /* Number of elements in arange_table currently in use.  */
! static GTY(()) unsigned arange_table_in_use;
  
  /* Size (in elements) of increments by which we may expand the
     arange_table.  */
***************
*** 3579,3597 ****
  static GTY ((length ("ranges_table_allocated"))) dw_ranges_ref ranges_table;
  
  /* Number of elements currently allocated for ranges_table.  */
! static unsigned ranges_table_allocated;
  
- #ifdef DWARF2_DEBUGGING_INFO
  /* Number of elements in ranges_table currently in use.  */
! static unsigned ranges_table_in_use;
  
  /* Size (in elements) of increments by which we may expand the
     ranges_table.  */
  #define RANGES_TABLE_INCREMENT 64
  
  /* Whether we have location lists that need outputting */
! static unsigned have_location_lists;
  
  /* Record whether the function being analyzed contains inlined functions.  */
  static int current_function_has_inlines;
  #endif
--- 3567,3585 ----
  static GTY ((length ("ranges_table_allocated"))) dw_ranges_ref ranges_table;
  
  /* Number of elements currently allocated for ranges_table.  */
! static GTY(()) unsigned ranges_table_allocated;
  
  /* Number of elements in ranges_table currently in use.  */
! static GTY(()) unsigned ranges_table_in_use;
  
  /* Size (in elements) of increments by which we may expand the
     ranges_table.  */
  #define RANGES_TABLE_INCREMENT 64
  
  /* Whether we have location lists that need outputting */
! static GTY(()) unsigned have_location_lists;
  
+ #ifdef DWARF2_DEBUGGING_INFO
  /* Record whether the function being analyzed contains inlined functions.  */
  static int current_function_has_inlines;
  #endif
***************
*** 3599,3604 ****
--- 3587,3598 ----
  static int comp_unit_has_inlines;
  #endif
  
+ /* Number of file tables emited in maybe_emit_file(). */
+ static GTY(()) int emitcount = 0;
+ 
+ /* Number of internal labels generated by gen_internal_sym(). */
+ static GTY(()) int label_num;
+ 
  #ifdef DWARF2_DEBUGGING_INFO
  
  /* Forward declarations for functions defined in this file.  */
***************
*** 6000,6006 ****
       const char *prefix;
  {
    char buf[256];
-   static int label_num;
  
    ASM_GENERATE_INTERNAL_LABEL (buf, prefix, label_num++);
    return xstrdup (buf);
--- 5994,5999 ----
***************
*** 12559,12565 ****
  maybe_emit_file (fileno)
       int fileno;
  {
-   static int emitcount = 0;  
    if (DWARF2_ASM_LINE_DEBUG_INFO && fileno > 0)
      {
        if (!VARRAY_UINT (file_table_emitted, fileno))
--- 12552,12557 ----



More information about the Gcc-patches mailing list