https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84739
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Mon Jun 25 17:28:32 2018 New Revision: 262071 URL: https://gcc.gnu.org/viewcvs?rev=262071&root=gcc&view=rev Log: Backported from mainline 2018-03-08 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. Added: branches/gcc-6-branch/gcc/testsuite/gcc.dg/pr84739.c Modified: branches/gcc-6-branch/gcc/ChangeLog branches/gcc-6-branch/gcc/testsuite/ChangeLog branches/gcc-6-branch/gcc/tree-tailcall.c