Daily bump.
[platform/upstream/gcc.git] / gcc / cfgbuild.c
index 2f62b06..b27c239 100644 (file)
@@ -62,9 +62,9 @@ static int
 count_basic_blocks (f)
      rtx f;
 {
-  register rtx insn;
-  register RTX_CODE prev_code;
-  register int count = 0;
+  rtx insn;
+  RTX_CODE prev_code;
+  int count = 0;
   int saw_abnormal_edge = 0;
 
   prev_code = JUMP_INSN;
@@ -186,7 +186,7 @@ make_label_edge (edge_cache, src, label, flags)
   if (INSN_UID (label) == 0)
     return;
 
-  make_edge (edge_cache, src, BLOCK_FOR_INSN (label), flags);
+  cached_make_edge (edge_cache, src, BLOCK_FOR_INSN (label), flags);
 }
 
 /* Create the edges generated by INSN in REGION.  */
@@ -246,7 +246,7 @@ make_edges (label_value_list, min, max, update_p)
     }
 
   /* By nature of the way these get numbered, block 0 is always the entry.  */
-  make_edge (edge_cache, ENTRY_BLOCK_PTR, BASIC_BLOCK (0), EDGE_FALLTHRU);
+  cached_make_edge (edge_cache, ENTRY_BLOCK_PTR, BASIC_BLOCK (0), EDGE_FALLTHRU);
 
   for (i = min; i <= max; ++i)
     {
@@ -257,7 +257,7 @@ make_edges (label_value_list, min, max, update_p)
 
       if (GET_CODE (bb->head) == CODE_LABEL
          && LABEL_ALTERNATE_NAME (bb->head))
-       make_edge (NULL, ENTRY_BLOCK_PTR, bb, 0);
+       cached_make_edge (NULL, ENTRY_BLOCK_PTR, bb, 0);
 
       /* Examine the last instruction of the block, and discover the
         ways we can leave the block.  */
@@ -330,7 +330,7 @@ make_edges (label_value_list, min, max, update_p)
 
          /* Returns create an exit out.  */
          else if (returnjump_p (insn))
-           make_edge (edge_cache, bb, EXIT_BLOCK_PTR, 0);
+           cached_make_edge (edge_cache, bb, EXIT_BLOCK_PTR, 0);
 
          /* Otherwise, we have a plain conditional or unconditional jump.  */
          else
@@ -347,7 +347,7 @@ make_edges (label_value_list, min, max, update_p)
         wouldn't have created the sibling call in the first place.  */
 
       if (code == CALL_INSN && SIBLING_CALL_P (insn))
-       make_edge (edge_cache, bb, EXIT_BLOCK_PTR,
+       cached_make_edge (edge_cache, bb, EXIT_BLOCK_PTR,
                   EDGE_ABNORMAL | EDGE_ABNORMAL_CALL);
 
       /* If this is a CALL_INSN, then mark it as reaching the active EH
@@ -383,14 +383,14 @@ make_edges (label_value_list, min, max, update_p)
       /* Find out if we can drop through to the next block.  */
       insn = next_nonnote_insn (insn);
       if (!insn || (i + 1 == n_basic_blocks && force_fallthru))
-       make_edge (edge_cache, bb, EXIT_BLOCK_PTR, EDGE_FALLTHRU);
+       cached_make_edge (edge_cache, bb, EXIT_BLOCK_PTR, EDGE_FALLTHRU);
       else if (i + 1 < n_basic_blocks)
        {
          rtx tmp = BLOCK_HEAD (i + 1);
          if (GET_CODE (tmp) == NOTE)
            tmp = next_nonnote_insn (tmp);
          if (force_fallthru || insn == tmp)
-           make_edge (edge_cache, bb, BASIC_BLOCK (i + 1), EDGE_FALLTHRU);
+           cached_make_edge (edge_cache, bb, BASIC_BLOCK (i + 1), EDGE_FALLTHRU);
        }
     }
 
@@ -407,7 +407,7 @@ static void
 find_basic_blocks_1 (f)
      rtx f;
 {
-  register rtx insn, next;
+  rtx insn, next;
   int i = 0;
   rtx bb_note = NULL_RTX;
   rtx lvl = NULL_RTX;
@@ -442,7 +442,7 @@ find_basic_blocks_1 (f)
                if (bb_note == NULL_RTX)
                  bb_note = insn;
                else
-                 next = flow_delete_insn (insn);
+                 next = delete_insn (insn);
              }
            break;
          }
@@ -452,7 +452,7 @@ find_basic_blocks_1 (f)
             to a barrier or some such, no need to do it again.  */
          if (head != NULL_RTX)
            {
-             create_basic_block (i++, head, end, bb_note);
+             create_basic_block_structure (i++, head, end, bb_note);
              bb_note = NULL_RTX;
            }
 
@@ -523,7 +523,7 @@ find_basic_blocks_1 (f)
                end = insn;
 
              new_bb_exclusive:
-               create_basic_block (i++, head, end, bb_note);
+               create_basic_block_structure (i++, head, end, bb_note);
                head = end = NULL_RTX;
                bb_note = NULL_RTX;
                break;
@@ -579,9 +579,9 @@ find_basic_blocks_1 (f)
     }
 
   if (head != NULL_RTX)
-    create_basic_block (i++, head, end, bb_note);
+    create_basic_block_structure (i++, head, end, bb_note);
   else if (bb_note)
-    flow_delete_insn (bb_note);
+    delete_insn (bb_note);
 
   if (i != n_basic_blocks)
     abort ();
@@ -604,6 +604,8 @@ find_basic_blocks (f, nregs, file)
   int max_uid;
   timevar_push (TV_CFG);
 
+  basic_block_for_insn = 0;
+
   /* Flush out existing data.  */
   if (basic_block_info != NULL)
     {
@@ -655,8 +657,6 @@ find_basic_blocks (f, nregs, file)
      here and cleanup_cfg, e.g. thread_prologue_and_epilogue_insns.  */
   tidy_fallthru_edges ();
 
-  mark_critical_edges ();
-
 #ifdef ENABLE_CHECKING
   verify_flow_info ();
 #endif
@@ -671,8 +671,8 @@ find_sub_basic_blocks (bb)
 {
   rtx insn = bb->head;
   rtx end = bb->end;
-  rtx jump_insn = NULL_RTX;
-  edge falltru = 0;
+  rtx flow_transfer_insn = NULL_RTX;
+  edge fallthru = NULL;
   basic_block first_bb = bb;
   int i;
 
@@ -686,44 +686,66 @@ find_sub_basic_blocks (bb)
   while (1)
     {
       enum rtx_code code = GET_CODE (insn);
+
       switch (code)
        {
        case BARRIER:
-         if (!jump_insn)
+         if (!flow_transfer_insn)
            abort ();
          break;
+
        /* On code label, split current basic block.  */
        case CODE_LABEL:
-         falltru = split_block (bb, PREV_INSN (insn));
-         if (jump_insn)
-           bb->end = jump_insn;
-         bb = falltru->dest;
-         remove_edge (falltru);
-         jump_insn = 0;
+         fallthru = split_block (bb, PREV_INSN (insn));
+         if (flow_transfer_insn)
+           bb->end = flow_transfer_insn;
+         bb = fallthru->dest;
+         remove_edge (fallthru);
+         flow_transfer_insn = NULL_RTX;
          if (LABEL_ALTERNATE_NAME (insn))
-           make_edge (NULL, ENTRY_BLOCK_PTR, bb, 0);
+           make_edge (ENTRY_BLOCK_PTR, bb, 0);
          break;
+
        case INSN:
        case JUMP_INSN:
-         /* In case we've previously split insn on the JUMP_INSN, move the
-            block header to proper place.  */
-         if (jump_insn)
+       case CALL_INSN:
+         /* In case we've previously split an insn that effects a control
+            flow transfer, move the block header to proper place.  */
+         if (flow_transfer_insn)
            {
-             falltru = split_block (bb, PREV_INSN (insn));
-             bb->end = jump_insn;
-             bb = falltru->dest;
-             remove_edge (falltru);
-             jump_insn = 0;
+             fallthru = split_block (bb, PREV_INSN (insn));
+             bb->end = flow_transfer_insn;
+             bb = fallthru->dest;
+             remove_edge (fallthru);
+             flow_transfer_insn = NULL_RTX;
            }
+
          /* We need some special care for those expressions.  */
-         if (GET_CODE (insn) == JUMP_INSN)
+         if (code == JUMP_INSN)
            {
              if (GET_CODE (PATTERN (insn)) == ADDR_VEC
                  || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC)
                abort();
-             jump_insn = insn;
+             flow_transfer_insn = insn;
            }
+         else if (code == CALL_INSN)
+           {
+             rtx note;
+             if (nonlocal_goto_handler_labels
+                 && (!(note = find_reg_note (insn, REG_EH_REGION, NULL_RTX))
+                     || INTVAL (XEXP (note, 0)) >= 0))
+               flow_transfer_insn = insn;
+             else if (can_throw_internal (insn))
+               flow_transfer_insn = insn;
+             else if (SIBLING_CALL_P (insn))
+               flow_transfer_insn = insn;
+             else if (find_reg_note (insn, REG_NORETURN, 0))
+               flow_transfer_insn = insn;
+           }
+         else if (flag_non_call_exceptions && can_throw_internal (insn))
+           flow_transfer_insn = insn;
          break;
+
        default:
          break;
        }
@@ -735,8 +757,8 @@ find_sub_basic_blocks (bb)
   /* In case expander replaced normal insn by sequence terminating by
      return and barrier, or possibly other sequence not behaving like
      ordinary jump, we need to take care and move basic block boundary.  */
-  if (jump_insn && GET_CODE (bb->end) != JUMP_INSN)
-    bb->end = jump_insn;
+  if (flow_transfer_insn)
+    bb->end = flow_transfer_insn;
 
   /* We've possibly replaced the conditional jump by conditional jump
      followed by cleanup at fallthru edge, so the outgoing edges may