https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92007
--- Comment #3 from Ilya Leoshkevich <iii at linux dot ibm.com> --- Jump threading has converted this: +-------------------------- 2/HOT ------------------------+ | | v v 3/HOT --> 5/HOT --> 8/HOT --> 11/COLD --> 6/HOT --EH--> 16/HOT | ^ | | +-------------------------------+ into this: +---------------------- 2/HOT ------------------+ | | v v 3/HOT --> 8/HOT --> 11/COLD --> 6/COLD --EH--> 16/HOT by eleminating bb 5. This made bb 6 dominated by cold bb 11, and because of this fixup_partitions made bb 6 cold as well, which in turn made EH edge 6->16 a crossing one. According to https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=176696 in this situation we need to create a cold landing pad. But I wonder whether we could just do the following instead? --- a/gcc/passes.def +++ b/gcc/passes.def @@ -439,6 +439,7 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_ud_rtl_dce); NEXT_PASS (pass_combine); NEXT_PASS (pass_if_after_combine); + NEXT_PASS (pass_postreload_jump); NEXT_PASS (pass_partition_blocks); NEXT_PASS (pass_outof_cfg_layout_mode); NEXT_PASS (pass_split_all_insns); @@ -455,7 +456,6 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_reload); NEXT_PASS (pass_postreload); PUSH_INSERT_PASSES_WITHIN (pass_postreload) - NEXT_PASS (pass_postreload_jump); NEXT_PASS (pass_postreload_cse); NEXT_PASS (pass_gcse2); NEXT_PASS (pass_split_after_reload); This will fix this problem while retaining the benefits of the additional jump threading pass.