https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120377
Bug ID: 120377
Summary: ICE with fmtlib and modules
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: cjangus at gmail dot com
Target Milestone: ---
Created attachment 61487
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61487&action=edit
3 preprocessed TUs
I still have a number of ICEs in my project using GCC modules. The attached
repro is reduced down from my project and isolated to the use of fmtlib. I
haven't attempted to continue to reduce down within the fmtlib source code.
Even getting this far the ICE is no longer the same as the original, but anyway
it reproduces.
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/opt/gcc-latest --enable-languages=c,c++
--enable-libstdcxx-debug --enable-libstdcxx-backtrace --disable-bootstrap
--disable-multilib --disable-libvtv --disable-libssp --disable-libffi
--with-system-zlib --without-isl --with-arch_64=x86-64-v2 --with-
gcc version 16.0.0 20250511 (experimental) (GCC)
g++ -fPIC -Og -g -Wall -std=c++2b -fmodules -finput-charset=UTF-8 -c -x c++
-fpreprocessed -fdirectives-only another.gcm.ii
g++ -fPIC -Og -g -Wall -std=c++2b -fmodules -finput-charset=UTF-8 -c -x c++
-fpreprocessed -fdirectives-only gcc-segfault-part1.gcm.ii
g++ -fPIC -Og -g -Wall -std=c++2b -fmodules -finput-charset=UTF-8 -c -x c++
-fpreprocessed -fdirectives-only gcc-segfault-part2.gcm.ii
I also created a reproduction on Compiler Explorer, though the precise ICE
seems to be slightly different due to a difference in GCC and/or fmtlib
version: https://godbolt.org/z/j1as93bvv
I'd also like to ask, in future is logging a bug report with a Compiler
Explorer reproduction only (no preprocessed sources) an option? I'm not a
regular user of GCC or Linux systems so the process of recreating on CE is
simpler for me if that is acceptable.