]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cfgexpand.c (construct_exit_block): Don't disturb end of last BB.
authorJan Hubicka <jh@suse.cz>
Mon, 27 Nov 2006 15:07:10 +0000 (16:07 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Mon, 27 Nov 2006 15:07:10 +0000 (15:07 +0000)
* cfgexpand.c (construct_exit_block): Don't disturb end of last BB.
* rtl.texi (NOTE_INSN_FUNCTION_END): Remove.
* final.c (final_scan_insn): Don't scan NOTE_INSN_FUNCTION_END.
* insn-notes.def (FUNCTION_END): Remove.
* jump.c (delete_related_insns): Don't worry about FUNCTION_END.
(redicect_jump_2): Don't accept -1 parameter to remove FUNCTION_END
note.
* ifcvt.c (dead_or_predictable): Update call of redirect_jump_2.
* function.c (expand_function_end): Don't emit NOTE_INSN_FUNCTION_END
* cfglayout.c (duplicate_insn_chain): Don't worry about
NOTE_FUNCTION_END.

From-SVN: r119250

gcc/ChangeLog
gcc/cfgexpand.c
gcc/cfglayout.c
gcc/doc/rtl.texi
gcc/function.c
gcc/ifcvt.c
gcc/insn-notes.def
gcc/jump.c

index 4d4a97d14287c5073b85f4fa4bcd69809df6c134..e40e259fe658a6c4143708a55537444b2f4eb2c2 100644 (file)
@@ -1,3 +1,17 @@
+2006-11-27  Jan Hubicka  <jh@suse.cz>
+
+       * cfgexpand.c (construct_exit_block): Don't disturb end of last BB.
+       * rtl.texi (NOTE_INSN_FUNCTION_END): Remove.
+       * final.c (final_scan_insn): Don't scan NOTE_INSN_FUNCTION_END.
+       * insn-notes.def (FUNCTION_END): Remove.
+       * jump.c (delete_related_insns): Don't worry about FUNCTION_END.
+       (redicect_jump_2): Don't accept -1 parameter to remove FUNCTION_END
+       note.
+       * ifcvt.c (dead_or_predictable): Update call of redirect_jump_2.
+       * function.c (expand_function_end): Don't emit NOTE_INSN_FUNCTION_END
+       * cfglayout.c (duplicate_insn_chain): Don't worry about
+       NOTE_FUNCTION_END.
+
 2006-11-27  Richard Guenther  <rguenther@suse.de>
        Zdenek Dvorak <dvorakz@suse.cz>
 
index 76f603f78200de14f7cd9b9e107f79f210861dad..d0a560ec00bd94c1fa9250f831eaed2975acaf29 100644 (file)
@@ -1465,6 +1465,7 @@ construct_exit_block (void)
   edge e, e2;
   unsigned ix;
   edge_iterator ei;
+  rtx orig_end = BB_END (EXIT_BLOCK_PTR->prev_bb);
 
   /* Make sure the locus is set to the end of the function, so that
      epilogue line numbers and warnings are set properly.  */
@@ -1484,6 +1485,9 @@ construct_exit_block (void)
   end = get_last_insn ();
   if (head == end)
     return;
+  /* While emitting the function end we could move end of the last basic block.
+   */
+  BB_END (EXIT_BLOCK_PTR->prev_bb) = orig_end;
   while (NEXT_INSN (head) && NOTE_P (NEXT_INSN (head)))
     head = NEXT_INSN (head);
   exit_block = create_basic_block (NEXT_INSN (head), end,
index cf76cdb4125304a8aee6b95a6d65828f6ba1305b..15bde05de011ab363954c1611225c254ccf3581e 100644 (file)
@@ -987,7 +987,6 @@ duplicate_insn_chain (rtx from, rtx to)
            case NOTE_INSN_DELETED_LABEL:
              /* No problem to strip these.  */
            case NOTE_INSN_EPILOGUE_BEG:
-           case NOTE_INSN_FUNCTION_END:
              /* Debug code expect these notes to exist just once.
                 Keep them in the master copy.
                 ??? It probably makes more sense to duplicate them for each
index d97b2b327efe4b386bdedcd15ca63dec4568acd7..2d4644d587380ee18df0ca028600398107ef9933 100644 (file)
@@ -3178,13 +3178,6 @@ invariants.
 Appears at the start of the function body, after the function
 prologue.
 
-@findex NOTE_INSN_FUNCTION_END
-@item NOTE_INSN_FUNCTION_END
-Appears near the end of the function body, just before the label that
-@code{return} statements jump to (on machine where a single instruction
-does not suffice for returning).  This note may be deleted by jump
-optimization.
-
 @end table
 
 These codes are printed symbolically when they appear in debugging dumps.
index 78dfe81a7fbb84db5b6e4a948928f8ef3e9f2670..da93fa2af6ec5b812c4260915c75c866b59724f3 100644 (file)
@@ -4342,11 +4342,6 @@ expand_function_end (void)
   clear_pending_stack_adjust ();
   do_pending_stack_adjust ();
 
-  /* Mark the end of the function body.
-     If control reaches this insn, the function can drop through
-     without returning a value.  */
-  emit_note (NOTE_INSN_FUNCTION_END);
-
   /* Output a linenumber for the end of the function.
      SDB depends on this.  */
   force_next_line_note ();
@@ -5289,15 +5284,14 @@ epilogue_done:
 
       /* Similarly, move any line notes that appear after the epilogue.
          There is no need, however, to be quite so anal about the existence
-        of such a note.  Also move the NOTE_INSN_FUNCTION_END and (possibly)
+        of such a note.  Also possibly move
         NOTE_INSN_FUNCTION_BEG notes, as those can be relevant for debug
         info generation.  */
       for (insn = epilogue_end; insn; insn = next)
        {
          next = NEXT_INSN (insn);
          if (NOTE_P (insn) 
-             && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG
-                 || NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_END))
+             && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG))
            reorder_insns (insn, insn, PREV_INSN (epilogue_end));
        }
     }
index 602836096c57508162609fa3ada6f084c2458024..b869092ed774a55d6848353e2079ddbec020888f 100644 (file)
@@ -3773,7 +3773,7 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb,
 
   if (other_bb != new_dest)
     {
-      redirect_jump_2 (jump, old_dest, new_label, -1, reversep);
+      redirect_jump_2 (jump, old_dest, new_label, 0, reversep);
 
       redirect_edge_succ (BRANCH_EDGE (test_bb), new_dest);
       if (reversep)
index 9f942bb354d45cdb460c621110679543d66c51c9..b93d6c2f4820be0e3ead4e257c434a108f623652 100644 (file)
@@ -48,13 +48,6 @@ INSN_NOTE (BLOCK_END)
    their homes, etc.  */
 INSN_NOTE (FUNCTION_BEG)
 
-/* This kind of note is generated at the end of the function body,
-   just before the return insn or return label.  In an optimizing
-   compilation it is deleted by the first jump optimization, after
-   enabling that optimizer to determine whether control can fall
-   off the end of the function body without a return statement.  */
-INSN_NOTE (FUNCTION_END)
-
 /* This marks the point immediately after the last prologue insn.  */
 INSN_NOTE (PROLOGUE_END)
 
index 127e8a800c3092bf823d94abc32a1a7002702e21..807f2c6f7d6f2865fa595488b1398379a819dd7e 100644 (file)
@@ -1467,8 +1467,7 @@ delete_related_insns (rtx insn)
       while (next)
        {
          code = GET_CODE (next);
-         if (code == NOTE
-             && NOTE_LINE_NUMBER (next) != NOTE_INSN_FUNCTION_END)
+         if (code == NOTE)
            next = NEXT_INSN (next);
          /* Keep going past other deleted labels to delete what follows.  */
          else if (code == CODE_LABEL && INSN_DELETED_P (next))
@@ -1631,8 +1630,7 @@ redirect_jump (rtx jump, rtx nlabel, int delete_unused)
 }
 
 /* Fix up JUMP_LABEL and label ref counts after OLABEL has been replaced with
-   NLABEL in JUMP.  If DELETE_UNUSED is non-negative, copy a
-   NOTE_INSN_FUNCTION_END found after OLABEL to the place after NLABEL.
+   NLABEL in JUMP.  
    If DELETE_UNUSED is positive, delete related insn to OLABEL if its ref
    count has dropped to zero.  */
 void
@@ -1641,6 +1639,10 @@ redirect_jump_2 (rtx jump, rtx olabel, rtx nlabel, int delete_unused,
 {
   rtx note;
 
+  /* negative DELETE_UNUSED used to be used to signalize behaviour on
+     moving FUNCTION_END note.  Just sanity check that no user still worry
+     about this.  */
+  gcc_assert (delete_unused >= 0);
   JUMP_LABEL (jump) = nlabel;
   if (nlabel)
     ++LABEL_NUSES (nlabel);
@@ -1657,15 +1659,6 @@ redirect_jump_2 (rtx jump, rtx olabel, rtx nlabel, int delete_unused,
        }
     }
 
-  /* If we're eliding the jump over exception cleanups at the end of a
-     function, move the function end note so that -Wreturn-type works.  */
-  if (olabel && nlabel
-      && NEXT_INSN (olabel)
-      && NOTE_P (NEXT_INSN (olabel))
-      && NOTE_LINE_NUMBER (NEXT_INSN (olabel)) == NOTE_INSN_FUNCTION_END
-      && delete_unused >= 0)
-    emit_note_after (NOTE_INSN_FUNCTION_END, nlabel);
-
   if (olabel && --LABEL_NUSES (olabel) == 0 && delete_unused > 0
       /* Undefined labels will remain outside the insn stream.  */
       && INSN_UID (olabel))