This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Clear DECL_SECTION_NAME during cgraph_create_virtual_clone (PR tree-optimization/43801)
> On Wed, Jun 30, 2010 at 04:12:55AM +0200, Jan Hubicka wrote:
> > > When a fndecl is DECL_ONE_ONLY and has DECL_SECTION_NAME already set (e.g.
> > > because of emitting associated thunks), its virtual clones which are not
> > > DECL_ONE_ONLY definitely must not reuse its section, because that results in
> > > section conflicts. For non-comdat functions e.g. put by user into some
> > > special section I think we can just reuse that section.
> > >
> > > Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux. Ok for
> > > trunk?
> > >
> > > 2010-06-29 Jakub Jelinek <jakub@redhat.com>
> > >
> > > PR tree-optimization/43801
> > > * cgraph.c (cgraph_create_virtual_clone): Clear DECL_SECTION_NAME
> > > if old_decl was DECL_ONE_ONLY.
> >
> > Don't we want to do this in make_decl_local?
>
> make_decl_local doesn't work on a copy, so if DECL_SECTION_NAME has been
> assigned for it, I'd say it is too late to try to make it !DECL_ONE_ONLY
> (e.g. associated thunks had to be emitted).
> But perhaps it won't hurt to do that anyway.
It is given a copy via cgraph_function_versioning
Honza
>
> Jakub