public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94879] New: coroutines: ICE building folly in captures_temporary, at cp/coroutines.cc:2707
@ 2020-04-30 12:24 iains at gcc dot gnu.org
  2020-04-30 12:25 ` [Bug c++/94879] " iains at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: iains at gcc dot gnu.org @ 2020-04-30 12:24 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94879
           Summary: coroutines: ICE building folly in captures_temporary,
                    at cp/coroutines.cc:2707
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iains at gcc dot gnu.org
  Target Milestone: ---

Created attachment 48421
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48421&action=edit
fix under test

The following code should compile, but fails with

Excess errors:
/src-local/cxx-coroutines/gcc/testsuite/g++.dg/coroutines/folly-1.C:48:39:
internal compiler error: in captures_temporary, at cp/coroutines.cc:2707
libbacktrace could not find executable to open


The problem is that we are not properly accounting for proxy variable cases.

====

namespace std {
template <typename a> a b(a &&);
template <typename c> struct d { c e; };
template <typename f, typename> struct coroutine_traits : f {};
template <typename = void> struct coroutine_handle;
template <> struct coroutine_handle<> {};
template <typename> struct coroutine_handle : coroutine_handle<> {};
struct g {};
} // namespace std

class h {};
class i {
  i(i &&);
};

namespace ac {
template <typename> class ad {
public:
  bool await_ready();
  void await_resume();
  void await_suspend(std::coroutine_handle<>);
  i ae;
};
} // namespace ac

template <typename ab> ac::ad<ab> operator co_await(ab);
class j {
  class l {};

public:
  std::g initial_suspend();
  l final_suspend();
};
class m : public j {
public:
  void get_return_object();
  void unhandled_exception();
};
class n {
public:
  using promise_type = m;
};
std::d<h> k;
void a() {
  auto am = k;
  [&]() -> n { co_await std::b(am.e); };
}

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

* [Bug c++/94879] coroutines: ICE building folly in captures_temporary, at cp/coroutines.cc:2707
  2020-04-30 12:24 [Bug c++/94879] New: coroutines: ICE building folly in captures_temporary, at cp/coroutines.cc:2707 iains at gcc dot gnu.org
@ 2020-04-30 12:25 ` iains at gcc dot gnu.org
  2020-04-30 14:57 ` cvs-commit at gcc dot gnu.org
  2020-04-30 15:07 ` iains at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: iains at gcc dot gnu.org @ 2020-04-30 12:25 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.0
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-04-30
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |iains at gcc dot gnu.org

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

* [Bug c++/94879] coroutines: ICE building folly in captures_temporary, at cp/coroutines.cc:2707
  2020-04-30 12:24 [Bug c++/94879] New: coroutines: ICE building folly in captures_temporary, at cp/coroutines.cc:2707 iains at gcc dot gnu.org
  2020-04-30 12:25 ` [Bug c++/94879] " iains at gcc dot gnu.org
@ 2020-04-30 14:57 ` cvs-commit at gcc dot gnu.org
  2020-04-30 15:07 ` iains at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-30 14:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>:

https://gcc.gnu.org/g:b16fd5fd8afe6f95c8ae44e759971e605c31f97b

commit r10-8073-gb16fd5fd8afe6f95c8ae44e759971e605c31f97b
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Mon Apr 27 15:21:25 2020 +0100

    coroutines: Fix cases where proxy variables are used [PR94879]

    There are several places where the handling of a variable
    declaration depends on whether it corresponds to a compiler
    temporary, or to some other entity.  We were testing that var
    decls were artificial in determining this.  However, proxy vars
    are also artificial so that this is not sufficient.  The solution
    is to exclude variables with a DECL_VALUE_EXPR as well, since
    the value variable will not be a temporary.

    gcc/cp/ChangeLog:

    2020-04-30  Iain Sandoe  <iain@sandoe.co.uk>

            PR c++/94879
            * coroutines.cc (build_co_await): Account for variables
            with DECL_VALUE_EXPRs.
            (captures_temporary): Likewise.
            (register_awaits): Likewise.

    gcc/testsuite/ChangeLog:

    2020-04-30  Iain Sandoe  <iain@sandoe.co.uk>

            PR c++/94879
            * g++.dg/coroutines/pr94879-folly-1.C: New test.

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

* [Bug c++/94879] coroutines: ICE building folly in captures_temporary, at cp/coroutines.cc:2707
  2020-04-30 12:24 [Bug c++/94879] New: coroutines: ICE building folly in captures_temporary, at cp/coroutines.cc:2707 iains at gcc dot gnu.org
  2020-04-30 12:25 ` [Bug c++/94879] " iains at gcc dot gnu.org
  2020-04-30 14:57 ` cvs-commit at gcc dot gnu.org
@ 2020-04-30 15:07 ` iains at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: iains at gcc dot gnu.org @ 2020-04-30 15:07 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #2 from Iain Sandoe <iains at gcc dot gnu.org> ---
so fixed

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

end of thread, other threads:[~2020-04-30 15:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30 12:24 [Bug c++/94879] New: coroutines: ICE building folly in captures_temporary, at cp/coroutines.cc:2707 iains at gcc dot gnu.org
2020-04-30 12:25 ` [Bug c++/94879] " iains at gcc dot gnu.org
2020-04-30 14:57 ` cvs-commit at gcc dot gnu.org
2020-04-30 15:07 ` iains at gcc dot gnu.org

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