re PR middle-end/41360 (Revision 151696 breaks gcc.c-torture/compile/builtin_unreacha...
authorRichard Henderson <rth@redhat.com>
Wed, 16 Sep 2009 15:04:06 +0000 (08:04 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 16 Sep 2009 15:04:06 +0000 (08:04 -0700)
        PR middle-end/41360
        * cfgbuild.c (find_bb_boundaries): Re-instate 2009-09-02 barrier fix.

From-SVN: r151759

gcc/ChangeLog
gcc/cfgbuild.c

index c8d8846..706f3e2 100644 (file)
@@ -1,3 +1,8 @@
+2009-09-16  Richard Henderson  <rth@redhat.com>
+
+       PR middle-end/41360
+       * cfgbuild.c (find_bb_boundaries): Re-instate 2009-09-02 barrier fix.
+
 2009-09-16  Jakub Jelinek  <jakub@redhat.com>
 
        * integrate.c (set_block_abstract_flags): Call
index b5ddadd..5744108 100644 (file)
@@ -477,9 +477,17 @@ find_bb_boundaries (basic_block bb)
          if (code == CODE_LABEL && LABEL_ALT_ENTRY_P (insn))
            make_edge (ENTRY_BLOCK_PTR, bb, 0);
        }
-
-      if (control_flow_insn_p (insn))
+      else if (code == BARRIER)
+       {
+         /* __builtin_unreachable () may cause a barrier to be emitted in
+            the middle of a BB.  We need to split it in the same manner as
+            if the barrier were preceded by a control_flow_insn_p insn.  */
+         if (!flow_transfer_insn)
+           flow_transfer_insn = prev_nonnote_insn_bb (insn);
+       }
+      else if (control_flow_insn_p (insn))
        flow_transfer_insn = insn;
+
       if (insn == end)
        break;
       insn = NEXT_INSN (insn);