2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2024-12-22 00:59:55 +08:00

flow.c (flow_delete_insn): If we delete a CODE_LABEL...

* flow.c (flow_delete_insn): If we delete a CODE_LABEL, also remove
	it from the nonlocal_goto_handler_labels list.
	* jump.c (delete_insn): Likewise.
	(jump_optimize_1): Also recompute LABEL_NUSES when we are just
	marking labels.
	* rtl.h (remove_node_from_expr_list): Declare.
	* rtlanal.c (remove_node_from_expr_list): New function.

From-SVN: r26361
This commit is contained in:
Jeffrey A Law 1999-04-12 02:18:55 +00:00 committed by Jeff Law
parent 21b2cd7321
commit 55a98783c8
5 changed files with 52 additions and 5 deletions

View File

@ -1,3 +1,13 @@
Mon Apr 12 03:11:30 1999 Jeffrey A Law (law@cygnus.com)
* flow.c (flow_delete_insn): If we delete a CODE_LABEL, also remove
it from the nonlocal_goto_handler_labels list.
* jump.c (delete_insn): Likewise.
(jump_optimize_1): Also recompute LABEL_NUSES when we are just
marking labels.
* rtl.h (remove_node_from_expr_list): Declare.
* rtlanal.c (remove_node_from_expr_list): New function.
Mon Apr 12 02:37:02 1999 Jan Hubicka <hubicka@freesoft.cz>
* reg-stack.c: Update comment, include varray.h.

View File

@ -1802,6 +1802,9 @@ flow_delete_insn (insn)
else
set_last_insn (prev);
if (GET_CODE (insn) == CODE_LABEL)
remove_node_from_expr_list (insn, &nonlocal_goto_handler_labels);
/* If deleting a jump, decrement the use count of the label. Deleting
the label itself should happen in the normal course of block merging. */
if (GET_CODE (insn) == JUMP_INSN && JUMP_LABEL (insn))

View File

@ -210,11 +210,6 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only)
mark_all_labels (f, cross_jump);
/* Quit now if we just wanted to rebuild the JUMP_LABEL and REG_LABEL
notes. */
if (mark_labels_only)
return;
/* Keep track of labels used from static data;
they cannot ever be deleted. */
@ -229,6 +224,11 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only)
for (insn = exception_handler_labels; insn; insn = XEXP (insn, 1))
LABEL_NUSES (XEXP (insn, 0))++;
/* Quit now if we just wanted to rebuild the JUMP_LABEL and REG_LABEL
notes and recompute LABEL_NUSES. */
if (mark_labels_only)
return;
exception_optimize ();
last_insn = delete_unreferenced_labels (f);
@ -3922,6 +3922,9 @@ delete_insn (insn)
if (INSN_DELETED_P (insn))
return next;
if (was_code_label)
remove_node_from_expr_list (insn, &nonlocal_goto_handler_labels);
/* Don't delete user-declared labels. Convert them to special NOTEs
instead. */
if (was_code_label && LABEL_NAME (insn) != 0

View File

@ -1081,6 +1081,7 @@ typedef int (*rtx_function) PROTO((rtx *, void *));
extern int for_each_rtx PROTO((rtx *, rtx_function, void *));
extern rtx regno_use_in PROTO((int, rtx));
extern int auto_inc_p PROTO((rtx));
extern void remove_node_from_expr_list PROTO((rtx, rtx *));
/* flow.c */

View File

@ -1529,6 +1529,36 @@ remove_note (insn, note)
abort ();
}
/* Search LISTP (an EXPR_LIST) for NODE and remove NODE from the list
if it is found.
A simple equality test is used to determine if NODE is on the
EXPR_LIST. */
void
remove_node_from_expr_list (node, listp)
rtx node;
rtx *listp;
{
rtx temp = *listp;
rtx prev = NULL_RTX;
while (temp)
{
if (node == XEXP (temp, 0))
{
/* Splice the node out of the list. */
if (prev)
XEXP (prev, 1) = XEXP (temp, 1);
else
*listp = XEXP (temp, 1);
return;
}
temp = XEXP (temp, 1);
}
}
/* Nonzero if X contains any volatile instructions. These are instructions
which may cause unpredictable machine state instructions, and thus no