bb-reorder.c (skip_insn_after_block): Get past the line number notes.
authorJan Hubicka <jh@suse.cz>
Sat, 14 Jul 2001 01:06:42 +0000 (03:06 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 14 Jul 2001 01:06:42 +0000 (01:06 +0000)
* bb-reorder.c (skip_insn_after_block): Get past the line number notes.

* flow.c (redirect_edge_and_branch_force, split_edge,
try_crossjump_to_edge): Use set_block_for_new_insns.
* bb-reorder.c (emit_jump_to_block_after): Call set_block_for_new_insns.

From-SVN: r44002

gcc/ChangeLog
gcc/bb-reorder.c
gcc/flow.c

index e68b7aff28b9494ba046227375cc108184b37526..7a365dc201965de0aa894fdabd76c2d52ab746b0 100644 (file)
@@ -1,3 +1,11 @@
+Sat Jul 14 02:58:38 CEST 2001  Jan Hubicka  <jh@suse.cz>
+
+       * bb-reorder.c (skip_insn_after_block): Get past the line number notes.
+
+       * flow.c (redirect_edge_and_branch_force, split_edge,
+       try_crossjump_to_edge): Use set_block_for_new_insns.
+       * bb-reorder.c (emit_jump_to_block_after): Call set_block_for_new_insns.
+
 2001-07-13  H.J. Lu  (hjl@gnu.org)
 
        * config/elfos.h (UNIQUE_SECTION): Enable .bss section with
index a6534d809dbbbfd775e3e9a37b1193b339a226ce..e2dc44c5053399e3dc4b66333dd9bd384fa587cd 100644 (file)
@@ -211,7 +211,7 @@ skip_insns_after_block (bb)
   if (bb->index + 1 != n_basic_blocks)
     next_head = BASIC_BLOCK (bb->index + 1)->head;
 
-  for (last_insn = bb->end; (insn = NEXT_INSN (last_insn)); last_insn = insn)
+  for (last_insn = insn = bb->end; (insn = NEXT_INSN (insn)); )
     {
       if (insn == next_head)
        break;
@@ -219,6 +219,7 @@ skip_insns_after_block (bb)
       switch (GET_CODE (insn))
        {
        case BARRIER:
+         last_insn = insn;
          continue;
 
        case NOTE:
@@ -226,11 +227,19 @@ skip_insns_after_block (bb)
            {
            case NOTE_INSN_LOOP_END:
            case NOTE_INSN_BLOCK_END:
+             last_insn = insn;
+             continue;
            case NOTE_INSN_DELETED:
            case NOTE_INSN_DELETED_LABEL:
              continue;
 
            default:
+             /* Make line notes attached to the succesor block unless they
+                are followed by something attached to predecesor block.
+                These notes remained after removing code in the predecesor
+                block and thus should be kept together.  */
+             if (NOTE_LINE_NUMBER (insn) >= 0)
+               continue;
              break;
            }
          break;
@@ -242,6 +251,7 @@ skip_insns_after_block (bb)
                  || GET_CODE (PATTERN (NEXT_INSN (insn))) == ADDR_DIFF_VEC))
            {
              insn = NEXT_INSN (insn);
+             last_insn = insn;
              continue;
            }
           break;
@@ -501,6 +511,8 @@ emit_jump_to_block_after (bb, after)
       jump = emit_jump_insn_after (gen_jump (label), after);
       JUMP_LABEL (jump) = label;
       LABEL_NUSES (label) += 1;
+      if (basic_block_for_insn)
+       set_block_for_new_insns (jump, bb);
 
       if (rtl_dump_file)
        fprintf (rtl_dump_file, "Emitting jump to block %d (%d)\n",
index 92f63099ff2d3b8dc86db01c36e22ba0d50a497c..652328f894c82b2e574cea5a6ccb48d1f664823e 100644 (file)
@@ -1897,7 +1897,7 @@ redirect_edge_and_branch_force (e, target)
       JUMP_LABEL (e->src->end) = label;
       LABEL_NUSES (label)++;
       if (basic_block_for_insn)
-       set_block_for_insn (e->src->end, e->src);
+       set_block_for_new_insns (e->src->end, e->src);
       emit_barrier_after (e->src->end);
       if (rtl_dump_file)
        fprintf (rtl_dump_file,
@@ -1971,7 +1971,7 @@ redirect_edge_and_branch_force (e, target)
   JUMP_LABEL (new_bb->end) = label;
   LABEL_NUSES (label)++;
   if (basic_block_for_insn)
-    set_block_for_insn (new_bb->end, new_bb);
+    set_block_for_new_insns (new_bb->end, new_bb);
   emit_barrier_after (new_bb->end);
   return new_bb;
 }
@@ -2074,7 +2074,7 @@ split_edge (edge_in)
                                      jump_block->end);
          jump_block->end = pos;
          if (basic_block_for_insn)
-           set_block_for_insn (pos, jump_block);
+           set_block_for_new_insns (pos, jump_block);
          emit_barrier_after (pos);
 
          /* ... let jump know that label is in use, ...  */
@@ -3555,7 +3555,7 @@ try_crossjump_to_edge (mode, e1, e2)
   JUMP_LABEL (e1->src->end) = label;
   LABEL_NUSES (label)++;
   if (basic_block_for_insn)
-    set_block_for_insn (e1->src->end, e1->src);
+    set_block_for_new_insns (e1->src->end, e1->src);
 
   flow_delete_insn_chain (first, last);