pkgsrc-ng/lang/gcc45/patches/patch-gcc_tree-tailcall.c
Lionel Sambuc 612ad0a18c lang/gcc45
2016-01-22 00:09:29 +01:00

20 lines
545 B
C

$NetBSD$
--- gcc/tree-tailcall.c.orig Fri Apr 23 15:47:44 2010
+++ gcc/tree-tailcall.c
@@ -1007,6 +1007,14 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls)
integer_one_node);
}
+ if (a_acc || m_acc)
+ {
+ /* When the tail call elimination using accumulators is performed,
+ statements adding the accumulated value are inserted at all exits.
+ This turns all other tail calls to non-tail ones. */
+ opt_tailcalls = false;
+ }
+
for (; tailcalls; tailcalls = next)
{
next = tailcalls->next;