public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/111651] New: Specific syntax with C++ 20 designated initializers and coroutines breaks
@ 2023-10-01 11:25 yunus at ayar dot eu
  2023-10-01 11:29 ` [Bug c++/111651] " yunus at ayar dot eu
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: yunus at ayar dot eu @ 2023-10-01 11:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111651
           Summary: Specific syntax with C++ 20 designated initializers
                    and coroutines breaks
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yunus at ayar dot eu
  Target Milestone: ---

The error 'internal compiler error: in build_special_member_call, at
cp/call.cc:11093' occurs in this code:

```cpp
awaitable<void> make(boost::asio::any_io_executor executor)
{
  co_await wdlite::async_new_session(executor, "http://localhost:9515",
                                    
wdlite::capabilities::make(wdlite::capabilities::Capabilities{
                                       .browser_specific =
                                         wdlite::capabilities::ChromeOptions{
                                           // The next line is not ok.
                                           .arguments = { std::to_string(0) },
                                           // The next line is ok.
                                           // .arguments = { "ok" },
                                         },
                                     }),
                                     use_awaitable);
  co_return;
}
```

If I substitute `.arguments = { std::to_string(0) },` with `.arguments = { "ok"
},` the code compiles just fine. `.arguments = { std::to_string(0) },` is not a
problem if I remove the `co_await` keyword. My Boost version is 1.80 and the
Boost.ASIO is 1.24.

The output of `g++ -v`:
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/13/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,m2,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 --enable-libstdcxx-backtrace
--with-libstdcxx-zoneinfo=/usr/share/zoneinfo --with-linker-hash-style=gnu
--enable-plugin --enable-initfini-array
--with-isl=/builddir/build/BUILD/gcc-13.2.1-20230728/obj-x86_64-redhat-linux/isl-install
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-offload-defaulted --enable-gnu-indirect-function --enable-cet
--with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
--with-build-config=bootstrap-lto --enable-link-serialization=1
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.1 20230728 (Red Hat 13.2.1-1) (GCC)

I compiled the attached file (main.cpp.ii) like so:
g++ main.cpp.ii -std=gnu++20

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

* [Bug c++/111651] Specific syntax with C++ 20 designated initializers and coroutines breaks
  2023-10-01 11:25 [Bug c++/111651] New: Specific syntax with C++ 20 designated initializers and coroutines breaks yunus at ayar dot eu
@ 2023-10-01 11:29 ` yunus at ayar dot eu
  2023-10-01 21:06 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: yunus at ayar dot eu @ 2023-10-01 11:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Yunus Ayar <yunus at ayar dot eu> ---
Created attachment 56021
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56021&action=edit
Output of g++ -save-temps; I compressed it because it is 7.5 MB big and would
exceed the file size limit

I have uploaded the uncompressed version but I think it was rejected because
it's too large (7.5 MB)

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

* [Bug c++/111651] Specific syntax with C++ 20 designated initializers and coroutines breaks
  2023-10-01 11:25 [Bug c++/111651] New: Specific syntax with C++ 20 designated initializers and coroutines breaks yunus at ayar dot eu
  2023-10-01 11:29 ` [Bug c++/111651] " yunus at ayar dot eu
@ 2023-10-01 21:06 ` pinskia at gcc dot gnu.org
  2023-10-02  0:44 ` 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:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
/workspaces/booxy/main.cpp: In function ‘boost::asio::awaitable<void>
make(boost::asio::any_io_executor)’:
/workspaces/booxy/main.cpp:19:1: internal compiler error: tree check: expected
record_type or union_type or qual_union_type, have array_type in
build_special_member_call, at cp/call.cc:11052
0x96ac48 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        /home/apinski/src/upstream-gcc-git/gcc/gcc/tree.cc:8956
0x771727 tree_check3(tree_node*, char const*, int, char const*, tree_code,
tree_code, tree_code)
        /home/apinski/src/upstream-gcc-git/gcc/gcc/tree.h:3637
0x771727 build_special_member_call(tree_node*, tree_node*, vec<tree_node*,
va_gc, vl_embed>**, tree_node*, int, int)
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/call.cc:11052
0xaca46c maybe_promote_temps
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/coroutines.cc:3146
0xaca46c await_statement_walker
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/coroutines.cc:3757
0x16120ac 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*> >*))
        /home/apinski/src/upstream-gcc-git/gcc/gcc/tree.cc:11400
0xac9c28 await_statement_walker
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/coroutines.cc:3428
0x16120ac 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*> >*))
        /home/apinski/src/upstream-gcc-git/gcc/gcc/tree.cc:11400
0xaca0c8 await_statement_walker
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/coroutines.cc:3417
0x16120ac 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*> >*))
        /home/apinski/src/upstream-gcc-git/gcc/gcc/tree.cc:11400
0xac9c28 await_statement_walker
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/coroutines.cc:3428
0x16120ac 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*> >*))
        /home/apinski/src/upstream-gcc-git/gcc/gcc/tree.cc:11400
0x1612204 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*> >*))
        /home/apinski/src/upstream-gcc-git/gcc/gcc/tree.cc:11634
0xac9c28 await_statement_walker
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/coroutines.cc:3428
0x16120ac 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*> >*))
        /home/apinski/src/upstream-gcc-git/gcc/gcc/tree.cc:11400
0xaca0c8 await_statement_walker
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/coroutines.cc:3417
0x16120ac 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*> >*))
        /home/apinski/src/upstream-gcc-git/gcc/gcc/tree.cc:11400
0xacb94f morph_fn_to_coro(tree_node*, tree_node**, tree_node**)
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/coroutines.cc:4508
0xb20f6b finish_function(bool)
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/decl.cc:18168
0xc252d7 cp_parser_function_definition_after_declarator
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:32302
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

* [Bug c++/111651] Specific syntax with C++ 20 designated initializers and coroutines breaks
  2023-10-01 11:25 [Bug c++/111651] New: Specific syntax with C++ 20 designated initializers and coroutines breaks yunus at ayar dot eu
  2023-10-01 11:29 ` [Bug c++/111651] " yunus at ayar dot eu
  2023-10-01 21:06 ` pinskia at gcc dot gnu.org
@ 2023-10-02  0:44 ` pinskia at gcc dot gnu.org
  2023-10-02  9:11 ` 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  0:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reducing ...

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

* [Bug c++/111651] Specific syntax with C++ 20 designated initializers and coroutines breaks
  2023-10-01 11:25 [Bug c++/111651] New: Specific syntax with C++ 20 designated initializers and coroutines breaks yunus at ayar dot eu
                   ` (2 preceding siblings ...)
  2023-10-02  0:44 ` pinskia at gcc dot gnu.org
@ 2023-10-02  9:11 ` pinskia at gcc dot gnu.org
  2023-10-02  9:12 ` pinskia at gcc dot gnu.org
  2023-10-02  9:16 ` 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:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

* [Bug c++/111651] Specific syntax with C++ 20 designated initializers and coroutines breaks
  2023-10-01 11:25 [Bug c++/111651] New: Specific syntax with C++ 20 designated initializers and coroutines breaks yunus at ayar dot eu
                   ` (3 preceding siblings ...)
  2023-10-02  9:11 ` pinskia at gcc dot gnu.org
@ 2023-10-02  9:12 ` pinskia at gcc dot gnu.org
  2023-10-02  9:16 ` 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:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

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

* [Bug c++/111651] Specific syntax with C++ 20 designated initializers and coroutines breaks
  2023-10-01 11:25 [Bug c++/111651] New: Specific syntax with C++ 20 designated initializers and coroutines breaks yunus at ayar dot eu
                   ` (4 preceding siblings ...)
  2023-10-02  9:12 ` pinskia at gcc dot gnu.org
@ 2023-10-02  9:16 ` 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:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note it is not designated initializers which is causing the issue but rather a
vector strings initialized from an array.

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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-01 11:25 [Bug c++/111651] New: Specific syntax with C++ 20 designated initializers and coroutines breaks yunus at ayar dot eu
2023-10-01 11:29 ` [Bug c++/111651] " yunus at ayar dot eu
2023-10-01 21:06 ` pinskia at gcc dot gnu.org
2023-10-02  0:44 ` pinskia at gcc dot gnu.org
2023-10-02  9:11 ` pinskia at gcc dot gnu.org
2023-10-02  9:12 ` pinskia at gcc dot gnu.org
2023-10-02  9:16 ` 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).