This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Avoid some unnecessary set_cfun calls
- From: Richard Biener <rguenther at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Sandiford <rdsandiford at googlemail dot com>, Michael Meissner <meissner at linux dot vnet dot ibm dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 13 Nov 2013 12:08:43 +0100 (CET)
- Subject: Re: [PATCH] Avoid some unnecessary set_cfun calls
- Authentication-results: sourceware.org; auth=none
- References: <20131113094909 dot GI27813 at tucnak dot zalov dot cz> <alpine dot LNX dot 2 dot 00 dot 1311131123000 dot 4261 at zhemvz dot fhfr dot qr> <20131113104848 dot GJ27813 at tucnak dot zalov dot cz> <alpine dot LNX dot 2 dot 00 dot 1311131152200 dot 4261 at zhemvz dot fhfr dot qr> <20131113105738 dot GL27813 at tucnak dot zalov dot cz>
On Wed, 13 Nov 2013, Jakub Jelinek wrote:
> On Wed, Nov 13, 2013 at 11:53:32AM +0100, Richard Biener wrote:
> > > So, perhaps we should just define SWITCHABLE_TARGET on i?86/x86_64/powerpc*
> > > (and rx if maintainer cares) and tweak it to attach somehow
> > > struct target_globals * to TARGET_OPTION_NODE somehow.
> > > A problem might be that lots of the save_target_globals
> > > allocated structures are heap allocated rather than GC, so we might leak
> > > memory. Wonder if save_target_globals couldn't just compute the
> > > aggregate size of all the structures it allocates with XCNEW right now
> > > (plus required alignment if needed) and just allocate them together
> > > with the ggc_alloc_target_globals after the target_globals structure
> > > itself.
> > If you want to re-use it from functions with same options don't you
> > have a hashtable anyway? You could add a reference count.
> build_target_option_node is such a hash table for that.
Ah, and we already have some custom pointers in the tree node. Looks
like a suitable place to put in memory management then.