Rainer Orth <r...@cebitec.uni-bielefeld.de> wrote:

Hi Segher,

On Sat, Apr 11, 2020 at 03:46:18PM +0100, Iain Sandoe wrote:
Unfortunately, several targets have ABI constraints that prevent
an indirect tail-call, which results in the PRs compile error.

diff --git
a/gcc/testsuite/g++.dg/coroutines/torture/symmetric-transfer-00-basic.C
b/gcc/testsuite/g++.dg/coroutines/torture/symmetric-transfer-00-basic.C
index 864846e365c..8211e8250ff 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/symmetric-transfer-00-basic.C +++ b/gcc/testsuite/g++.dg/coroutines/torture/symmetric-transfer-00-basic.C
@@ -1,4 +1,5 @@
-//  { dg-do run }
+// { dg-do run }
+// { dg-xfail-run-if "no indirect tailcall" { { lp64 && {
powerpc64*-linux-gnu } } || { *-*-solaris2* *-*-aix* } } }

lp64 && powerpc*-*-linux (we have biarch compilers :-) )

The problem is not that there is no indirect tailcall; the problem is
that no tailcall can be done to a routine that (potentially) has a
different TOC.

From rs6000_function_ok_for_sibcall:
 Under the AIX or ELFv2 ABIs we can't allow calls to non-local
 functions, because the callee may have a different TOC pointer to
 the caller and there's no way to ensure we restore the TOC when
 we return.

so shouldn't the above be

 lp64 && powerpc*-*-*

instead to cover AIX, too?  Or are there other PowerPC ABIs that don't
have this issue?

Just for once, Darwin (both PPC and X86) has no problem (doesn’t use the TOC
and has a per-function “got”), so that’s one.

Iain

Reply via email to