https://gcc.gnu.org/g:b0120fa9838f8fbeb13301d03b01cad282941569

commit r16-180-gb0120fa9838f8fbeb13301d03b01cad282941569
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Mon Apr 28 09:22:50 2025 +0200

    tailc: Improve tail recursion handling [PR119493]
    
    Here is a patch to improve the tail recursion handling also for
    non-musttail calls.
    
    2025-04-28  Jakub Jelinek  <ja...@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.

Diff:
---
 gcc/tree-tailcall.cc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gcc/tree-tailcall.cc b/gcc/tree-tailcall.cc
index f593363dae43..fc05928cd689 100644
--- a/gcc/tree-tailcall.cc
+++ b/gcc/tree-tailcall.cc
@@ -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;
            }
        }

Reply via email to