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]

[commited] fix PR 17509


Hi,
the memory fixes uncovered latent bug in the non-unit-at-a-time inlining
code (ie we never did recursive inlining) and making that hapen uncovered yet
another problem in the same area (namely that I was messing up way how
the node has been preserved for next round.

Things would be easier if we made non-unit-at-a-time mode to go, at
least for -O1 runs...

Bootstrapped/regtested ppc-linux and I will commit it as obvious.
Honza

2004-09-17  Jan Hubicka  <jh@suse.cz>
	PR tree-optimization/17509
	* tree-optimize.c (update_inlined_to_pointers): New function.
	(tree_rest_of_compilation): Use it.
Index: tree-optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-optimize.c,v
retrieving revision 2.46
diff -c -3 -p -r2.46 tree-optimize.c
*** tree-optimize.c	14 Sep 2004 12:21:42 -0000	2.46
--- tree-optimize.c	15 Sep 2004 23:40:16 -0000
*************** execute_pass_list (struct tree_opt_pass 
*** 539,544 ****
--- 539,559 ----
      }
    while (pass);
  }
+ 
+ static void
+ update_inlined_to_pointers (struct cgraph_node *node,
+ 			    struct cgraph_node *inlined_to)
+ {
+   struct cgraph_edge *e;
+   for (e = node->callees; e; e = e->next_callee)
+     {
+       if (e->callee->global.inlined_to)
+ 	{
+ 	  e->callee->global.inlined_to = inlined_to;
+ 	  update_inlined_to_pointers (e->callee, node);
+ 	}
+     }
+ }
  
  
  /* For functions-as-trees languages, this performs all optimization and
*************** tree_rest_of_compilation (tree fndecl, b
*** 630,635 ****
--- 645,651 ----
        if (!flag_unit_at_a_time)
  	{
  	  struct cgraph_edge *e;
+ 	  verify_cgraph ();
  	  while (node->callees)
  	    cgraph_remove_edge (node->callees);
  	  node->callees = saved_node->callees;
*************** tree_rest_of_compilation (tree fndecl, b
*** 637,646 ****
  	  for (e = node->callees; e; e = e->next_callee)
  	    {
  	      if (e->callee->global.inlined_to)
! 		e->callee->global.inlined_to = node;
  	      e->caller = node;
  	    }
  	  cgraph_remove_node (saved_node);
  	}
      }
    else
--- 653,665 ----
  	  for (e = node->callees; e; e = e->next_callee)
  	    {
  	      if (e->callee->global.inlined_to)
! 		{
! 		  e->callee->global.inlined_to = node;
! 		  update_inlined_to_pointers (e->callee, node);
! 		}
  	      e->caller = node;
  	    }
  	  cgraph_remove_node (saved_node);
  	}
      }
    else


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