]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tailc: Improve tail recursion handling [PR119493]
authorJakub Jelinek <jakub@redhat.com>
Mon, 28 Apr 2025 07:22:50 +0000 (09:22 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 28 Apr 2025 07:22:50 +0000 (09:22 +0200)
Here is a patch to improve the tail recursion handling also for
non-musttail calls.

2025-04-28  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/119493
* tree-tailcall.cc (find_tail_calls): Handle non-gimple_reg_type
arguments which aren't just passed through for tail recursions
even for non-musttail calls.

gcc/tree-tailcall.cc

index f593363dae43d51e863dca010299b772f0927db1..fc05928cd6897803f937b98e959cba9f459196e5 100644 (file)
@@ -827,8 +827,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret, bool only_musttail,
                  ? !is_gimple_reg (param)
                  : (!is_gimple_variable (param)
                     || TREE_THIS_VOLATILE (param)
-                    || may_be_aliased (param)
-                    || !gimple_call_must_tail_p (call)))
+                    || may_be_aliased (param)))
                break;
            }
        }