https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65583
--- Comment #9 from Marek Polacek <mpolacek at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #8) > So, can you try to schedule another > NEXT_PASS (pass_rebuild_cgraph_edges); > right after ubsan pass if that fixes it? > And then move that right before ubsan and see if it is broken again? Yup: scheduling the pass after ubsan fixes it, scheduling is before ICEs as well. So either simply that, or something like --- a/gcc/passes.def +++ b/gcc/passes.def @@ -57,6 +57,9 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_init_datastructures); NEXT_PASS (pass_build_ssa); NEXT_PASS (pass_ubsan); + PUSH_INSERT_PASSES_WITHIN (pass_ubsan) + NEXT_PASS (pass_rebuild_cgraph_edges); + POP_INSERT_PASSES () NEXT_PASS (pass_early_warn_uninitialized); POP_INSERT_PASSES () (Maybe that PUSH_INSERT_PASSES_WITHIN makes it cheaper for non-ubsan compilation?)