https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93199
--- Comment #15 from Richard Biener <rguenth at gcc dot gnu.org> --- So lower_eh_constructs is what is remaining of EH time and there it's just cleanup_is_dead_in which ends up costly: while (reg && reg->type == ERT_CLEANUP) reg = reg->outer; return (reg && reg->type == ERT_MUST_NOT_THROW); looks like we could easily track that in the leh_state (cache the innermost non-cleanup region). I won't pursue this, but a quick check making the above simply return false shows tree eh : 1.44 ( 2%) 0.05 ( 1%) 1.48 ( 2%) 246315 kB ( 8%) on the RH bugzilla testcase. The reduced testcase can now be conveniently analyzed using callgrind (even with -O0 cc1plus). The RH one is still bigger.