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

Jakub Jelinek jakub@redhat.com
Mon Jan 4 20:39:00 GMT 2010


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;
    }

> So - why not simply refuse to early-IPA-SRA (that's the only one
> that doesnt' work with clones?) functions that have same-body
> (or thunk) aliases?

Sure, we could give up, but as IMHO thunks aren't considered anyway
and dtors can be handled very easily, it would be just a code pessimization.

That said, if you prefer that, I can cook up a patch.  The
cgraphunit.c hunk would be still desirable.

	Jakub



More information about the Gcc-patches mailing list