Re: C++ PATCH for c++/61687 (extra errors with -O2)

2014-07-29 Thread Jason Merrill
On 07/28/2014 07:22 AM, Jan Hubicka wrote: We decide what we can devirtualize in can_refer_decl_in_current_unit_p. So the problem is that we have functions that should be COMDAT but they are not because we decide to not produce their body (believing it is not reachable). Can't we arrange them h

Re: C++ PATCH for c++/61687 (extra errors with -O2)

2014-07-28 Thread Jan Hubicka
> On 07/24/2014 07:36 PM, Jan Hubicka wrote: > >ipa-deivrt has code to do the tracking for you. All is needed is to cal > >get_odr_type > >for all polymorphic type that we care about. build_type_inheritance_graph > >just > >walks all virtual methods to register all polymorphic types that matters

Re: C++ PATCH for c++/61687 (extra errors with -O2)

2014-07-25 Thread Jason Merrill
On 07/24/2014 07:36 PM, Jan Hubicka wrote: ipa-deivrt has code to do the tracking for you. All is needed is to cal get_odr_type for all polymorphic type that we care about. build_type_inheritance_graph just walks all virtual methods to register all polymorphic types that matters (i.e. have meth

Re: C++ PATCH for c++/61687 (extra errors with -O2)

2014-07-24 Thread Jan Hubicka
`` > >Given my experience about numbers of functions that become reachable when > >you stream all virtuals into LTO, > >I wonder if we don't want to use possible_polymorphic_call_targets within > >the front-end to avoid instantiating > >those that can't be called? > > Yes, I think we need to do

Re: C++ PATCH for c++/61687 (extra errors with -O2)

2014-07-24 Thread Jason Merrill
On 07/17/2014 08:23 AM, Jan Hubicka wrote: Given my experience about numbers of functions that become reachable when you stream all virtuals into LTO, I wonder if we don't want to use possible_polymorphic_call_targets within the front-end to avoid instantiating those that can't be called? Yes

Re: C++ PATCH for c++/61687 (extra errors with -O2)

2014-07-17 Thread Jan Hubicka
> My earlier patch for 61659 caused more virtual functions to be > instantiated when -fdevirtualize is on, leading to additional errors > appearing at higher optimization levels. This patch shifts that > instantiation to a new flag, -fuse-all-virtuals, which is on by > default, and adds an explana

C++ PATCH for c++/61687 (extra errors with -O2)

2014-07-10 Thread Jason Merrill
My earlier patch for 61659 caused more virtual functions to be instantiated when -fdevirtualize is on, leading to additional errors appearing at higher optimization levels. This patch shifts that instantiation to a new flag, -fuse-all-virtuals, which is on by default, and adds an explanatory n