Commit f5540cd4 by Richard Henderson

flow.c (commit_one_edge_insertion): Be prepared for a return insn to be inserted…

flow.c (commit_one_edge_insertion): Be prepared for a return insn to be inserted on the edge with a normal jump.

        * flow.c (commit_one_edge_insertion): Be prepared for a return
        insn to be inserted on the edge with a normal jump.
        * jump.c (jump_optimize_1): Don't look to create return isns.

        * flow.c (flow_delete_insn): Don't adjust reference count of notes.
        * jump.c (jump_optimize_1): Likewise.
        (returnjump_p): Verify the argument is a JUMP_INSN.
        * rtl.def (NOTE): Add 5th element for NOTE_INSN_DELETED_LABEL.

From-SVN: r33950
parent 23568fa0
2000-05-16 Richard Henderson <rth@cygnus.com>
* flow.c (commit_one_edge_insertion): Be prepared for a return
insn to be inserted on the edge with a normal jump.
* jump.c (jump_optimize_1): Don't look to create return isns.
* flow.c (flow_delete_insn): Don't adjust reference count of notes.
* jump.c (jump_optimize_1): Likewise.
(returnjump_p): Verify the argument is a JUMP_INSN.
* rtl.def (NOTE): Add 5th element for NOTE_INSN_DELETED_LABEL.
2000-05-16 Nick Clifton <nickc@cygnus.com> 2000-05-16 Nick Clifton <nickc@cygnus.com>
* config/m32r/m32r.c (small_insn_p): Use INSN_P() to replace * config/m32r/m32r.c (small_insn_p): Use INSN_P() to replace
...@@ -307,23 +318,23 @@ Fri May 12 19:03:58 2000 Philippe De Muyter <phdm@macqel.be> ...@@ -307,23 +318,23 @@ Fri May 12 19:03:58 2000 Philippe De Muyter <phdm@macqel.be>
2000-05-12 Zack Weinberg <zack@wolery.cumb.org> 2000-05-12 Zack Weinberg <zack@wolery.cumb.org>
* fixinc/fixfixes.c (IO_use_fix, IO_defn_fix, CTRL_use_fix, * fixinc/fixfixes.c (IO_use_fix, IO_defn_fix, CTRL_use_fix,
CTRL_defn_fix): Delete. CTRL_defn_fix): Delete.
(fix_char_macro_defines, fix_char_macro_uses): Rename to (fix_char_macro_defines, fix_char_macro_uses): Rename to
char_macro_def_fix and char_macro_use_fix, respectively. Put char_macro_def_fix and char_macro_use_fix, respectively. Put
them into the FIXUP_TABLE. Get the string to search for from them into the FIXUP_TABLE. Get the string to search for from
a c_fix_arg. a c_fix_arg.
(format_write): New function. (format_write): New function.
(format_fix): Use it. (format_fix): Use it.
(FIX_PROC_HEAD): Constify text parameter. (FIX_PROC_HEAD): Constify text parameter.
(machine_name_fix): Constify all char *s. (machine_name_fix): Constify all char *s.
* fixtests.c (skip_quote): Remove double static. * fixtests.c (skip_quote): Remove double static.
* inclhack.def (io_def_quotes, io_use_quotes, ctrl_def_quotes, * inclhack.def (io_def_quotes, io_use_quotes, ctrl_def_quotes,
ctrl_use_quotes): Update for new scheme. ctrl_use_quotes): Update for new scheme.
* fixincl.x: Regenerate. * fixincl.x: Regenerate.
2000-05-12 Alexandre Oliva <aoliva@cygnus.com> 2000-05-12 Alexandre Oliva <aoliva@cygnus.com>
...@@ -492,9 +503,9 @@ Wed 10 May 09:36:47 2000 Neil Booth <NeilB@earthling.net> ...@@ -492,9 +503,9 @@ Wed 10 May 09:36:47 2000 Neil Booth <NeilB@earthling.net>
Wed 10 May 09:08:30 2000 Neil Booth <NeilB@earthling.net> Wed 10 May 09:08:30 2000 Neil Booth <NeilB@earthling.net>
* cpplex.c (_cpp_lex_line): Maintain PREV_WHITESPACE flag * cpplex.c (_cpp_lex_line): Maintain PREV_WHITESPACE flag
when removing escaped newlines. Reverse sense of test for when removing escaped newlines. Reverse sense of test for
escaped newline. escaped newline.
2000-05-09 Richard Henderson <rth@cygnus.com> 2000-05-09 Richard Henderson <rth@cygnus.com>
...@@ -1206,17 +1217,17 @@ Thu May 4 09:45:12 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> ...@@ -1206,17 +1217,17 @@ Thu May 4 09:45:12 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
MEM_COPY_ATTRIBUTES. MEM_COPY_ATTRIBUTES.
2000-05-03 Robert Lipe <robertlipe@usa.net> 2000-05-03 Robert Lipe <robertlipe@usa.net>
* configure.in (i[34567]86-*-isc*) [tmake_file]: Add t-i386bare * configure.in (i[34567]86-*-isc*) [tmake_file]: Add t-i386bare
to suppress libgcc1. to suppress libgcc1.
(i[34567]86-*-sco3.2v5*) Likewise. (i[34567]86-*-sco3.2v5*) Likewise.
(i[34567]86-*-sco3.2v4*) Likewise. (i[34567]86-*-sco3.2v4*) Likewise.
(i[34567]86-*-sco) Likewise. (i[34567]86-*-sco) Likewise.
(i[34567]86-*-solaris2) Likewise. (i[34567]86-*-solaris2) Likewise.
(i[34567]86-*-sysv5*) Likewise. (i[34567]86-*-sysv5*) Likewise.
(i[34567]86-*-sysv4*) Likewise. (i[34567]86-*-sysv4*) Likewise.
(i[34567]86-*-udk*) Likewise. (i[34567]86-*-udk*) Likewise.
(i[34567]86-*-sysv*) Likewise. (i[34567]86-*-sysv*) Likewise.
2000-05-03 Zack Weinberg <zack@wolery.cumb.org> 2000-05-03 Zack Weinberg <zack@wolery.cumb.org>
...@@ -1242,14 +1253,14 @@ Thu May 4 09:45:12 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> ...@@ -1242,14 +1253,14 @@ Thu May 4 09:45:12 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
Wed May 3 21:01:46 2000 Jason Eckhardt <jle@cygnus.com> Wed May 3 21:01:46 2000 Jason Eckhardt <jle@cygnus.com>
* bb-reorder.c (struct reorder_block_def): Member succ removed. * bb-reorder.c (struct reorder_block_def): Member succ removed.
(REORDER_BLOCK_SUCC): Removed. (REORDER_BLOCK_SUCC): Removed.
(enum reorder_skip_type): Removed. (enum reorder_skip_type): Removed.
(skip_insns_between_block): Renamed to skip_insns_after_block. (skip_insns_between_block): Renamed to skip_insns_after_block.
Removed second argument. Removed dead code and cleaned up. Removed second argument. Removed dead code and cleaned up.
(make_reorder_chain): Removed use of REORDER_BLOCK_SUCC. (make_reorder_chain): Removed use of REORDER_BLOCK_SUCC.
(reorder_basic_blocks): Remove use of REORDER_SKIP_AFTER. Removed (reorder_basic_blocks): Remove use of REORDER_SKIP_AFTER. Removed
second parameter to skip_insns_after_block. second parameter to skip_insns_after_block.
Wed May 3 13:29:54 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Wed May 3 13:29:54 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
......
...@@ -1598,7 +1598,7 @@ static void ...@@ -1598,7 +1598,7 @@ static void
commit_one_edge_insertion (e) commit_one_edge_insertion (e)
edge e; edge e;
{ {
rtx before = NULL_RTX, after = NULL_RTX, insns, tmp; rtx before = NULL_RTX, after = NULL_RTX, insns, tmp, last;
basic_block bb; basic_block bb;
/* Pull the insns off the edge now since the edge might go away. */ /* Pull the insns off the edge now since the edge might go away. */
...@@ -1675,37 +1675,38 @@ commit_one_edge_insertion (e) ...@@ -1675,37 +1675,38 @@ commit_one_edge_insertion (e)
emit_insns_before (insns, before); emit_insns_before (insns, before);
if (before == bb->head) if (before == bb->head)
bb->head = insns; bb->head = insns;
last = prev_nonnote_insn (before);
} }
else else
{ {
rtx last = emit_insns_after (insns, after); last = emit_insns_after (insns, after);
if (after == bb->end) if (after == bb->end)
{ bb->end = last;
bb->end = last; }
if (GET_CODE (last) == JUMP_INSN) if (returnjump_p (last))
{ {
if (returnjump_p (last)) /* ??? Remove all outgoing edges from BB and add one for EXIT.
{ This is not currently a problem because this only happens
/* ??? Remove all outgoing edges from BB and add one for the (single) epilogue, which already has a fallthru edge
for EXIT. This is not currently a problem because to EXIT. */
this only happens for the (single) epilogue, which
already has a fallthru edge to EXIT. */ e = bb->succ;
if (e->dest != EXIT_BLOCK_PTR
e = bb->succ; || e->succ_next != NULL
if (e->dest != EXIT_BLOCK_PTR || (e->flags & EDGE_FALLTHRU) == 0)
|| e->succ_next != NULL abort ();
|| (e->flags & EDGE_FALLTHRU) == 0) e->flags &= ~EDGE_FALLTHRU;
abort ();
e->flags &= ~EDGE_FALLTHRU; emit_barrier_after (last);
bb->end = last;
emit_barrier_after (last);
} if (before)
else flow_delete_insn (before);
abort ();
}
}
} }
else if (GET_CODE (last) == JUMP_INSN)
abort ();
} }
/* Update the CFG for all queued instructions. */ /* Update the CFG for all queued instructions. */
...@@ -2027,11 +2028,14 @@ flow_delete_insn (insn) ...@@ -2027,11 +2028,14 @@ flow_delete_insn (insn)
/* If deleting a jump, decrement the use count of the label. Deleting /* If deleting a jump, decrement the use count of the label. Deleting
the label itself should happen in the normal course of block merging. */ the label itself should happen in the normal course of block merging. */
if (GET_CODE (insn) == JUMP_INSN && JUMP_LABEL (insn)) if (GET_CODE (insn) == JUMP_INSN
&& JUMP_LABEL (insn)
&& GET_CODE (JUMP_LABEL (insn)) == CODE_LABEL)
LABEL_NUSES (JUMP_LABEL (insn))--; LABEL_NUSES (JUMP_LABEL (insn))--;
/* Also if deleting an insn that references a label. */ /* Also if deleting an insn that references a label. */
else if ((note = find_reg_note (insn, REG_LABEL, NULL_RTX)) != NULL_RTX) else if ((note = find_reg_note (insn, REG_LABEL, NULL_RTX)) != NULL_RTX
&& GET_CODE (XEXP (note, 0)) == CODE_LABEL)
LABEL_NUSES (XEXP (note, 0))--; LABEL_NUSES (XEXP (note, 0))--;
return next; return next;
......
...@@ -231,11 +231,13 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, ...@@ -231,11 +231,13 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
mark_all_labels (f, cross_jump); mark_all_labels (f, cross_jump);
/* Keep track of labels used from static data; /* Keep track of labels used from static data; we don't track them
they cannot ever be deleted. */ closely enough to delete them here, so make sure their reference
count doesn't drop to zero. */
for (insn = forced_labels; insn; insn = XEXP (insn, 1)) for (insn = forced_labels; insn; insn = XEXP (insn, 1))
LABEL_NUSES (XEXP (insn, 0))++; if (GET_CODE (XEXP (insn, 0)) == CODE_LABEL)
LABEL_NUSES (XEXP (insn, 0))++;
check_exception_handler_labels (); check_exception_handler_labels ();
...@@ -381,14 +383,6 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, ...@@ -381,14 +383,6 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
} }
} }
/* If a jump references the end of the function, try to turn
it into a RETURN insn, possibly a conditional one. */
if (JUMP_LABEL (insn) != 0
&& (next_active_insn (JUMP_LABEL (insn)) == 0
|| GET_CODE (PATTERN (next_active_insn (JUMP_LABEL (insn))))
== RETURN))
changed |= redirect_jump (insn, NULL_RTX);
reallabelprev = prev_active_insn (JUMP_LABEL (insn)); reallabelprev = prev_active_insn (JUMP_LABEL (insn));
/* Detect jump to following insn. */ /* Detect jump to following insn. */
...@@ -2261,6 +2255,8 @@ int ...@@ -2261,6 +2255,8 @@ int
returnjump_p (insn) returnjump_p (insn)
rtx insn; rtx insn;
{ {
if (GET_CODE (insn) != JUMP_INSN)
return 0;
return for_each_rtx (&PATTERN (insn), returnjump_p_1, NULL); return for_each_rtx (&PATTERN (insn), returnjump_p_1, NULL);
} }
......
...@@ -421,9 +421,11 @@ DEF_RTL_EXPR(BARRIER, "barrier", "iuu", 'x') ...@@ -421,9 +421,11 @@ DEF_RTL_EXPR(BARRIER, "barrier", "iuu", 'x')
DEF_RTL_EXPR(CODE_LABEL, "code_label", "iuu00iss", 'x') DEF_RTL_EXPR(CODE_LABEL, "code_label", "iuu00iss", 'x')
/* Say where in the code a source line starts, for symbol table's sake. /* Say where in the code a source line starts, for symbol table's sake.
Contains a filename and a line number. Line numbers <= 0 are special; Operand:
See enum note_insn in rtl.h. */ 3: filename, if line number > 0, note-specific data otherwise.
DEF_RTL_EXPR(NOTE, "note", "iuu0n", 'x') 4: line number if > 0, enum note_insn otherwise.
5: unique number if line number == note_insn_deleted_label. */
DEF_RTL_EXPR(NOTE, "note", "iuu0ni", 'x')
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
Top level constituents of INSN, JUMP_INSN and CALL_INSN. Top level constituents of INSN, JUMP_INSN and CALL_INSN.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment