https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99426
--- Comment #7 from Patrick Palka <ppalka at gcc dot gnu.org> --- There's a patch pending review at https://gcc.gnu.org/pipermail/gcc-patches/2024-March/647203.html Until that's merged, one should be able to work around this error with a trunk compiler by using --param=ggc-min-expand=1000 (or an ever larger value) to prevent garbage collection from occurring as often.