public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/4259: dwarf2out.c ignores the garbage collector
@ 2001-09-07 10:26 tim
  0 siblings, 0 replies; 4+ messages in thread
From: tim @ 2001-09-07 10:26 UTC (permalink / raw)
  To: gcc-gnats

>Number:         4259
>Category:       c
>Synopsis:       dwarf2out.c ignores the garbage collector
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 07 10:26:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     tim@fungible.com
>Release:        gcc 3.0.1; current CVS
>Organization:
>Environment:
Any time you generate dwarf2 format debug records.
>Description:
dwarf2out does not pay due attention to the garbage 
collector.  Specifically, decl_scope_table and 
incomplete_types need to become varray's and to 
be registered as roots.  Here's a patch against
gcc 3.0.1 that also seems to work against this morning's
CVS tree.  This fixes bugs 4212 and 4215.
>How-To-Repeat:
Same instructions as bug 4215.
>Fix:

*** dwarf2out.c.orig	Fri Sep  7 06:32:29 2001
--- dwarf2out.c	Fri Sep  7 09:52:26 2001
***************
*** 3210,3226 ****
     of declaration scopes at the current scope and containing
     scopes.  This table is used to find the proper place to
     define type declaration DIE's.  */
! static tree *decl_scope_table;
! 
! /* Number of elements currently allocated for the decl_scope_table.  */
! static int decl_scope_table_allocated;
! 
! /* Current level of nesting of declaration scopes.  */
! static int decl_scope_depth;
! 
! /* Size (in elements) of increments by which we may expand the
!    decl_scope_table.  */
! #define DECL_SCOPE_TABLE_INCREMENT 64
  
  /* A pointer to the base of a list of references to DIE's that
     are uniquely identified by their tag, presence/absence of
--- 3210,3216 ----
     of declaration scopes at the current scope and containing
     scopes.  This table is used to find the proper place to
     define type declaration DIE's.  */
! varray_type decl_scope_table;
  
  /* A pointer to the base of a list of references to DIE's that
     are uniquely identified by their tag, presence/absence of
***************
*** 3290,3309 ****
  #define ARANGE_TABLE_INCREMENT 64
  
  /* A pointer to the base of a list of incomplete types which might be
!    completed at some later time.  */
! 
! static tree *incomplete_types_list;
! 
! /* Number of elements currently allocated for the incomplete_types_list.  */
! static unsigned incomplete_types_allocated;
! 
! /* Number of elements of incomplete_types_list currently in use.  */
! static unsigned incomplete_types;
! 
! /* Size (in elements) of increments by which we may expand the incomplete
!    types list.  Actually, a single hunk of space of this size should
!    be enough for most typical programs.	 */
! #define INCOMPLETE_TYPES_INCREMENT 64
  
  /* Record whether the function being analyzed contains inlined functions.  */
  static int current_function_has_inlines;
--- 3280,3290 ----
  #define ARANGE_TABLE_INCREMENT 64
  
  /* A pointer to the base of a list of incomplete types which might be
!    completed at some later time.  incomplete_types_list needs to be a VARRAY
!    because we want to tell the garbage collector about it.  If we don't tell
!    the garbage collector about it, we can garbage collect live data.
!    Bug 4215.*/
! varray_type incomplete_types;
  
  /* Record whether the function being analyzed contains inlined functions.  */
  static int current_function_has_inlines;
***************
*** 8789,8814 ****
  push_decl_scope (scope)
       tree scope;
  {
!   /* Make room in the decl_scope_table, if necessary.  */
!   if (decl_scope_table_allocated == decl_scope_depth)
!     {
!       decl_scope_table_allocated += DECL_SCOPE_TABLE_INCREMENT;
!       decl_scope_table
! 	= (tree *) xrealloc (decl_scope_table,
! 			     decl_scope_table_allocated * sizeof (tree));
!     }
! 
!   decl_scope_table[decl_scope_depth] = scope;
!   decl_scope_depth++;
  }
  
  /* Pop a declaration scope.  */
  static inline void
  pop_decl_scope ()
  {
!   if (decl_scope_depth <= 0)
      abort ();
!   --decl_scope_depth;
  }
  
  /* Return the DIE for the scope that immediately contains this type.
--- 8770,8785 ----
  push_decl_scope (scope)
       tree scope;
  {
!   VARRAY_PUSH_TREE (decl_scope_table, scope);
  }
  
  /* Pop a declaration scope.  */
  static inline void
  pop_decl_scope ()
  {
!   if (VARRAY_ACTIVE_SIZE (decl_scope_table) <= 0)
      abort ();
!   VARRAY_POP (decl_scope_table);
  }
  
  /* Return the DIE for the scope that immediately contains this type.
***************
*** 8850,8857 ****
  	 first we check to see if we're in the middle of emitting it
  	 so we know where the new DIE should go.  */
  
!       for (i = decl_scope_depth - 1; i >= 0; --i)
! 	if (decl_scope_table[i] == containing_scope)
  	  break;
  
        if (i < 0)
--- 8821,8828 ----
  	 first we check to see if we're in the middle of emitting it
  	 so we know where the new DIE should go.  */
  
!       for (i = VARRAY_ACTIVE_SIZE (decl_scope_table) - 1; i >= 0; --i)
! 	if (VARRAY_TREE (decl_scope_table, i) == containing_scope)
  	  break;
  
        if (i < 0)
***************
*** 9105,9124 ****
  #endif
  
  /* Remember a type in the incomplete_types_list.  */
- 
  static void
  add_incomplete_type (type)
       tree type;
  {
!   if (incomplete_types == incomplete_types_allocated)
!     {
!       incomplete_types_allocated += INCOMPLETE_TYPES_INCREMENT;
!       incomplete_types_list
! 	= (tree *) xrealloc (incomplete_types_list,
! 			     sizeof (tree) * incomplete_types_allocated);
!     }
! 
!   incomplete_types_list[incomplete_types++] = type;
  }
  
  /* Walk through the list of incomplete types again, trying once more to
--- 9076,9086 ----
  #endif
  
  /* Remember a type in the incomplete_types_list.  */
  static void
  add_incomplete_type (type)
       tree type;
  {
!   VARRAY_PUSH_TREE (incomplete_types, type);
  }
  
  /* Walk through the list of incomplete types again, trying once more to
***************
*** 9127,9139 ****
  static void
  retry_incomplete_types ()
  {
!   register tree type;
! 
!   while (incomplete_types)
      {
!       --incomplete_types;
!       type = incomplete_types_list[incomplete_types];
!       gen_type_die (type, comp_unit_die);
      }
  }
  
--- 9089,9098 ----
  static void
  retry_incomplete_types ()
  {
!   int i;
!   for (i = VARRAY_ACTIVE_SIZE (incomplete_types) - 1; i >= 0; i--)
      {
!       gen_type_die (VARRAY_TREE (incomplete_types, i), comp_unit_die);
      }
  }
  
***************
*** 11195,11204 ****
    decl_die_table_in_use = 0;
  
    /* Allocate the initial hunk of the decl_scope_table.  */
!   decl_scope_table
!     = (tree *) xcalloc (DECL_SCOPE_TABLE_INCREMENT, sizeof (tree));
!   decl_scope_table_allocated = DECL_SCOPE_TABLE_INCREMENT;
!   decl_scope_depth = 0;
  
    /* Allocate the initial hunk of the abbrev_die_table.  */
    abbrev_die_table
--- 11154,11161 ----
    decl_die_table_in_use = 0;
  
    /* Allocate the initial hunk of the decl_scope_table.  */
!   VARRAY_TREE_INIT (decl_scope_table, 256, "decl_scope_table");
!   ggc_add_tree_varray_root (&decl_scope_table, 1);
  
    /* Allocate the initial hunk of the abbrev_die_table.  */
    abbrev_die_table
***************
*** 11222,11227 ****
--- 11179,11187 ----
       taken as being relative to the directory from which the compiler was
       invoked when the given (base) source file was compiled.  */
    comp_unit_die = gen_compile_unit_die (main_input_filename);
+ 
+   VARRAY_TREE_INIT (incomplete_types, 64, "incomplete_types");
+   ggc_add_tree_varray_root (&incomplete_types, 1);
  
    VARRAY_RTX_INIT (used_rtx_varray, 32, "used_rtx_varray");
    ggc_add_rtx_varray_root (&used_rtx_varray, 1);
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c/4259: dwarf2out.c ignores the garbage collector
@ 2001-12-02 17:56 rodrigc
  0 siblings, 0 replies; 4+ messages in thread
From: rodrigc @ 2001-12-02 17:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/4259; it has been noted by GNATS.

From: rodrigc@gcc.gnu.org
To: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
  nobody@gcc.gnu.org, rodrigc@gcc.gnu.org, tim@fungible.com
Cc:  
Subject: Re: c/4259: dwarf2out.c ignores the garbage collector
Date: 3 Dec 2001 01:54:41 -0000

 Synopsis: dwarf2out.c ignores the garbage collector
 
 State-Changed-From-To: feedback->closed
 State-Changed-By: rodrigc
 State-Changed-When: Sun Dec  2 17:54:41 2001
 State-Changed-Why:
     Patch applied.
     http://gcc.gnu.org/ml/gcc-cvs/2001-09/msg00165.html
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4259&database=gcc


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c/4259: dwarf2out.c ignores the garbage collector
@ 2001-12-02 17:54 rodrigc
  0 siblings, 0 replies; 4+ messages in thread
From: rodrigc @ 2001-12-02 17:54 UTC (permalink / raw)
  To: gcc-bugs, gcc-gnats, gcc-prs, nobody, rodrigc, tim

Synopsis: dwarf2out.c ignores the garbage collector

State-Changed-From-To: feedback->closed
State-Changed-By: rodrigc
State-Changed-When: Sun Dec  2 17:54:41 2001
State-Changed-Why:
    Patch applied.
    http://gcc.gnu.org/ml/gcc-cvs/2001-09/msg00165.html

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4259&database=gcc


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c/4259: dwarf2out.c ignores the garbage collector
@ 2001-09-08 11:16 rodrigc
  0 siblings, 0 replies; 4+ messages in thread
From: rodrigc @ 2001-09-08 11:16 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, rodrigc, tim

Synopsis: dwarf2out.c ignores the garbage collector

State-Changed-From-To: open->feedback
State-Changed-By: rodrigc
State-Changed-When: Sat Sep  8 11:16:28 2001
State-Changed-Why:
    Can you:
    (1) reformat your patch according to the guidelines at: http://gcc.gnu.org/contribute.html
    (2) submit a ChangeLog entry in a format similar to:
    http://www.gnu.org/software/changelogs/gcc/gcc-3.0/gcc/ChangeLog
        
    (3) E-mail your patch to gcc-patches@gcc.gnu.org, where it
        will enter the queue for patches applied to gcc.
    
    I'll keep a reference to your patch on this bug report.
    
    Thanks.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4259&database=gcc


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-12-03  1:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-07 10:26 c/4259: dwarf2out.c ignores the garbage collector tim
2001-09-08 11:16 rodrigc
2001-12-02 17:54 rodrigc
2001-12-02 17:56 rodrigc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).