Commit 1519ae2c by Richard Henderson Committed by Richard Henderson

flow.c (delete_block): Delete the addr_vec along with the block.

        * flow.c (delete_block): Delete the addr_vec along with the block.
        (flow_delete_insn): Decrement LABEL_NUSES when deleting insns that
        reference labels.

From-SVN: r32635
parent b6166b4d
2000-03-19 Richard Henderson <rth@cygnus.com>
* flow.c (delete_block): Delete the addr_vec along with the block.
(flow_delete_insn): Decrement LABEL_NUSES when deleting insns that
reference labels.
2000-03-18 Mark Mitchell <mark@codesourcery.com> 2000-03-18 Mark Mitchell <mark@codesourcery.com>
* emit-rtl.c (remove_unncessary_notes): Check that all * emit-rtl.c (remove_unncessary_notes): Check that all
......
...@@ -1853,7 +1853,7 @@ delete_block (b) ...@@ -1853,7 +1853,7 @@ delete_block (b)
basic_block b; basic_block b;
{ {
int deleted_handler = 0; int deleted_handler = 0;
rtx insn, end; rtx insn, end, tmp;
/* If the head of this block is a CODE_LABEL, then it might be the /* If the head of this block is a CODE_LABEL, then it might be the
label for an exception handler which can't be reached. label for an exception handler which can't be reached.
...@@ -1902,11 +1902,22 @@ delete_block (b) ...@@ -1902,11 +1902,22 @@ delete_block (b)
} }
} }
/* Selectively unlink the insn chain. Include any BARRIER that may /* Include any jump table following the basic block. */
follow the basic block. */ end = b->end;
end = next_nonnote_insn (b->end); if (GET_CODE (end) == JUMP_INSN
if (!end || GET_CODE (end) != BARRIER) && (tmp = JUMP_LABEL (end)) != NULL_RTX
end = b->end; && (tmp = NEXT_INSN (tmp)) != NULL_RTX
&& GET_CODE (tmp) == JUMP_INSN
&& (GET_CODE (PATTERN (tmp)) == ADDR_VEC
|| GET_CODE (PATTERN (tmp)) == ADDR_DIFF_VEC))
end = tmp;
/* Include any barrier that may follow the basic block. */
tmp = next_nonnote_insn (b->end);
if (tmp && GET_CODE (tmp) == BARRIER)
end = tmp;
/* Selectively delete the entire chain. */
flow_delete_insn_chain (insn, end); flow_delete_insn_chain (insn, end);
no_delete_insns: no_delete_insns:
...@@ -1972,6 +1983,7 @@ flow_delete_insn (insn) ...@@ -1972,6 +1983,7 @@ flow_delete_insn (insn)
{ {
rtx prev = PREV_INSN (insn); rtx prev = PREV_INSN (insn);
rtx next = NEXT_INSN (insn); rtx next = NEXT_INSN (insn);
rtx note;
PREV_INSN (insn) = NULL_RTX; PREV_INSN (insn) = NULL_RTX;
NEXT_INSN (insn) = NULL_RTX; NEXT_INSN (insn) = NULL_RTX;
...@@ -1991,6 +2003,10 @@ flow_delete_insn (insn) ...@@ -1991,6 +2003,10 @@ flow_delete_insn (insn)
if (GET_CODE (insn) == JUMP_INSN && JUMP_LABEL (insn)) if (GET_CODE (insn) == JUMP_INSN && JUMP_LABEL (insn))
LABEL_NUSES (JUMP_LABEL (insn))--; LABEL_NUSES (JUMP_LABEL (insn))--;
/* Also if deleting an insn that references a label. */
else if ((note = find_reg_note (insn, REG_LABEL, NULL_RTX)) != NULL_RTX)
LABEL_NUSES (XEXP (note, 0))--;
return next; return next;
} }
......
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