This is the mail archive of the gcc@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: Enabling IPCP by default


> > On Fri, 29 Aug 2008, Jan Hubicka wrote:
> > 
> > > Hi,
> > > tonight testing on x86_64, i386 and IA-64 didn't seem to bring any new
> > > surprises, so I've comitted the following patch.
> > > I will also update changes page of 4.4.
> > > 
> > > 	* doc/invoke.texi (-fipa-cp): Enabled by default at -O2/-Os/-O3
> > > 	(-fipa-cp-clone): Enabled by default at -O3.
> > > 	* opts.c (decode_options): Enable ipa-cp at -O2, ipa-cp-clone at -O3;
> > > 	make ipa-cp-clone to imply ipa-cp; disable cloning at -Os.
> > 
> > This broke Ada bootstrap:
> > 
> > /space/rguenther/obj/./prev-gcc/xgcc -B/space/rguenther/obj/./prev-gcc/ 
> > -B/usr/local/x86_64-unknown-linux-gnu/bin/ -c -g -O2  -gnatpg -gnata 
> > -nostdinc -I- -I. -Iada -I../../trunk/gcc/ada 
> > -I../../trunk/gcc/ada/gcc-interface ../../trunk/gcc/ada/sem_ch12.adb -o 
> > ada/sem_ch12.o
> 
> Sorry fro that.  I am investigating now.  The same problem appeared
> earlier but disappeared again, it seems to be related to inlining
> (the ICE happens in inlining not in IPCP clonning)
> Looks like Ada can fold statements into constant but we don't notice
> that the function has address taken.

the problem is that cgraph_remove_node removes nested funcitons of that
node that breaks in inline when outer function is inlined but inner is
going to be inlined.
Since we do unnesting now, we can thread the functions as indepenedent.
We probably also can remove nest tree after unnesting, but I will need
to look into it deeper (i.e. I've kept it around to immitate some of
behaviour of function at a time compiler).

I am testing the attached patch

Index: cgraph.c
===================================================================
--- cgraph.c	(revision 139767)
+++ cgraph.c	(working copy)
@@ -857,6 +857,7 @@ cgraph_remove_node (struct cgraph_node *
 {
   void **slot;
   bool kill_body = false;
+  struct cgraph_node *n;
 
   cgraph_call_node_removal_hooks (node);
   cgraph_node_remove_callers (node);
@@ -865,8 +866,9 @@ cgraph_remove_node (struct cgraph_node *
   /* Incremental inlining access removed nodes stored in the postorder list.
      */
   node->needed = node->reachable = false;
-  while (node->nested)
-    cgraph_remove_node (node->nested);
+  for (n = node->nested; n; n = n->next_nested)
+    n->origin = NULL;
+  node->nested = NULL;
   if (node->origin)
     {
       struct cgraph_node **node2 = &node->origin->nested;


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