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: [PATCH] Copy over section name during cloning (PR ipa/64963)


> On Mon, Feb 16, 2015 at 07:23:33PM +0100, Jan Hubicka wrote:
> > > --- gcc/cgraphclones.c.jj	2015-01-09 21:59:44.000000000 +0100
> > > +++ gcc/cgraphclones.c	2015-02-16 14:02:16.564725881 +0100
> > > @@ -577,7 +577,7 @@ cgraph_node::create_virtual_clone (vec<c
> > >    char *name;
> > >  
> > >    if (!in_lto_p)
> > > -    gcc_checking_assert  (tree_versionable_function_p (old_decl));
> > > +    gcc_checking_assert (tree_versionable_function_p (old_decl));
> > >  
> > >    gcc_assert (local.can_change_signature || !args_to_skip);
> > >  
> > > @@ -617,6 +617,8 @@ cgraph_node::create_virtual_clone (vec<c
> > >       ABI support for this.  */
> > >    set_new_clone_decl_and_node_flags (new_node);
> > >    new_node->clone.tree_map = tree_map;
> > > +  if (!DECL_ONE_ONLY (old_decl))
> > 
> > Instead of DECL_ONE_ONLY you want to test implicit_section flag.  I think
> > resolving unique section with -ffunction-section is also needed.
> 
> DECL_ONE_ONLY was the test that 4.9 has been using here:
> 
>   /* Update the properties.
>      Make clone visible only within this translation unit.  Make sure
>      that is not weak also.
>      ??? We cannot use COMDAT linkage because there is no
>      ABI support for this.  */
>   if (DECL_ONE_ONLY (old_decl))
>     DECL_SECTION_NAME (new_node->decl) = NULL;
> 
> therefore I wanted to match the 4.9 behavior, before we try something
> different incrementally.

OK. implicit_section is trye only for DECL_ONE_ONLY declarations and those
that was named by resolve_unique_section via -ffunction-sections, so the
change should be safe, but lets first go with immitating 4.9 behaviour.

Incremetnally I think we should fix this and also teach inliner to not
make code travel in between user named sections.  This may become more
issue with an LTO kernel builds.

Honza
> 
> > > +    new_node->set_section (this->get_section ());
> > 
> > No need for this->...
> 
> Sure, can change that.
> 
> 	Jakub


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