https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119102
--- Comment #1 from Igor Machado Coelho <igor.machado at gmail dot com> --- Note that if first building the std module with O3 and then linking with Ofast, it works fine: g++-15 -std=c++23 -O3 -fmodules -fsearch-include-path bits/std.cc main.cpp -o example # this generates gcm.cache/std.gcm Then... use Ofast: g++-15 -std=c++23 -Ofast -fmodules main.cpp -o example This does not break the compiler... so it's indeed something related to compiling the std.cc with Ofast.