[tree-ssa] Fix disable checking bootstrap

Jan Hubicka jh@suse.cz
Tue Dec 16 16:11:00 GMT 2003


Hi,
bootstrapped/regtested i686-pc-gnu-linux, will commit it soonish when
disable checking bootstrap passes.
The main trick is to fix == I overlooked yesterday, but I've commented
the code better too so it is hopefully easier to understand.

2003-12-16  Jan Hubicka  <jh@suse.cz>

	* cgraphunit.c (cgraph_remove_unreachable_nodes): Fix typo;
	improve comments; cleanup linked list mantenance.

Index: cgraphunit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraphunit.c,v
retrieving revision 1.1.4.23
diff -c -3 -p -r1.1.4.23 cgraphunit.c
*** cgraphunit.c	15 Dec 2003 23:54:47 -0000	1.1.4.23
--- cgraphunit.c	16 Dec 2003 15:40:27 -0000
*************** cgraph_postorder (struct cgraph_node **o
*** 692,703 ****
    return order_pos;
  }
  
! /* Perform reachability analysis and reclaim all unreachable nodes.  */
  static bool
  cgraph_remove_unreachable_nodes (void)
  {
!   static struct cgraph_node footer;
!   struct cgraph_node *first = &footer;
    struct cgraph_node *node;
    bool changed = false;
    int insns = 0;
--- 692,704 ----
    return order_pos;
  }
  
! /* Perform reachability analysis and reclaim all unreachable nodes.
!    This function also remove unneeded bodies of extern inline functions
!    and thus needs to be done only after inlining decisions has been made.  */
  static bool
  cgraph_remove_unreachable_nodes (void)
  {
!   struct cgraph_node *first = (void *)1;
    struct cgraph_node *node;
    bool changed = false;
    int insns = 0;
*************** cgraph_remove_unreachable_nodes (void)
*** 717,723 ****
    /* Perform reachability analysis.  As a special case do not consider
       extern inline functions not inlined as live because we won't output
       them at all.  */
!   while (first != &footer)
      {
        struct cgraph_edge *e;
        node = first;
--- 718,724 ----
    /* Perform reachability analysis.  As a special case do not consider
       extern inline functions not inlined as live because we won't output
       them at all.  */
!   while (first != (void *)1)
      {
        struct cgraph_edge *e;
        node = first;
*************** cgraph_remove_unreachable_nodes (void)
*** 734,741 ****
      }
  
    /* Remove unreachable nodes.  Extern inline functions need special care;
!      when they are still called from some existing edge, we only can make
!      them extern and release their body.  */
    for (node = cgraph_nodes; node; node = node->next)
      {
        if (!node->aux)
--- 735,747 ----
      }
  
    /* Remove unreachable nodes.  Extern inline functions need special care;
!      Unreachable extern inline functions shall be removed.
!      Reachable extern inline functions we never inlined shall get their bodies
!      elliminated
!      Reachable extern inline functions we sometimes inlined will be turned into
!      unanalyzed nodes so they look like for true extern functions to the rest
!      of code.  Body of such functions is relased via remove_node once the
!      inline clones are elliminated.  */
    for (node = cgraph_nodes; node; node = node->next)
      {
        if (!node->aux)
*************** cgraph_remove_unreachable_nodes (void)
*** 760,768 ****
  		if (clone->aux)
  		  break;
  	      if (!clone)
! 	        DECL_SAVED_TREE (node->decl) == NULL_TREE;
  	      while (node->callees)
  	        cgraph_remove_edge (node->callees);
  	    }
  	  else
  	    cgraph_remove_node (node);
--- 766,775 ----
  		if (clone->aux)
  		  break;
  	      if (!clone)
! 	        DECL_SAVED_TREE (node->decl) = NULL_TREE;
  	      while (node->callees)
  	        cgraph_remove_edge (node->callees);
+ 	      node->analyzed = false;
  	    }
  	  else
  	    cgraph_remove_node (node);
*************** cgraph_optimize (void)
*** 1537,1543 ****
  	       right.  It probably does not worth the effort as these functions
  	       should go away soon.  */
  	    && !node->origin
- 	    && !DECL_EXTERNAL (node->decl)
  	    && (node->global.inlined_to
  	        || DECL_SAVED_TREE (node->decl)))
  	  {
--- 1544,1549 ----



More information about the Gcc-patches mailing list