public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98118] New: [coroutines] ICE with coroutine with parameter with non-trivial destructor
@ 2020-12-03 12:13 xzlsmc at gmail dot com
  2020-12-03 12:15 ` [Bug c++/98118] " xzlsmc at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: xzlsmc at gmail dot com @ 2020-12-03 12:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98118
           Summary: [coroutines] ICE with coroutine with parameter with
                    non-trivial destructor
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xzlsmc at gmail dot com
  Target Milestone: ---

Created attachment 49670
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49670&action=edit
source

See attached source and ii files.
Compiler arguments: `-v -save-temps -std=c++20 -fcoroutines -O1 -S -c bug.cc -o
bug.S`
```
bug.cc: In function ‘fire_and_forget f(bug)’:
bug.cc:17:1: internal compiler error: in cp_build_addr_expr_1, at
cp/typeck.c:6338
   17 | }
      | ^
```
This should not be a duplicate of #93642, #95616 or #96141.

`gcc -v`:
```
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/10/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
--enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array --with-isl --enable-offload-targets=nvptx-none
--without-cuda-driver --enable-gnu-indirect-function --enable-cet
--with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.1 20201125 (Red Hat 10.2.1-9) (GCC)
```

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

* [Bug c++/98118] [coroutines] ICE with coroutine with parameter with non-trivial destructor
  2020-12-03 12:13 [Bug c++/98118] New: [coroutines] ICE with coroutine with parameter with non-trivial destructor xzlsmc at gmail dot com
@ 2020-12-03 12:15 ` xzlsmc at gmail dot com
  2020-12-03 12:15 ` xzlsmc at gmail dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: xzlsmc at gmail dot com @ 2020-12-03 12:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from xzlsmc <xzlsmc at gmail dot com> ---
Created attachment 49671
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49671&action=edit
ii file

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

* [Bug c++/98118] [coroutines] ICE with coroutine with parameter with non-trivial destructor
  2020-12-03 12:13 [Bug c++/98118] New: [coroutines] ICE with coroutine with parameter with non-trivial destructor xzlsmc at gmail dot com
  2020-12-03 12:15 ` [Bug c++/98118] " xzlsmc at gmail dot com
@ 2020-12-03 12:15 ` xzlsmc at gmail dot com
  2020-12-03 13:16 ` [Bug c++/98118] [10/11 Regression][coroutines] ICE with coroutine with parameter with non-trivial destructor since r10-6876-gdc192bbdd0442f75 marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: xzlsmc at gmail dot com @ 2020-12-03 12:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from xzlsmc <xzlsmc at gmail dot com> ---
Created attachment 49672
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49672&action=edit
compiler output

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

* [Bug c++/98118] [10/11 Regression][coroutines] ICE with coroutine with parameter with non-trivial destructor since r10-6876-gdc192bbdd0442f75
  2020-12-03 12:13 [Bug c++/98118] New: [coroutines] ICE with coroutine with parameter with non-trivial destructor xzlsmc at gmail dot com
  2020-12-03 12:15 ` [Bug c++/98118] " xzlsmc at gmail dot com
  2020-12-03 12:15 ` xzlsmc at gmail dot com
@ 2020-12-03 13:16 ` marxin at gcc dot gnu.org
  2021-01-14 11:00 ` [Bug c++/98118] [coroutines] " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-03 13:16 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-12-03
   Target Milestone|---                         |10.3
            Summary|[coroutines] ICE with       |[10/11
                   |coroutine with parameter    |Regression][coroutines] ICE
                   |with non-trivial destructor |with coroutine with
                   |                            |parameter with non-trivial
                   |                            |destructor since
                   |                            |r10-6876-gdc192bbdd0442f75
             Status|UNCONFIRMED                 |NEW
                 CC|                            |iains at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r10-6876-gdc192bbdd0442f75 for:

$ cat pr98118.C
namespace std {
inline namespace __n4861 {
template <typename _Result, typename> struct coroutine_traits : _Result {};
template <typename = void> struct coroutine_handle;
template <> struct coroutine_handle<> {};
template <typename> struct coroutine_handle : coroutine_handle<> {};
struct suspend_never {
  bool await_ready();
  void await_suspend(coroutine_handle<>);
  void await_resume();
};
} // namespace __n4861
} // namespace std
struct fire_and_forget {
  struct promise_type {
    fire_and_forget get_return_object();
    std::suspend_never initial_suspend();
    std::suspend_never final_suspend();
    void return_void();
    void unhandled_exception();
  };
};
struct bug {
  ~bug();
};
fire_and_forget f(bug) { co_return; }

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

* [Bug c++/98118] [coroutines] ICE with coroutine with parameter with non-trivial destructor since r10-6876-gdc192bbdd0442f75
  2020-12-03 12:13 [Bug c++/98118] New: [coroutines] ICE with coroutine with parameter with non-trivial destructor xzlsmc at gmail dot com
                   ` (2 preceding siblings ...)
  2020-12-03 13:16 ` [Bug c++/98118] [10/11 Regression][coroutines] ICE with coroutine with parameter with non-trivial destructor since r10-6876-gdc192bbdd0442f75 marxin at gcc dot gnu.org
@ 2021-01-14 11:00 ` rguenth at gcc dot gnu.org
  2021-03-05 16:59 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-14 11:00 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11                      |[coroutines] ICE with
                   |Regression][coroutines] ICE |coroutine with parameter
                   |with coroutine with         |with non-trivial destructor
                   |parameter with non-trivial  |since
                   |destructor since            |r10-6876-gdc192bbdd0442f75
                   |r10-6876-gdc192bbdd0442f75  |
           Keywords|                            |ice-on-valid-code
   Target Milestone|10.3                        |---

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
So it never worked in a released compiler.

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

* [Bug c++/98118] [coroutines] ICE with coroutine with parameter with non-trivial destructor since r10-6876-gdc192bbdd0442f75
  2020-12-03 12:13 [Bug c++/98118] New: [coroutines] ICE with coroutine with parameter with non-trivial destructor xzlsmc at gmail dot com
                   ` (3 preceding siblings ...)
  2021-01-14 11:00 ` [Bug c++/98118] [coroutines] " rguenth at gcc dot gnu.org
@ 2021-03-05 16:59 ` cvs-commit at gcc dot gnu.org
  2021-03-13 12:54 ` iains at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-05 16:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 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:3d9577c254003f2d18185015b75ce6e3e4af9ca2

commit r11-7529-g3d9577c254003f2d18185015b75ce6e3e4af9ca2
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Wed Feb 17 15:13:57 2021 +0000

    coroutines : Adjust constraints on when to build ctors [PR98118].

    PR98118 shows that TYPE_NEEDS_CONSTRUCTING is necessary but not
    sufficient.  Use type_build_ctor_call() instead.

    gcc/cp/ChangeLog:

            PR c++/98118
            * coroutines.cc (build_co_await): Use type_build_ctor_call()
            to determine cases when a CTOR needs to be built.
            (flatten_await_stmt): Likewise.
            (morph_fn_to_coro): Likewise.

    gcc/testsuite/ChangeLog:

            PR c++/98118
            * g++.dg/coroutines/pr98118.C: New test.

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

* [Bug c++/98118] [coroutines] ICE with coroutine with parameter with non-trivial destructor since r10-6876-gdc192bbdd0442f75
  2020-12-03 12:13 [Bug c++/98118] New: [coroutines] ICE with coroutine with parameter with non-trivial destructor xzlsmc at gmail dot com
                   ` (4 preceding siblings ...)
  2021-03-05 16:59 ` cvs-commit at gcc dot gnu.org
@ 2021-03-13 12:54 ` iains at gcc dot gnu.org
  2021-03-22 22:04 ` cvs-commit at gcc dot gnu.org
  2021-03-24 12:38 ` iains at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: iains at gcc dot gnu.org @ 2021-03-13 12:54 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |iains at gcc dot gnu.org
   Target Milestone|---                         |10.3

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

* [Bug c++/98118] [coroutines] ICE with coroutine with parameter with non-trivial destructor since r10-6876-gdc192bbdd0442f75
  2020-12-03 12:13 [Bug c++/98118] New: [coroutines] ICE with coroutine with parameter with non-trivial destructor xzlsmc at gmail dot com
                   ` (5 preceding siblings ...)
  2021-03-13 12:54 ` iains at gcc dot gnu.org
@ 2021-03-22 22:04 ` cvs-commit at gcc dot gnu.org
  2021-03-24 12:38 ` iains at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-22 22:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r10-9514-gfad6d041ebf191eecdc98e162869c2f4a6eb245f
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Wed Feb 17 15:13:57 2021 +0000

    coroutines : Adjust constraints on when to build ctors [PR98118].

    PR98118 shows that TYPE_NEEDS_CONSTRUCTING is necessary but not
    sufficient.  Use type_build_ctor_call() instead.

    gcc/cp/ChangeLog:

            PR c++/98118
            * coroutines.cc (build_co_await): Use type_build_ctor_call()
            to determine cases when a CTOR needs to be built.
            (flatten_await_stmt): Likewise.
            (morph_fn_to_coro): Likewise.

    gcc/testsuite/ChangeLog:

            PR c++/98118
            * g++.dg/coroutines/pr98118.C: New test.

    (cherry picked from commit 3d9577c254003f2d18185015b75ce6e3e4af9ca2)

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

* [Bug c++/98118] [coroutines] ICE with coroutine with parameter with non-trivial destructor since r10-6876-gdc192bbdd0442f75
  2020-12-03 12:13 [Bug c++/98118] New: [coroutines] ICE with coroutine with parameter with non-trivial destructor xzlsmc at gmail dot com
                   ` (6 preceding siblings ...)
  2021-03-22 22:04 ` cvs-commit at gcc dot gnu.org
@ 2021-03-24 12:38 ` iains at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: iains at gcc dot gnu.org @ 2021-03-24 12:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #7 from Iain Sandoe <iains at gcc dot gnu.org> ---
fixed for master and 10.3

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

end of thread, other threads:[~2021-03-24 12:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03 12:13 [Bug c++/98118] New: [coroutines] ICE with coroutine with parameter with non-trivial destructor xzlsmc at gmail dot com
2020-12-03 12:15 ` [Bug c++/98118] " xzlsmc at gmail dot com
2020-12-03 12:15 ` xzlsmc at gmail dot com
2020-12-03 13:16 ` [Bug c++/98118] [10/11 Regression][coroutines] ICE with coroutine with parameter with non-trivial destructor since r10-6876-gdc192bbdd0442f75 marxin at gcc dot gnu.org
2021-01-14 11:00 ` [Bug c++/98118] [coroutines] " rguenth at gcc dot gnu.org
2021-03-05 16:59 ` cvs-commit at gcc dot gnu.org
2021-03-13 12:54 ` iains at gcc dot gnu.org
2021-03-22 22:04 ` cvs-commit at gcc dot gnu.org
2021-03-24 12:38 ` 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).