diff options
author | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-27 20:33:38 +0000 |
---|---|---|
committer | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-27 20:33:38 +0000 |
commit | ae799283c5ecc25191575fb5ec2bc16d97674437 (patch) | |
tree | 66e196517fd89856bf4cc787decc8acce49a4e4a | |
parent | ede4900a3370698d85011d12fc89b3ff2e41e7bf (diff) | |
download | gcc-ae799283c5ecc25191575fb5ec2bc16d97674437.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214602 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 18 | ||||
-rw-r--r-- | gcc/cfgbuild.c | 7 | ||||
-rw-r--r-- | gcc/dwarf2cfi.c | 14 | ||||
-rw-r--r-- | gcc/function.h | 2 | ||||
-rw-r--r-- | gcc/jump.c | 8 | ||||
-rw-r--r-- | gcc/reload1.c | 9 |
6 files changed, 37 insertions, 21 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dbdae273604..e85db1a6797 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,23 @@ 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. * emit-rtl.c (gen_rtx_EXPR_LIST): New. * gengenrtl.c (special_rtx): Add EXPR_LIST. diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c index dd6ed7a00e1..05adac0cbc4 100644 --- a/gcc/cfgbuild.c +++ b/gcc/cfgbuild.c @@ -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); } diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c index 25571fa7bcd..3f4a0ad6d5c 100644 --- a/gcc/dwarf2cfi.c +++ b/gcc/dwarf2cfi.c @@ -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))) diff --git a/gcc/function.h b/gcc/function.h index 28a20f34b98..ba7597c2bdc 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -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; diff --git a/gcc/jump.c b/gcc/jump.c index a28300c2d73..b8d3d52cea9 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -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); } diff --git a/gcc/reload1.c b/gcc/reload1.c index 2bb8005329b..f7acd65f87a 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -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); |