Commit 2382940b by David Malcolm Committed by David Malcolm

rtl_data.x_nonlocal_goto_handler_labels becomes an rtx_expr_list

gcc/
2014-08-27  David Malcolm  <dmalcolm@redhat.com>

	* function.h (struct rtl_data): Strengthen field
	x_nonlocal_goto_handler_labels from rtx to rtx_expr_list *.
	* rtl.h (remove_node_from_expr_list): Strengthen second param from
	rtx * to rtx_expr_list **.

	* cfgbuild.c (make_edges): In loop over
	nonlocal_goto_handler_labels, strengthen local "x" from rtx to
	rtx_expr_list *, and use methods of the latter class to clarify
	the code.
	* cfgrtl.c (cfg_layout_initialize): Strengthen local "x" from rtx to
	rtx_expr_list *, and use methods of the latter class to clarify
	the code.
	* dwarf2cfi.c (create_trace_edges): Likewise for local "lab".
	* reload1.c (set_initial_label_offsets): Likewise for local "x".
	* rtlanal.c (remove_node_from_expr_list): Strengthen param "listp"
	from rtx * to rtx_expr_list **.  Strengthen local "temp" from rtx
	to rtx_expr_list *.  Use methods of the latter class to clarify
	the code.

From-SVN: r214603
parent ca486330
2014-08-27 David Malcolm <dmalcolm@redhat.com> 2014-08-27 David Malcolm <dmalcolm@redhat.com>
* function.h (struct rtl_data): Strengthen field
x_nonlocal_goto_handler_labels from rtx to rtx_expr_list *.
* rtl.h (remove_node_from_expr_list): Strengthen second param from
rtx * to rtx_expr_list **.
* cfgbuild.c (make_edges): In loop over
nonlocal_goto_handler_labels, strengthen local "x" from rtx to
rtx_expr_list *, and use methods of the latter class to clarify
the code.
* cfgrtl.c (cfg_layout_initialize): Strengthen local "x" from rtx to
rtx_expr_list *, and use methods of the latter class to clarify
the code.
* dwarf2cfi.c (create_trace_edges): Likewise for local "lab".
* reload1.c (set_initial_label_offsets): Likewise for local "x".
* rtlanal.c (remove_node_from_expr_list): Strengthen param "listp"
from rtx * to rtx_expr_list **. Strengthen local "temp" from rtx
to rtx_expr_list *. Use methods of the latter class to clarify
the code.
2014-08-27 David Malcolm <dmalcolm@redhat.com>
* function.h (struct expr_status): Strengthen field * function.h (struct expr_status): Strengthen field
"x_forced_labels" from rtx to rtx_expr_list *. "x_forced_labels" from rtx to rtx_expr_list *.
......
...@@ -337,8 +337,10 @@ make_edges (basic_block min, basic_block max, int update_p) ...@@ -337,8 +337,10 @@ make_edges (basic_block min, basic_block max, int update_p)
taken, then only calls to those functions or to other taken, then only calls to those functions or to other
nested functions that use them could possibly do nested functions that use them could possibly do
nonlocal gotos. */ nonlocal gotos. */
for (rtx x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1)) for (rtx_expr_list *x = nonlocal_goto_handler_labels;
make_label_edge (edge_cache, bb, XEXP (x, 0), x;
x = x->next ())
make_label_edge (edge_cache, bb, x->element (),
EDGE_ABNORMAL | EDGE_ABNORMAL_CALL); EDGE_ABNORMAL | EDGE_ABNORMAL_CALL);
} }
......
...@@ -4216,7 +4216,7 @@ cfg_layout_duplicate_bb (basic_block bb) ...@@ -4216,7 +4216,7 @@ cfg_layout_duplicate_bb (basic_block bb)
void void
cfg_layout_initialize (unsigned int flags) cfg_layout_initialize (unsigned int flags)
{ {
rtx x; rtx_expr_list *x;
basic_block bb; basic_block bb;
/* Once bb partitioning is complete, cfg layout mode should not be /* Once bb partitioning is complete, cfg layout mode should not be
...@@ -4235,9 +4235,9 @@ cfg_layout_initialize (unsigned int flags) ...@@ -4235,9 +4235,9 @@ cfg_layout_initialize (unsigned int flags)
record_effective_endpoints (); record_effective_endpoints ();
/* Make sure that the targets of non local gotos are marked. */ /* Make sure that the targets of non local gotos are marked. */
for (x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1)) for (x = nonlocal_goto_handler_labels; x; x = x->next ())
{ {
bb = BLOCK_FOR_INSN (XEXP (x, 0)); bb = BLOCK_FOR_INSN (x->element ());
bb->flags |= BB_NON_LOCAL_GOTO_TARGET; bb->flags |= BB_NON_LOCAL_GOTO_TARGET;
} }
......
...@@ -2338,8 +2338,10 @@ create_trace_edges (rtx insn) ...@@ -2338,8 +2338,10 @@ create_trace_edges (rtx insn)
/* Process non-local goto edges. */ /* Process non-local goto edges. */
if (can_nonlocal_goto (insn)) if (can_nonlocal_goto (insn))
for (rtx lab = nonlocal_goto_handler_labels; lab; lab = XEXP (lab, 1)) for (rtx_expr_list *lab = nonlocal_goto_handler_labels;
maybe_record_trace_start_abnormal (XEXP (lab, 0), insn); lab;
lab = lab->next ())
maybe_record_trace_start_abnormal (lab->element (), insn);
} }
else if (rtx_sequence *seq = dyn_cast <rtx_sequence *> (PATTERN (insn))) else if (rtx_sequence *seq = dyn_cast <rtx_sequence *> (PATTERN (insn)))
{ {
......
...@@ -266,7 +266,7 @@ struct GTY(()) rtl_data { ...@@ -266,7 +266,7 @@ struct GTY(()) rtl_data {
/* List (chain of EXPR_LIST) of labels heading the current handlers for /* List (chain of EXPR_LIST) of labels heading the current handlers for
nonlocal gotos. */ nonlocal gotos. */
rtx x_nonlocal_goto_handler_labels; rtx_expr_list *x_nonlocal_goto_handler_labels;
/* Label that will go on function epilogue. /* Label that will go on function epilogue.
Jumping to this label serves as a "return" instruction Jumping to this label serves as a "return" instruction
......
...@@ -3915,9 +3915,9 @@ set_initial_label_offsets (void) ...@@ -3915,9 +3915,9 @@ set_initial_label_offsets (void)
if (x->element ()) if (x->element ())
set_label_offsets (x->element (), NULL, 1); set_label_offsets (x->element (), NULL, 1);
for (rtx x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1)) for (rtx_expr_list *x = nonlocal_goto_handler_labels; x; x = x->next ())
if (XEXP (x, 0)) if (x->element ())
set_label_offsets (XEXP (x, 0), NULL, 1); set_label_offsets (x->element (), NULL, 1);
for_each_eh_label (set_initial_eh_label_offset); for_each_eh_label (set_initial_eh_label_offset);
} }
......
...@@ -2828,7 +2828,7 @@ extern unsigned hash_rtx_cb (const_rtx, enum machine_mode, int *, int *, ...@@ -2828,7 +2828,7 @@ extern unsigned hash_rtx_cb (const_rtx, enum machine_mode, int *, int *,
extern rtx regno_use_in (unsigned int, rtx); extern rtx regno_use_in (unsigned int, rtx);
extern int auto_inc_p (const_rtx); extern int auto_inc_p (const_rtx);
extern int in_expr_list_p (const_rtx, const_rtx); extern int in_expr_list_p (const_rtx, const_rtx);
extern void remove_node_from_expr_list (const_rtx, rtx *); extern void remove_node_from_expr_list (const_rtx, rtx_expr_list **);
extern int loc_mentioned_in_p (rtx *, const_rtx); extern int loc_mentioned_in_p (rtx *, const_rtx);
extern rtx_insn *find_first_parameter_load (rtx, rtx); extern rtx_insn *find_first_parameter_load (rtx, rtx);
extern bool keep_with_call_p (const_rtx); extern bool keep_with_call_p (const_rtx);
......
...@@ -2134,26 +2134,26 @@ in_expr_list_p (const_rtx listp, const_rtx node) ...@@ -2134,26 +2134,26 @@ in_expr_list_p (const_rtx listp, const_rtx node)
A simple equality test is used to determine if NODE matches. */ A simple equality test is used to determine if NODE matches. */
void void
remove_node_from_expr_list (const_rtx node, rtx *listp) remove_node_from_expr_list (const_rtx node, rtx_expr_list **listp)
{ {
rtx temp = *listp; rtx_expr_list *temp = *listp;
rtx prev = NULL_RTX; rtx prev = NULL_RTX;
while (temp) while (temp)
{ {
if (node == XEXP (temp, 0)) if (node == temp->element ())
{ {
/* Splice the node out of the list. */ /* Splice the node out of the list. */
if (prev) if (prev)
XEXP (prev, 1) = XEXP (temp, 1); XEXP (prev, 1) = temp->next ();
else else
*listp = XEXP (temp, 1); *listp = temp->next ();
return; return;
} }
prev = temp; prev = temp;
temp = XEXP (temp, 1); temp = temp->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