https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120407
Bug ID: 120407 Summary: [12.3/13/14/15/16 Regression] Binary size manifold for static linked MinGW target (e.g. std::__throw_system_error) Product: gcc Version: 12.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: daniel.f.starke at freenet dot de Target Milestone: --- Compiling the following C++ code for mingw-w64 using `-O2 -s -static` creates a 896 KiB executable instead of 119 KiB since git commit releases/gcc-12.2.0-633-g00ac6fa3f2a. #include <bits/functexcept.h> namespace __gnu_cxx { /* Disable the verbose termination handler by overwriting it. */ void __verbose_terminate_handler() {} } /* namespace __gnu_cxx */ int main() { std::__throw_system_error(0); return 0; } For me it is unclear how this commit can cause such an increase in size. Especially since the commit claims to provide better dead code elemination opportunities. The commit was found via git bisect.