https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
Eric Gallager changed:
What|Removed |Added
See Also||https://gcc.gnu.org/bugzill
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
Avi Kivity changed:
What|Removed |Added
Resolution|--- |INVALID
Status|UNCONFIRMED
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #22 from Avi Kivity ---
Certainly, closing as invalid.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #21 from Iain Sandoe ---
Avi, If we are agreed that there is no GCC bug here (the change from pointer to
reference is already in the queue)
I would suggest that new design discussion would be better by putting a paper
or suggestions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #20 from Avi Kivity ---
My coroutines do return suspend_never from initial_suspend(); so thanks for the
workaround, I'll use it until we have a better fix.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #19 from Iain Sandoe ---
(In reply to Ville Voutilainen from comment #17)
> (In reply to Ville Voutilainen from comment #16)
> > (In reply to Iain Sandoe from comment #14)
> > > (In reply to Ville Voutilainen from comment #12)
> > > T
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #18 from Avi Kivity ---
The work-around works if initial_suspend() returns suspend_never or similar. If
the lambda is suspended before execution, the reference may dangle.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #17 from Ville Voutilainen ---
(In reply to Ville Voutilainen from comment #16)
> (In reply to Iain Sandoe from comment #14)
> > (In reply to Ville Voutilainen from comment #12)
> > The idea of bringing the lambda's captures into the
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
Ville Voutilainen changed:
What|Removed |Added
CC||ville.voutilainen at gmail dot
com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #15 from Avi Kivity ---
I believe that my suggestion works for mutable lambdas (and for any coroutine
called as a member function):
- if the object passeed to the member function is an lvalue, then the
coroutine captures a reference
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #14 from Iain Sandoe ---
(In reply to Ville Voutilainen from comment #12)
> It sure seems to me that a coroutine lambda's captures should be copied to
> the coroutine state. I don't think the standard says that anywhere.
Maybe I am m
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #13 from Avi Kivity ---
Yes. gcc has a minor bug in that the lambda is reflected as a pointer instead
of a reference in coroutine_traits. The major bug is in the standard.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #12 from Ville Voutilainen ---
It sure seems to me that a coroutine lambda's captures should be copied to the
coroutine state. I don't think the standard says that anywhere.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #11 from Avi Kivity ---
I started a conversation on the std-proposals list about this.
Meanwhile, how about a -fnonstandard-coroutines-that-actually-work flag that
captures the parameter to a non-static member function coroutine by v
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #10 from Avi Kivity ---
Well, the standard is useless here.
In
[foo] () -> lazy { co_return foo; } ()
a temporary is clearly passed to the lambda body, yet the standard mandates
that we capture it by reference. As a result, a u
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
Iain Sandoe changed:
What|Removed |Added
Assignee|unassigned at gcc dot gnu.org |iains at gcc dot gnu.org
--- Commen
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #7 from Avi Kivity ---
I have a simple reproducer. A lambda fails while a fake lambda using structs
passes. I don't think gcc is at fault, but the standard is problematic here
IMO.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #8 from Avi Kivity ---
Created attachment 48526
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48526&action=edit
less lame testcase
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #6 from Iain Sandoe ---
(In reply to Avi Kivity from comment #5)
> This snippet from cppreference:
>
> If the coroutine is a non-static member function, such as task
> my_class::method1(int x) const;, its Promise type is
> st
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #5 from Avi Kivity ---
This snippet from cppreference:
If the coroutine is a non-static member function, such as task
my_class::method1(int x) const;, its Promise type is
std::coroutine_traits, const my_class&, int>::promise_
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #4 from Iain Sandoe ---
(In reply to Avi Kivity from comment #3)
> The test case I uploaded only shows the failure, it won't work if gcc worked
> as I expect it. I'll try to get a better testcase, unfortunately a small
> coroutine tes
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #3 from Avi Kivity ---
The test case I uploaded only shows the failure, it won't work if gcc worked as
I expect it. I'll try to get a better testcase, unfortunately a small coroutine
testcase is still some work.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #2 from Avi Kivity ---
Created attachment 48524
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48524&action=edit
lame testcase
Lame testcase that shows that the lambda is passed as a pointer rather than by
value, leading to a l
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95111
--- Comment #1 from Iain Sandoe ---
There are some gotchas with coroutines and references (both regular and
rvalue).
* there could still be a bug here, so I want to double-check.
Please could you expand your snippets of code into a small test-c
24 matches
Mail list logo