OSDN Git Service

2010-04-30 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / cfgbuild.c
index 7d87a7a..79b6183 100644 (file)
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "expr.h"
 #include "toplev.h"
 #include "timevar.h"
+#include "sbitmap.h"
 
 static void make_edges (basic_block, basic_block, int);
 static void make_label_edge (sbitmap, basic_block, rtx, int);
@@ -303,6 +304,15 @@ make_edges (basic_block min, basic_block max, int update_p)
          else if (returnjump_p (insn))
            cached_make_edge (edge_cache, bb, EXIT_BLOCK_PTR, 0);
 
+         /* Recognize asm goto and do the right thing.  */
+         else if ((tmp = extract_asm_operands (PATTERN (insn))) != NULL)
+           {
+             int i, n = ASM_OPERANDS_LABEL_LENGTH (tmp);
+             for (i = 0; i < n; ++i)
+               make_label_edge (edge_cache, bb,
+                                XEXP (ASM_OPERANDS_LABEL (tmp, i), 0), 0);
+           }
+
          /* Otherwise, we have a plain conditional or unconditional jump.  */
          else
            {
@@ -468,6 +478,14 @@ find_bb_boundaries (basic_block bb)
          if (code == CODE_LABEL && LABEL_ALT_ENTRY_P (insn))
            make_edge (ENTRY_BLOCK_PTR, bb, 0);
        }
+      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);
+       }
 
       if (control_flow_insn_p (insn))
        flow_transfer_insn = insn;