This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [jh@suse.cz: Re: 6 GCC regressions, 2 new, with your patch on 2003-06-24T13:15:02Z.]


> > On Wed, Jun 25, 2003 at 07:19:41PM +0200, Jan Hubicka wrote:
> > > 	* c-common.c (handle_used_attribute): Use mark_referenced.
> > > 	* varasm.c (mark_referenced): Break out from ...
> > > 	(assemble_name): ... here.
> > > 	* tree.h (mark_referenced): Declare.
> > 
> > Ok.
> Thanks!  The PCH failure is actually more dificult to fix.
> Storing callgraph into PCH hits the problem with hashtables using
> pointers.  To avoid it we would have to hash the strings themselves that
> is slow.  Another way is to re-construct the hashtable once we are
> restored, for that I had to reinvent the linked chain of varpool nodes.
> regtested i386, bootstrap in progress OK? 

Hi,
testing of C++ code uncovered yet another nit in this code.  I am using
aux to keep the queue of nodes/variables scheduled for consideration but
the queue now needs to survive PCH too, so I must use variable of proper
type.  I am testing the attached patch and will install it as obvious if
it passes.

Honza

Wed Jul  2 02:03:26 CEST 2003  Jan Hubicka  <jh@suse.cz>
	* cgraph.c (cgraph_mark_needed_node, cgraph_varpool_mark_needed_node,
	cgraph_varpool_finalize_decl, cgraph_varpool_assemble_pending_decls):
	Use next_needed field instead of aux to maintain the queue.
	* cgraph.h (cgraph_node): Add next_needed.
	(cgraph_varpool_node): Add next_needed; remove aux.
	* cgraphunit.c (cgraph_finalize_compilation_unit): Use next_needed.
Index: cgraph.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraph.c,v
retrieving revision 1.16
diff -c -3 -p -r1.16 cgraph.c
*** cgraph.c	30 Jun 2003 21:56:46 -0000	1.16
--- cgraph.c	2 Jul 2003 00:03:07 -0000
*************** cgraph_mark_needed_node (node, needed)
*** 235,241 ****
        node->reachable = 1;
        if (DECL_SAVED_TREE (node->decl))
  	{
! 	  node->aux = cgraph_nodes_queue;
  	  cgraph_nodes_queue = node;
          }
      }
--- 235,241 ----
        node->reachable = 1;
        if (DECL_SAVED_TREE (node->decl))
  	{
! 	  node->next_needed = cgraph_nodes_queue;
  	  cgraph_nodes_queue = node;
          }
      }
*************** cgraph_varpool_mark_needed_node (struct 
*** 428,434 ****
  {
    if (!node->needed && node->finalized)
      {
!       node->aux = cgraph_varpool_nodes_queue;
        cgraph_varpool_nodes_queue = node;
      }
    node->needed = 1;
--- 428,434 ----
  {
    if (!node->needed && node->finalized)
      {
!       node->next_needed = cgraph_varpool_nodes_queue;
        cgraph_varpool_nodes_queue = node;
      }
    node->needed = 1;
*************** cgraph_varpool_finalize_decl (tree decl)
*** 441,447 ****
  
    if (node->needed && !node->finalized)
      {
!       node->aux = cgraph_varpool_nodes_queue;
        cgraph_varpool_nodes_queue = node;
      }
    node->finalized = true;
--- 441,447 ----
  
    if (node->needed && !node->finalized)
      {
!       node->next_needed = cgraph_varpool_nodes_queue;
        cgraph_varpool_nodes_queue = node;
      }
    node->finalized = true;
*************** cgraph_varpool_assemble_pending_decls ()
*** 475,481 ****
  	  assemble_variable (decl, 0, 1, 0);
  	  changed = true;
  	}
!       node->aux = NULL;
      }
    return changed;
  }
--- 475,481 ----
  	  assemble_variable (decl, 0, 1, 0);
  	  changed = true;
  	}
!       node->next_needed = NULL;
      }
    return changed;
  }
Index: cgraph.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraph.h,v
retrieving revision 1.8
diff -c -3 -p -r1.8 cgraph.h
*** cgraph.h	1 Jul 2003 12:17:51 -0000	1.8
--- cgraph.h	2 Jul 2003 00:03:07 -0000
*************** struct cgraph_node GTY(())
*** 73,78 ****
--- 73,80 ----
    struct cgraph_node *nested;
    /* Pointer to the next function with same origin, if any.  */
    struct cgraph_node *next_nested;
+   /* Pointer to the next function in cgraph_nodes_queue.  */
+   struct cgraph_node *next_needed;
    PTR GTY ((skip (""))) aux;
  
    /* Set when function must be output - it is externally visible
*************** struct cgraph_edge GTY(())
*** 106,112 ****
  struct cgraph_varpool_node GTY(())
  {
    tree decl;
!   PTR GTY ((skip (""))) aux;
  
    /* Set when function must be output - it is externally visible
       or it's address is taken.  */
--- 108,115 ----
  struct cgraph_varpool_node GTY(())
  {
    tree decl;
!   /* Pointer to the next function in cgraph_varpool_nodes_queue.  */
!   struct cgraph_varpool_node *next_needed;
  
    /* Set when function must be output - it is externally visible
       or it's address is taken.  */
Index: cgraphunit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraphunit.c,v
retrieving revision 1.8
diff -c -3 -p -r1.8 cgraphunit.c
*** cgraphunit.c	1 Jul 2003 12:17:51 -0000	1.8
--- cgraphunit.c	2 Jul 2003 00:03:07 -0000
*************** cgraph_finalize_compilation_unit ()
*** 165,171 ****
        tree decl = cgraph_nodes_queue->decl;
  
        node = cgraph_nodes_queue;
!       cgraph_nodes_queue = cgraph_nodes_queue->aux;
  
        if (node->lowered || !node->reachable || !DECL_SAVED_TREE (decl))
  	abort ();
--- 165,171 ----
        tree decl = cgraph_nodes_queue->decl;
  
        node = cgraph_nodes_queue;
!       cgraph_nodes_queue = cgraph_nodes_queue->next_needed;
  
        if (node->lowered || !node->reachable || !DECL_SAVED_TREE (decl))
  	abort ();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]