Skip to content

Internal compiler error on GCC with modules #2148

Description

@mikomikotaishi

When trying to compile the library with any modules on GCC (specifically GCC 16.1.1), I get an internal compiler error. For example, the following program Test.cpp

#include <stdexec/execution.hpp>

import std;

int main() {
    std::println("Hello, world!");
}

with the command g++ Test.cpp -o Test -std=c++26 -fmodules, I get this error:

In file included from /usr/include/stdexec/__detail/__env.hpp:22,
                 from /usr/include/stdexec/__detail/__debug.hpp:22,
                 from /usr/include/stdexec/__detail/__completion_signatures_of.hpp:21,
                 from /usr/include/stdexec/__detail/__as_awaitable.hpp:24,
                 from /usr/include/stdexec/execution.hpp:22,
                 from Test.cpp:1:
/usr/include/stdexec/__detail/__query.hpp:177:39: internal compiler error: Segmentation fault
  177 |   inline constexpr forwarding_query_t forwarding_query{};
      |                                       ^~~~~~~~~~~~~~~~
0x1929892 internal_error(char const*, ...)
        ???:0
0x1a3e403 duplicate_decls(tree_node*, tree_node*, bool, bool)
        ???:0
0x1beeb37 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int, tree_node*, tree_node*, tree_node**)
        ???:0
0x278bb31 c_parse_file()
        ???:0
0x2761230 c_common_parse_file()
        ???:0
/usr/lib/gcc/x86_64-pc-linux-gnu/16/cc1plus -quiet -D_GNU_SOURCE Test.cpp -quiet -dumpdir Test- -dumpbase Test.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -std=c++26 -fmodules -o /tmp/ccLyV9c4.s
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://github.com/CachyOS/CachyOS-PKGBUILDS/issues> for instructions.

This doesn't seem to happen on Clang, and perhaps this issue is better reported directly upstream on GCC (which I'm not really sure how to do), but I do think this is worth pointing out as the library is basically unusable on GCC with modules on my end.

This is in particular a problem because it also prevents any work on providing the stdexec library as a module (see #2139).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions