This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: IPA merge: cgraph_add_function improvement
- From: Jan Hubicka <jh at suse dot cz>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: Jan Hubicka <jh at suse dot cz>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 1 Jan 2007 16:36:24 +0100
- Subject: Re: IPA merge: cgraph_add_function improvement
- References: <200612311809.kBVI9uTP020649@localhost.localdomain> <200612312244.kBVMiYLh012009@localhost.localdomain>
> > 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)