[Bug tree-optimization/95481] Failure to optimize infinite recursion for empty struct types
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jun 1 18:29:35 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95481
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>:
https://gcc.gnu.org/g:ea418485c700494c3efdc282854c5f5a08702416
commit r12-1151-gea418485c700494c3efdc282854c5f5a08702416
Author: Andrew Pinski <apinski@marvell.com>
Date: Mon May 31 00:17:22 2021 +0000
Fix PR 95481: tail call fails with empty struct types
The problem here is we don't have an assignment type any more
for empty structs as they were removed during gimplifcation.
This adds a special case where the assignment var does not exist
and the return decl is empty typed.
OK? Tested on aarch64-linux-gnu with no regressions.
Thanks,
Andrew Pinski
changes since v1:
v2: Use is_empty_type instead of zero-sized type.
gcc/ChangeLog:
PR tree-optimization/95481
* tree-tailcall.c (find_tail_calls): Handle empty typed
return decls.
gcc/testsuite/ChangeLog:
PR tree-optimization/95481
* gcc.dg/tree-ssa/tailcall-10.c: New test.
* gcc.dg/tree-ssa/tailcall-11.c: New test.
* gcc.dg/tree-ssa/tailcall-12.c: New test.
* gcc.dg/tree-ssa/tailcall-13.c: New test.
* gcc.dg/tree-ssa/tailrecursion-8.c: New test.
More information about the Gcc-bugs
mailing list