public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106973] New: coroutine generator and setjmp
@ 2022-09-20  8:00 woohp135 at gmail dot com
  2022-09-20  8:44 ` [Bug c++/106973] " marxin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: woohp135 at gmail dot com @ 2022-09-20  8:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106973
           Summary: coroutine generator and setjmp
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: woohp135 at gmail dot com
  Target Milestone: ---

#include "generator.hpp"
#include <setjmp.h>
using namespace std;


cppcoro::generator<int> foo()
{
    jmp_buf env;
    setjmp(env);
    co_yield 1;
}


int main()
{
    return 0;
}


The generator.hpp file is from
https://github.com/lewissbaker/cppcoro/blob/master/include/cppcoro/generator.hpp

I'm getting this error:


> g++ -std=c++2a -Wall -Wextra -freport-bug foo.cpp
during GIMPLE pass: coro-early-expand-ifns
foo.cpp: In function ‘void foo(foo()::_Z3foov.Frame*)’:
foo.cpp:6:25: internal compiler error: Segmentation fault
    6 | cppcoro::generator<int> foo()
      |                         ^~~
0x19eab38 internal_error(char const*, ...)
        ???:0


I believe it is the setjmp that is causing the issue. This code compiles fine
on clang.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-09-21  0:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-20  8:00 [Bug c++/106973] New: coroutine generator and setjmp woohp135 at gmail dot com
2022-09-20  8:44 ` [Bug c++/106973] " marxin at gcc dot gnu.org
2022-09-20  8:54 ` woohp135 at gmail dot com
2022-09-20  9:23 ` marxin at gcc dot gnu.org
2022-09-20 10:32 ` iains at gcc dot gnu.org
2022-09-20 10:43 ` redi at gcc dot gnu.org
2022-09-20 10:52 ` iains at gcc dot gnu.org
2022-09-21  0:33 ` woohp135 at gmail dot com

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).