]> git.ipfire.org Git - thirdparty/gcc.git/commit
tailc: Use the IPA-VRP tail call hack even for pointers [PR119614]
authorJakub Jelinek <jakub@redhat.com>
Fri, 4 Apr 2025 06:59:51 +0000 (08:59 +0200)
committerJakub Jelinek <jakub@redhat.com>
Fri, 4 Apr 2025 06:59:51 +0000 (08:59 +0200)
commit08e803aa9becf407eb7ef7cf6af96e3bd0d02d38
tree1fba568ac318cdee49f6cd25ce93f2a329c75a19
parent89b56e903e3a170a8eff2140417cdf81f1d87c9d
tailc: Use the IPA-VRP tail call hack even for pointers [PR119614]

As the first two testcases show, even with pointers IPA-VRP can optimize
return values from functions if they have singleton ranges into just the
exact value, so we need to virtually undo that for tail calls similarly
to integers and floats.  The third test just adds check that it works
even with floats (which it does).

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

PR tree-optimization/119614
* tree-tailcall.cc (find_tail_calls): Handle also pointer types in the
IPA-VRP workaround.

* c-c++-common/pr119614-1.c: New test.
* c-c++-common/pr119614-2.c: New test.
* c-c++-common/pr119614-3.c: New test.
gcc/testsuite/c-c++-common/pr119614-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/pr119614-2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/pr119614-3.c [new file with mode: 0644]
gcc/tree-tailcall.cc