OSDN Git Service

Sanitize the behavior of -Wcoverage-mismatch.
[pf3gnuchains/gcc-fork.git] / gcc / cfglayout.c
index d6d1b3a..5e12057 100644 (file)
@@ -1,5 +1,5 @@
 /* Basic block reordering routines for the GNU compiler.
-   Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+   Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -694,7 +694,7 @@ relink_block_chain (bool stay_in_cfglayout_mode)
   free_original_copy_tables ();
   if (stay_in_cfglayout_mode)
     initialize_original_copy_tables ();
-  
+
   /* Finally, put basic_block_info in the new order.  */
   compact_blocks ();
 }
@@ -793,7 +793,8 @@ fixup_reorder_chain (void)
                 to prevent rtl_verify_flow_info from complaining.  */
              if (!e_fall)
                {
-                 gcc_assert (!onlyjump_p (bb_end_insn));
+                 gcc_assert (!onlyjump_p (bb_end_insn)
+                             || returnjump_p (bb_end_insn));
                  bb->il.rtl->footer = emit_barrier_after (bb_end_insn);
                  continue;
                }
@@ -861,8 +862,11 @@ fixup_reorder_chain (void)
            }
          else if (extract_asm_operands (PATTERN (bb_end_insn)) != NULL)
            {
-             /* If the old fallthru is still next, nothing to do.  */
-             if (bb->aux == e_fall->dest
+             /* If the old fallthru is still next or if
+                asm goto doesn't have a fallthru (e.g. when followed by
+                __builtin_unreachable ()), nothing to do.  */
+             if (! e_fall
+                 || bb->aux == e_fall->dest
                  || e_fall->dest == EXIT_BLOCK_PTR)
                continue;
 
@@ -928,7 +932,7 @@ fixup_reorder_chain (void)
       FOR_EACH_EDGE (e, ei, bb->succs)
        if (e->flags & EDGE_FALLTHRU)
          break;
-      
+
       if (e && !can_fallthru (e->src, e->dest))
        force_nonfallthru (e);
     }