[PATCH] Fix IPA-SRA with same_body aliases (PR tree-optimization/42508)

Jan Hubicka hubicka@ucw.cz
Tue Jan 5 12:30:00 GMT 2010


> Hi,
> 
> On Mon, Jan 04, 2010 at 09:54:13PM +0100, Jan Hubicka wrote:
> > > On Mon, Jan 04, 2010 at 09:29:42PM +0100, Richard Guenther wrote:
> > > > Huh.  Are you sure thunks will not get confused with this?  After
> > > > all the analysis doesn't see what the thunks do and the thunks are
> > > > not clones either (and they'll emit a call to the original
> > > > function in a way that probably doesn't work anymore).
> > > 
> > > I believe IPA-SRA will refuse to change methods with thunks, because
> > > ipa_sra_preliminary_function_checks does:
> > >   if (DECL_VIRTUAL_P (current_function_decl))
> > >     {
> > >       if (dump_file)
> > >         fprintf (dump_file, "Function is a virtual method.\n");
> > >       return false;
> > >     }
> > 
> > This test is IMO wrong and just lead to code quality regressions.  I
> > remember I was asking for purpose of this one at the time the code went
> > in and somehow this was left unresolved.  I guess this test is really
> > just papering around issues with thunks.
> 
> IIRC I added this because some virtual method was not marked as needed
> because it appeared as if their address was not taken but they were
> accessible either as a thunk or through the VMT.  I also think that

Yes, i remember that.  I think it must've been thunk, the VMT case would break
in other passes too (i.e. inliner will hapilly remove the functions even if
they will alter end up in VMT).
> 
> I have just put this on my todo list and will try to do this in stage1.

Thanks.  I plan to re-opten ipa branch again this week (will need to look at
bugzilla first), so we can have place to put such changes in.

Honza
> 
> Martin



More information about the Gcc-patches mailing list