diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index c62b5bc..8fcf7e4 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -1572,6 +1572,12 @@ rtl_tidy_fallthru_edge (edge e)
     if (INSN_P (q))
       return;
 
+  /* If the two blocks are in different partitions we do not want to mark
+     this as a fallthru edge.  */
+  if (find_reg_note (BB_END (b), REG_CROSSING_JUMP, NULL_RTX)
+      || BB_PARTITION (b) != BB_PARTITION (c))
+    return;
+
   /* Remove what will soon cease being the jump insn from the source block.
      If block B consisted only of this single jump, turn it into a deleted
      note.  */
