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: IPA merge: cgraph_add_function improvement


> > This causes a bootstrap failure on powerpc-aix and maybe other targets which don't
> > have support for the init section.
> > 
> > A reduced testcase is:
> > static void f(void) __attribute__((constructor));
> > static void f(void) {}
> > 
> > 
> > I tested this with a cross compiler to powerpc-aix5.3.
> > 
> > The ICE we get is:
> > t.c:2: internal compiler error: in cgraph_expand_all_functions, at cgraphunit.c:1220
> > Please submit a full bug report,
> > with preprocessed source if appropriate.
> > See <URL:http://gcc.gnu.org/bugs.html> for instructions.
> 
> Here is the fix I came up with while on the plane.
> David,
> Could you test it for me on powerpc-aix?
Hi,
I would preffer this variant of patch (that is mostly identical, just
moves process_new_functions into cgraph_optimize instead bothering
frontend to do so.

The patch is obvious (we always have to process new functions before
changing the form of cgraph), so I will test it on i686 and commit if it
passes.  Please let me know if there are any problems remaining on
powerpc-aix.

My apologizes for the breakage!
Honza

Index: cgraphunit.c
===================================================================
*** cgraphunit.c	(revision 120282)
--- cgraphunit.c	(working copy)
*************** cgraph_optimize (void)
*** 1445,1450 ****
--- 1445,1451 ----
    /* Frontend may output common variables after the unit has been finalized.
       It is safe to deal with them here as they are always zero initialized.  */
    varpool_analyze_pending_decls ();
+   cgraph_process_new_functions ();
  
    timevar_push (TV_CGRAPHOPT);
    if (pre_ipa_mem_report)


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