Use rtx_expr_list for expr_status.x_forced_labels
gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * function.h (struct expr_status): Strengthen field "x_forced_labels" from rtx to rtx_expr_list *. * cfgbuild.c (make_edges): Split local "x" into two locals, strengthening one from rtx to rtx_expr_list *, and using methods of said class. * dwarf2cfi.c (create_trace_edges): Split local "lab" out; within loop over forced_labels, introduce strengthen it from rtx to rtx_expr_list *, using methods to clarify the code. * jump.c (rebuild_jump_labels_1): Strengthen local "insn" from rtx to rtx_expr_list *, using methods of said class to clarify the code. * reload1.c (set_initial_label_offsets): Split local "x" into two per-loop variables, strengthening the first from rtx to rtx_expr_list * and using methods. From-SVN: r214602
This commit is contained in:
parent
38e60c554d
commit
ca486330c4
6 changed files with 37 additions and 21 deletions
|
@ -1,3 +1,21 @@
|
|||
2014-08-27 David Malcolm <dmalcolm@redhat.com>
|
||||
|
||||
* function.h (struct expr_status): Strengthen field
|
||||
"x_forced_labels" from rtx to rtx_expr_list *.
|
||||
|
||||
* cfgbuild.c (make_edges): Split local "x" into two locals,
|
||||
strengthening one from rtx to rtx_expr_list *, and using methods
|
||||
of said class.
|
||||
* dwarf2cfi.c (create_trace_edges): Split local "lab" out; within
|
||||
loop over forced_labels, introduce strengthen it from rtx to
|
||||
rtx_expr_list *, using methods to clarify the code.
|
||||
* jump.c (rebuild_jump_labels_1): Strengthen local "insn" from rtx
|
||||
to rtx_expr_list *, using methods of said class to clarify the
|
||||
code.
|
||||
* reload1.c (set_initial_label_offsets): Split local "x" into two
|
||||
per-loop variables, strengthening the first from rtx to
|
||||
rtx_expr_list * and using methods.
|
||||
|
||||
2014-08-27 David Malcolm <dmalcolm@redhat.com>
|
||||
|
||||
* coretypes.h (class rtx_expr_list): Add forward declaration.
|
||||
|
|
|
@ -219,7 +219,6 @@ make_edges (basic_block min, basic_block max, int update_p)
|
|||
FOR_BB_BETWEEN (bb, min, max->next_bb, next_bb)
|
||||
{
|
||||
rtx_insn *insn;
|
||||
rtx x;
|
||||
enum rtx_code code;
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
|
@ -285,8 +284,8 @@ make_edges (basic_block min, basic_block max, int update_p)
|
|||
everything on the forced_labels list. */
|
||||
else if (computed_jump_p (insn))
|
||||
{
|
||||
for (x = forced_labels; x; x = XEXP (x, 1))
|
||||
make_label_edge (edge_cache, bb, XEXP (x, 0), EDGE_ABNORMAL);
|
||||
for (rtx_expr_list *x = forced_labels; x; x = x->next ())
|
||||
make_label_edge (edge_cache, bb, x->element (), EDGE_ABNORMAL);
|
||||
}
|
||||
|
||||
/* Returns create an exit out. */
|
||||
|
@ -338,7 +337,7 @@ make_edges (basic_block min, basic_block max, int update_p)
|
|||
taken, then only calls to those functions or to other
|
||||
nested functions that use them could possibly do
|
||||
nonlocal gotos. */
|
||||
for (x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1))
|
||||
for (rtx x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1))
|
||||
make_label_edge (edge_cache, bb, XEXP (x, 0),
|
||||
EDGE_ABNORMAL | EDGE_ABNORMAL_CALL);
|
||||
}
|
||||
|
|
|
@ -2286,7 +2286,7 @@ maybe_record_trace_start_abnormal (rtx start, rtx origin)
|
|||
static void
|
||||
create_trace_edges (rtx insn)
|
||||
{
|
||||
rtx tmp, lab;
|
||||
rtx tmp;
|
||||
int i, n;
|
||||
|
||||
if (JUMP_P (insn))
|
||||
|
@ -2303,14 +2303,14 @@ create_trace_edges (rtx insn)
|
|||
n = GET_NUM_ELEM (vec);
|
||||
for (i = 0; i < n; ++i)
|
||||
{
|
||||
lab = XEXP (RTVEC_ELT (vec, i), 0);
|
||||
rtx lab = XEXP (RTVEC_ELT (vec, i), 0);
|
||||
maybe_record_trace_start (lab, insn);
|
||||
}
|
||||
}
|
||||
else if (computed_jump_p (insn))
|
||||
{
|
||||
for (lab = forced_labels; lab; lab = XEXP (lab, 1))
|
||||
maybe_record_trace_start (XEXP (lab, 0), insn);
|
||||
for (rtx_expr_list *lab = forced_labels; lab; lab = lab->next ())
|
||||
maybe_record_trace_start (lab->element (), insn);
|
||||
}
|
||||
else if (returnjump_p (insn))
|
||||
;
|
||||
|
@ -2319,13 +2319,13 @@ create_trace_edges (rtx insn)
|
|||
n = ASM_OPERANDS_LABEL_LENGTH (tmp);
|
||||
for (i = 0; i < n; ++i)
|
||||
{
|
||||
lab = XEXP (ASM_OPERANDS_LABEL (tmp, i), 0);
|
||||
rtx lab = XEXP (ASM_OPERANDS_LABEL (tmp, i), 0);
|
||||
maybe_record_trace_start (lab, insn);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lab = JUMP_LABEL (insn);
|
||||
rtx lab = JUMP_LABEL (insn);
|
||||
gcc_assert (lab != NULL);
|
||||
maybe_record_trace_start (lab, insn);
|
||||
}
|
||||
|
@ -2338,7 +2338,7 @@ create_trace_edges (rtx insn)
|
|||
|
||||
/* Process non-local goto edges. */
|
||||
if (can_nonlocal_goto (insn))
|
||||
for (lab = nonlocal_goto_handler_labels; lab; lab = XEXP (lab, 1))
|
||||
for (rtx lab = nonlocal_goto_handler_labels; lab; lab = XEXP (lab, 1))
|
||||
maybe_record_trace_start_abnormal (XEXP (lab, 0), insn);
|
||||
}
|
||||
else if (rtx_sequence *seq = dyn_cast <rtx_sequence *> (PATTERN (insn)))
|
||||
|
|
|
@ -135,7 +135,7 @@ struct GTY(()) expr_status {
|
|||
rtx x_apply_args_value;
|
||||
|
||||
/* List of labels that must never be deleted. */
|
||||
rtx x_forced_labels;
|
||||
rtx_expr_list *x_forced_labels;
|
||||
};
|
||||
|
||||
typedef struct call_site_record_d *call_site_record;
|
||||
|
|
|
@ -74,7 +74,7 @@ static int returnjump_p_1 (rtx *, void *);
|
|||
static void
|
||||
rebuild_jump_labels_1 (rtx_insn *f, bool count_forced)
|
||||
{
|
||||
rtx insn;
|
||||
rtx_expr_list *insn;
|
||||
|
||||
timevar_push (TV_REBUILD_JUMP);
|
||||
init_label_info (f);
|
||||
|
@ -85,9 +85,9 @@ rebuild_jump_labels_1 (rtx_insn *f, bool count_forced)
|
|||
count doesn't drop to zero. */
|
||||
|
||||
if (count_forced)
|
||||
for (insn = forced_labels; insn; insn = XEXP (insn, 1))
|
||||
if (LABEL_P (XEXP (insn, 0)))
|
||||
LABEL_NUSES (XEXP (insn, 0))++;
|
||||
for (insn = forced_labels; insn; insn = insn->next ())
|
||||
if (LABEL_P (insn->element ()))
|
||||
LABEL_NUSES (insn->element ())++;
|
||||
timevar_pop (TV_REBUILD_JUMP);
|
||||
}
|
||||
|
||||
|
|
|
@ -3909,14 +3909,13 @@ set_initial_eh_label_offset (rtx label)
|
|||
static void
|
||||
set_initial_label_offsets (void)
|
||||
{
|
||||
rtx x;
|
||||
memset (offsets_known_at, 0, num_labels);
|
||||
|
||||
for (x = forced_labels; x; x = XEXP (x, 1))
|
||||
if (XEXP (x, 0))
|
||||
set_label_offsets (XEXP (x, 0), NULL, 1);
|
||||
for (rtx_expr_list *x = forced_labels; x; x = x->next ())
|
||||
if (x->element ())
|
||||
set_label_offsets (x->element (), NULL, 1);
|
||||
|
||||
for (x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1))
|
||||
for (rtx x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1))
|
||||
if (XEXP (x, 0))
|
||||
set_label_offsets (XEXP (x, 0), NULL, 1);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue