On 03/07/2018 02:42 PM, Jakub Jelinek wrote:
> Before Honza introduced recursive_call_p, this tree-tailcall.c snipped
> has been guarded with if (func == current_function_decl), so what we used
> for DECL_ARGUMENTS didn't really matter. But as it can now be some alias
> to it, we really want to check that the current function's arguments
> match the arguments of the call, rather than just that the call's arguments
> match its function type.
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 2018-03-07 Jakub Jelinek <ja...@redhat.com>
> PR tree-optimization/84739
> * tree-tailcall.c (find_tail_calls): Check call arguments against
> DECL_ARGUMENTS (current_function_decl) rather than
> DECL_ARGUMENTS (func) when checking for tail recursion.
> * gcc.dg/pr84739.c: New test.