On 5/14/19 4:57 PM, Jakub Jelinek wrote:
> On Tue, May 14, 2019 at 01:08:27PM -0600, Jeff Law wrote:
>>> In https://gcc.gnu.org/ml/gcc-patches/2019-05/msg00484.html I've posted a
>>> patch that would set it earlier (or it could be set during gimplification
>>> and propagated during inlining, would need to be in cfun->calls_eh_return
>>> instead of crtl->calls_eh_return) and then targets for which we do not want
>>> to bother with it or where it is not beneficial to have tail calls in
>>> functions that call __builtin_eh_return (as I said in the thread, e.g. on
>>> x86_64-linux it is both smaller and faster), the targets which we expect to
>>> fail currently or even have a proof of that can just punt.
>> I would go with a patch that got the info set earlier and just punt in
>> the generic code.  I just don't see this case as terribly important to
>> optimize.
> 
> So like this?  Bootstrapped/regtested on x86_64-linux and i686-linux,
> verified _Unwind_Resume_or_Rethrow no longer has a tail call.
> 
> 2019-05-14  Jakub Jelinek  <ja...@redhat.com>
> 
>       PR c++/59813
>       PR target/90418
>       * function.h (struct function): Add calls_eh_return member.
>       * gimplify.c (gimplify_call_expr): Set cfun->calls_eh_return when
>       gimplifying __builtin_eh_return call.
>       * tree-inline.c (initialize_cfun): Copy calls_eh_return from src_cfun
>       to cfun.
>       (expand_call_inline): Or in src_cfun->calls_eh_return into
>       dst_cfun->calls_eh_return.
>       * tree-tailcall.c (suitable_for_tail_call_opt_p): Return false if
>       cfun->calls_eh_return.
>       * lto-streamer-in.c (input_struct_function_base): Read calls_eh_return.
>       * lto-streamer-out.c (output_struct_function_base): Write
>       calls_eh_return.
Yea, this is how I envisioned it working.  I think we should just run
with this.

Jeff

Reply via email to