http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60973

--- Comment #5 from Jan Hubicka <hubicka at ucw dot cz> ---
> Before tunks we never bothered to compute [tailcall] before inlining
> completed, but now explicitely setting the flag for thunks (and not letting
> it be computed - why wouldn't that work?) breaks this.
> 
> So not setting the flag explicitely in expand_thunk looks like a better fix
> to me?

We always had this explicit set of tailcall in thunk expansion code -
originally
in C++ frontend and at early LTO times I just literaly moved it to cgraphunit.
This patch http://gcc.gnu.org/ml/gcc-patches/2013-09/msg01035.html makes it
possible that tunks are inlined since we lower them to gimple bodies early
and it is why things breaks now as inliner does not expect it.

My initial reaction (written in previously comment) was also that tailcall
should
discover the flags themself and we could avoid setting them in the thunk
expansion.
Sadly I think it is not quite the case; tailcall is very conservative and I
believe
it will give up in cases where thunks are possible.  Also it is not run at -O0
and for thunks we want the tailcall to happen since it only improves debugging
exprience and saves codegen time...

So I would probably say we should fix that in tree-inline as your patch
propose.

Reply via email to