https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81387
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I'm afraid it is unfixable, if you want smaller memory consumption, you either need smaller routines, or use -fno-sanitize-recover=all, or do multiple builds with selected subsets of -fsanitize=undefined, so that you don't have that many checks in one function, or use -O1 on the larger functions to avoid many optimizations that are e.g. quadratic in the number of basic blocks. The UBSAN checks are many and especially if they are recoverable, they increase the number of basic blocks way too much.