You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GCC 16.1 segfaults compiling src/main.cpp when the module graph gains one module #863
GCC 16.1.0 (the gcc@16.1.0 toolchain mcpp builds itself with) segfaults while compiling src/main.cpp (import mcpp.cli;) once the tree's module graph grows by one module. Measured while implementing the target sets of design 2026-10-29 (release/2026.10.30.1):
adding a new module to the tree, whatever its content, makes the compile of src/main.cpp end with an internal compiler error (segmentation fault);
the same happens with the unchanged src/cli/cmd_build.cppm plus one import of an existing, unrelated module (import mcpp.build.advice;);
removing that one import makes the tree compile again.
The failure follows the number of modules reachable from main.cpp, not the code added, which points at GCC's handling of a large transitive module graph rather than at any construct of ours.
Workaround in mcpp
The target-set code, the leg API and the test archive were placed in existing modules (mcpp.toolchain.triple, mcpp.build.prepare with prepare/legs.cpp as a partition implementation unit, mcpp.build.execute) rather than in new ones, so the module count reachable from main.cpp is unchanged.
To do
Reduce to a self-contained reproducer (a generated chain of N modules imported by one TU) and report it to GCC Bugzilla; record the GCC bug here; remove the placement constraint when a fixed GCC is the toolchain mcpp builds with.
Activity