]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-ssa-propagate: Special case lhs of musttail calls in may_propagate_copy [PR118430]
authorJakub Jelinek <jakub@redhat.com>
Thu, 16 Jan 2025 08:25:16 +0000 (09:25 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 16 Jan 2025 08:27:54 +0000 (09:27 +0100)
commit7f5adfd31b3af08924faec36679eaea40a98af19
tree54fc4cc2847cb1516fbad20a4f41888d4468aab6
parent9c4397cafc5ded9b008a92a55d4e5207e1c2e4e4
tree-ssa-propagate: Special case lhs of musttail calls in may_propagate_copy [PR118430]

This patch ensures that VRP or similar passes don't replace the uses of lhs of
[[gnu::musttail]] calls with some constant (e.g. if the call is known is known
to return a singleton value range) etc. to make it more likely that it is actually
tail callable.

2025-01-16  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/118430
* tree-ssa-propagate.cc (may_propagate_copy): Return false if dest
is lhs of an [[gnu::musttail]] call.
(substitute_and_fold_dom_walker::before_dom_children): Formatting fix.

* c-c++-common/musttail14.c: Expect lhs on the must tail call calls.
gcc/testsuite/c-c++-common/musttail14.c
gcc/tree-ssa-propagate.cc