OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / gcc / cfgexpand.c
index a04f3ae..e339505 100644 (file)
@@ -1,5 +1,5 @@
 /* A pass for lowering trees to RTL.
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -886,6 +886,8 @@ expand_gimple_cond_expr (basic_block bb, tree stmt)
       jumpif (pred, label_rtx (GOTO_DESTINATION (then_exp)));
       add_reg_br_prob_note (dump_file, last, true_edge->probability);
       maybe_dump_rtl_for_tree_stmt (stmt, last);
+      if (EXPR_LOCUS (then_exp))
+       emit_line_note (*(EXPR_LOCUS (then_exp)));
       return NULL;
     }
   if (TREE_CODE (else_exp) == GOTO_EXPR && IS_EMPTY_STMT (then_exp))
@@ -893,6 +895,8 @@ expand_gimple_cond_expr (basic_block bb, tree stmt)
       jumpifnot (pred, label_rtx (GOTO_DESTINATION (else_exp)));
       add_reg_br_prob_note (dump_file, last, false_edge->probability);
       maybe_dump_rtl_for_tree_stmt (stmt, last);
+      if (EXPR_LOCUS (else_exp))
+       emit_line_note (*(EXPR_LOCUS (else_exp)));
       return NULL;
     }
   gcc_assert (TREE_CODE (then_exp) == GOTO_EXPR
@@ -922,6 +926,9 @@ expand_gimple_cond_expr (basic_block bb, tree stmt)
   update_bb_for_insn (new_bb);
 
   maybe_dump_rtl_for_tree_stmt (stmt, last2);
+  
+  if (EXPR_LOCUS (else_exp))
+    emit_line_note (*(EXPR_LOCUS (else_exp)));
 
   return new_bb;
 }
@@ -953,7 +960,7 @@ expand_gimple_tailcall (basic_block bb, tree stmt, bool *can_fallthru)
     if (CALL_P (last) && SIBLING_CALL_P (last))
       goto found;
 
-  maybe_dump_rtl_for_tree_stmt (stmt, last);
+  maybe_dump_rtl_for_tree_stmt (stmt, last2);
 
   *can_fallthru = true;
   return NULL;
@@ -996,7 +1003,7 @@ expand_gimple_tailcall (basic_block bb, tree stmt, bool *can_fallthru)
 
   /* This is somewhat ugly: the call_expr expander often emits instructions
      after the sibcall (to perform the function return).  These confuse the
-     find_sub_basic_blocks code, so we need to get rid of these.  */
+     find_many_sub_basic_blocks code, so we need to get rid of these.  */
   last = NEXT_INSN (last);
   gcc_assert (BARRIER_P (last));
 
@@ -1081,7 +1088,7 @@ expand_gimple_basic_block (basic_block bb, FILE * dump_file)
       e->flags &= ~EDGE_EXECUTABLE;
 
       /* At the moment not all abnormal edges match the RTL representation.
-         It is safe to remove them here as find_sub_basic_blocks will
+         It is safe to remove them here as find_many_sub_basic_blocks will
          rediscover them.  In the future we should get this fixed properly.  */
       if (e->flags & EDGE_ABNORMAL)
        remove_edge (e);
@@ -1131,7 +1138,7 @@ expand_gimple_basic_block (basic_block bb, FILE * dump_file)
 
   do_pending_stack_adjust ();
 
-  /* Find the the block tail.  The last insn is the block is the insn
+  /* Find the block tail.  The last insn in the block is the insn
      before a barrier and/or table jump insn.  */
   last = get_last_insn ();
   if (BARRIER_P (last))
@@ -1230,7 +1237,7 @@ construct_exit_block (void)
   ix = 0;
   while (ix < EDGE_COUNT (EXIT_BLOCK_PTR->preds))
     {
-      e = EDGE_I (EXIT_BLOCK_PTR->preds, ix);
+      e = EDGE_PRED (EXIT_BLOCK_PTR, ix);
       if (!(e->flags & EDGE_ABNORMAL))
        redirect_edge_succ (e, exit_block);
       else
@@ -1303,8 +1310,8 @@ tree_expand_cfg (void)
   /* We're done expanding trees to RTL.  */
   currently_expanding_to_rtl = 0;
 
-  /* Convert from NOTE_INSN_EH_REGION style notes, and do other
-     sorts of eh initialization.  */
+  /* Convert tree EH labels to RTL EH labels, and clean out any unreachable
+     EH regions.  */
   convert_from_eh_region_ranges ();
 
   rebuild_jump_labels (get_insns ());