public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110913] New: internal compiler error when I pass temporary vector of string to co_await target function
@ 2023-08-05 11:56 redboltz at gmail dot com
  2023-08-05 16:42 ` [Bug c++/110913] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: redboltz at gmail dot com @ 2023-08-05 11:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110913
           Summary: internal compiler error when I pass temporary vector
                    of string to co_await target function
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redboltz at gmail dot com
  Target Milestone: ---

# Environment

## gcc --version

gcc (GCC) 13.2.1 20230730
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## gcc -v

Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure
--enable-languages=ada,c,c++,d,fortran,go,lto,objc,obj-c++ --enable-bootstrap
--prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--with-build-config=bootstrap-lto --with-linker-hash-style=gnu
--with-system-zlib --enable-__cxa_atexit --enable-cet=auto
--enable-checking=release --enable-clocale=gnu --enable-default-pie
--enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object
--enable-libstdcxx-backtrace --enable-link-serialization=1
--enable-linker-build-id --enable-lto --enable-multilib --enable-plugin
--enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch
--disable-werror
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.1 20230730 (GCC)


## uname -a
Linux archboltz 6.4.7-arch1-2 #1 SMP PREEMPT_DYNAMIC Mon, 31 Jul 2023 11:41:04
+0000 x86_64 GNU/Linux

compile option
-std=c++20 -O0 -Wall -Wextra -pedantic

# Overview
The following internal compiler error is reported:

```
cpp20coro_error.cpp: In function ‘boost::asio::awaitable<void>
test2(boost::asio::io_context&)’:
cpp20coro_error.cpp:37:1: internal compiler error: in
build_special_member_call, at cp/call.cc:11093
   37 | }
      | ^
0x1ad3438 internal_error(char const*, ...)
        ???:0
0x6b7b33 fancy_abort(char const*, int, char const*)
        ???:0
0x10dc453 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x10dc453 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x10dc573 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x10dc453 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x10dc453 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x10dc453 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x10dc573 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x10dc453 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x10dc453 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ???:0
0x74de61 finish_function(bool)
        ???:0
0x944370 c_common_parse_file()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.archlinux.org/> for instructions.
```

# Reproduce code

```
#include <vector>
#include <string>
#include <coroutine>
#include <boost/asio.hpp>

#define REPRODUCE_ISSUE 1

boost::asio::awaitable<void>
test1(boost::asio::io_context& ioc) {
    co_await boost::asio::post(
        ioc,
        boost::asio::append(
            boost::asio::use_awaitable,
            std::vector<int> {
                1, 2, 3
            }
        )
    );
}

boost::asio::awaitable<void>
test2(boost::asio::io_context& ioc) {
    std::vector<std::string> str{ "aaa", "bbb" };
    co_await boost::asio::post(
        ioc,
        boost::asio::append(
            boost::asio::use_awaitable,
#if REPRODUCE_ISSUE
            std::vector<std::string> {
                "aaa", "bbb"
            }
#else
            str
#endif
        )
    );
}

int main() {
    boost::asio::io_context ioc;
    boost::asio::co_spawn(ioc, test1(ioc), boost::asio::detached);
    boost::asio::co_spawn(ioc, test2(ioc), boost::asio::detached);
    ioc.run();
}
```

The error happens only if I passed temporary std::vector<std::string> variable
to the function coming after co_await (test2).
If I use non temporary variable then no errors occurred (You can test it by
seting macro REPRODUCE_ISSUE 0.
If I use temporay std::vector<int>, no errors occurred (test1).

Here are godbolt result:

x86-64 clang 16.0.0
-std=c++20
https://godbolt.org/z/qnWqrcPKc

The same error is reported.



x86-64 clang 13.2
-std=c++20
https://godbolt.org/z/K74G65Yb1

No errors are reported.

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

* [Bug c++/110913] internal compiler error when I pass temporary vector of string to co_await target function
  2023-08-05 11:56 [Bug c++/110913] New: internal compiler error when I pass temporary vector of string to co_await target function redboltz at gmail dot com
@ 2023-08-05 16:42 ` pinskia at gcc dot gnu.org
  2023-10-01 21:10 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-05 16:42 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 105574.

*** This bug has been marked as a duplicate of bug 105574 ***

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

* [Bug c++/110913] internal compiler error when I pass temporary vector of string to co_await target function
  2023-08-05 11:56 [Bug c++/110913] New: internal compiler error when I pass temporary vector of string to co_await target function redboltz at gmail dot com
  2023-08-05 16:42 ` [Bug c++/110913] " pinskia at gcc dot gnu.org
@ 2023-10-01 21:10 ` pinskia at gcc dot gnu.org
  2023-10-02  9:12 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-01 21:10 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |---

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reopen as PR 105574  seems fixed.

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

* [Bug c++/110913] internal compiler error when I pass temporary vector of string to co_await target function
  2023-08-05 11:56 [Bug c++/110913] New: internal compiler error when I pass temporary vector of string to co_await target function redboltz at gmail dot com
  2023-08-05 16:42 ` [Bug c++/110913] " pinskia at gcc dot gnu.org
  2023-10-01 21:10 ` pinskia at gcc dot gnu.org
@ 2023-10-02  9:12 ` pinskia at gcc dot gnu.org
  2023-10-02  9:13 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-02  9:12 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yunus at ayar dot eu

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 111651 has been marked as a duplicate of this bug. ***

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

* [Bug c++/110913] internal compiler error when I pass temporary vector of string to co_await target function
  2023-08-05 11:56 [Bug c++/110913] New: internal compiler error when I pass temporary vector of string to co_await target function redboltz at gmail dot com
                   ` (2 preceding siblings ...)
  2023-10-02  9:12 ` pinskia at gcc dot gnu.org
@ 2023-10-02  9:13 ` pinskia at gcc dot gnu.org
  2023-10-02  9:14 ` pinskia at gcc dot gnu.org
  2023-10-02 16:52 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-02  9:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 56029
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56029&action=edit
Reduced testcase

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

* [Bug c++/110913] internal compiler error when I pass temporary vector of string to co_await target function
  2023-08-05 11:56 [Bug c++/110913] New: internal compiler error when I pass temporary vector of string to co_await target function redboltz at gmail dot com
                   ` (3 preceding siblings ...)
  2023-10-02  9:13 ` pinskia at gcc dot gnu.org
@ 2023-10-02  9:14 ` pinskia at gcc dot gnu.org
  2023-10-02 16:52 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-02  9:14 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-10-02
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

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

* [Bug c++/110913] internal compiler error when I pass temporary vector of string to co_await target function
  2023-08-05 11:56 [Bug c++/110913] New: internal compiler error when I pass temporary vector of string to co_await target function redboltz at gmail dot com
                   ` (4 preceding siblings ...)
  2023-10-02  9:14 ` pinskia at gcc dot gnu.org
@ 2023-10-02 16:52 ` pinskia at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-02 16:52 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 109227.

*** This bug has been marked as a duplicate of bug 109227 ***

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

end of thread, other threads:[~2023-10-02 16:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-05 11:56 [Bug c++/110913] New: internal compiler error when I pass temporary vector of string to co_await target function redboltz at gmail dot com
2023-08-05 16:42 ` [Bug c++/110913] " pinskia at gcc dot gnu.org
2023-10-01 21:10 ` pinskia at gcc dot gnu.org
2023-10-02  9:12 ` pinskia at gcc dot gnu.org
2023-10-02  9:13 ` pinskia at gcc dot gnu.org
2023-10-02  9:14 ` pinskia at gcc dot gnu.org
2023-10-02 16:52 ` pinskia 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).