public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "iains at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/94359] new test case g++.dg/coroutines/torture/symmetric-transfer-00-basic.C fails
Date: Sun, 29 Mar 2020 10:58:35 +0000	[thread overview]
Message-ID: <bug-94359-4-uTe8Cb32YP@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94359-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94359

--- Comment #6 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Iain Sandoe from comment #5)
> (In reply to Iain Sandoe from comment #4)

> I'm going to discuss this with the coroutines paper authors - as to whether
> any constraints had been considered.  Note, once again, that failure to
> implement this does not make us non-conforming.

coro paper author hadn't tested this configuration.

==
basically, the intent is that one can continue an arbitrary number
of coroutines, without overflowing the stack.  Maybe there's an alternate
pattern that we could construct that would allow this;  modulo the caller-
save of the TOC. Coroutine actor functions are marked with a flag, so we
do have a mechanism for handling them differently.

In the meantime, I guess this isn't going to work for PPC (AIX/powerpc64) 
:( and we have to XFAIL or switch it off.

/* A C equivalent of what's being done.  */
extern void actor (void *p);

/* This is how the public part of the coroutine frame ABI looks.  */
typedef struct __frame {
  void (*a) (void *);
  void (*d) (void *);
  float _other_things;
} generic_frame_t;

/* This is what a coroutine handle looks like.  */
typedef struct __handle {
  generic_frame_t *fp;
} generic_handle_t;

/* A fake call to get a handle...  */
__attribute__((__noinline__))
generic_handle_t get_handle (void)
{
  generic_frame_t *f = (generic_frame_t *)__builtin_malloc (sizeof
(generic_frame_t));
  f->a = actor;
  f->d = actor;
  f->_other_things = 0.0F;
  generic_handle_t h = {f};
  return h;
}

/* .. and part of coroutine state machine that wants to continue
   by executing another coroutine.
   X86 tail-calls this for O2+ (even for PIC) m32/m64
   PPC tail-calls for m32 (even for PIC), but not for ELFv2 m64.
   with the TOC reg caller-saved, perhaps there's no sequence that can
   work.
*/

void actor2 (void *p2)
{
  generic_handle_t h = get_handle ();

  generic_frame_t *t = h.fp;
  /* Use the TOC. */
  t->other_things = 1.1F;

   (*t->a) ((void *)t);
}

  parent reply	other threads:[~2020-03-29 10:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27 16:30 [Bug target/94359] New: " seurer at linux dot vnet.ibm.com
2020-03-27 17:13 ` [Bug target/94359] " iains at gcc dot gnu.org
2020-03-27 17:16 ` iains at gcc dot gnu.org
2020-03-27 21:48 ` iains at gcc dot gnu.org
2020-03-28  9:18 ` iains at gcc dot gnu.org
2020-03-28 16:10 ` iains at gcc dot gnu.org
2020-03-29 10:58 ` iains at gcc dot gnu.org [this message]
2020-04-02 11:09 ` ro at gcc dot gnu.org
2020-04-02 11:26 ` iains at gcc dot gnu.org
2020-04-02 11:51 ` ro at gcc dot gnu.org
2020-04-02 17:38 ` ebotcazou at gcc dot gnu.org
2020-04-09 20:40 ` iains at gcc dot gnu.org
2020-04-09 20:41 ` iains at gcc dot gnu.org
2020-04-14 18:58 ` [Bug c++/94359] " iains at gcc dot gnu.org
2020-04-14 19:44 ` cvs-commit at gcc dot gnu.org
2020-04-15 11:50 ` schwab@linux-m68k.org
2020-04-15 13:03 ` iains at gcc dot gnu.org
2020-04-15 13:24 ` schwab@linux-m68k.org
2020-04-16 23:02 ` cvs-commit at gcc dot gnu.org
2020-04-27 10:23 ` iains at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-94359-4-uTe8Cb32YP@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).