]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix PR 10153: tail recusion for vector types.
authorAndrew Pinski <apinski@marvell.com>
Tue, 20 Jul 2021 18:25:43 +0000 (11:25 -0700)
committerAndrew Pinski <apinski@marvell.com>
Thu, 22 Jul 2021 16:14:42 +0000 (09:14 -0700)
commit8819419ba1d397c0444d89079ec16657a09914fb
tree11b8169539ebfab3e39714c711094b654a35e334
parent4048d8a08621820dd6cc6035e13de3c3c82af4a5
Fix PR 10153: tail recusion for vector types.

The problem here is we try to an initialized value
from a scalar constant. For vectors we need to do
a vect_dup instead.  This fixes that issue by using
build_{one,zero}_cst instead of integer_{one,zero}_node
when calling create_tailcall_accumulator.

Changes from v1:
* v2: Use build_{one,zero}_cst and get the correct type before.

OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions.

gcc/ChangeLog:

PR tree-optimization/10153
* tree-tailcall.c (create_tailcall_accumulator):
Don't call fold_convert as the type should be correct already.
(tree_optimize_tail_calls_1): Use build_{one,zero}_cst instead
of integer_{one,zero}_node for the call of create_tailcall_accumulator.

gcc/testsuite/ChangeLog:

PR tree-optimization/10153
* gcc.c-torture/compile/pr10153-1.c: New test.
* gcc.c-torture/compile/pr10153-2.c: New test.
gcc/testsuite/gcc.c-torture/compile/pr10153-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/pr10153-2.c [new file with mode: 0644]
gcc/tree-tailcall.c