aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/cfgbuild.c9
-rw-r--r--gcc/cfgrtl.c3
-rw-r--r--gcc/dwarf2cfi.c6
-rw-r--r--gcc/except.c3
-rw-r--r--gcc/function.h2
-rw-r--r--gcc/jump.c12
-rw-r--r--gcc/reload1.c7
-rw-r--r--gcc/stmt.c4
9 files changed, 39 insertions, 19 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2cfb164..baff0c6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,17 @@
2016-08-27 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
+ * cfgbuild.c (make_edges): Adjust.
+ * cfgrtl.c (can_delete_label_p): Likewise.
+ * dwarf2cfi.c (create_trace_edges): Likewise.
+ * except.c (sjlj_emit_dispatch_table): Likewise.
+ * function.h (struct expr_status): make x_forced_labels a vector.
+ * jump.c (rebuild_jump_labels_1): Adjust.
+ * reload1.c (set_initial_label_offsets): Likewise.
+ * stmt.c (force_label_rtx): Likewise.
+ (expand_label): Likewise.
+
+2016-08-27 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
+
* haifa-sched.c (fix_recovery_deps): Make ready_list a vector.
2016-08-27 Patrick Palka <ppalka@gcc.gnu.org>
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c
index c1ec46a..edecab5 100644
--- a/gcc/cfgbuild.c
+++ b/gcc/cfgbuild.c
@@ -204,7 +204,8 @@ make_edges (basic_block min, basic_block max, int update_p)
/* Heavy use of computed goto in machine-generated code can lead to
nearly fully-connected CFGs. In that case we spend a significant
amount of time searching the edge lists for duplicates. */
- if (forced_labels || cfun->cfg->max_jumptable_ents > 100)
+ if (!vec_safe_is_empty (forced_labels)
+ || cfun->cfg->max_jumptable_ents > 100)
edge_cache = sbitmap_alloc (last_basic_block_for_fn (cfun));
/* By nature of the way these get numbered, ENTRY_BLOCK_PTR->next_bb block
@@ -280,8 +281,10 @@ make_edges (basic_block min, basic_block max, int update_p)
everything on the forced_labels list. */
else if (computed_jump_p (insn))
{
- for (rtx_insn_list *x = forced_labels; x; x = x->next ())
- make_label_edge (edge_cache, bb, x->insn (), EDGE_ABNORMAL);
+ rtx_insn *insn;
+ unsigned int i;
+ FOR_EACH_VEC_SAFE_ELT (forced_labels, i, insn)
+ make_label_edge (edge_cache, bb, insn, EDGE_ABNORMAL);
}
/* Returns create an exit out. */
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 0d335fc..de07fcd 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -115,7 +115,8 @@ can_delete_label_p (const rtx_code_label *label)
return (!LABEL_PRESERVE_P (label)
/* User declared labels must be preserved. */
&& LABEL_NAME (label) == 0
- && !in_insn_list_p (forced_labels, label));
+ && !vec_safe_contains<rtx_insn *> (forced_labels,
+ const_cast<rtx_code_label *> (label)));
}
/* Delete INSN by patching it out. */
diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
index bcf79f5..6491d5a 100644
--- a/gcc/dwarf2cfi.c
+++ b/gcc/dwarf2cfi.c
@@ -2354,8 +2354,10 @@ create_trace_edges (rtx_insn *insn)
}
else if (computed_jump_p (insn))
{
- for (rtx_insn_list *lab = forced_labels; lab; lab = lab->next ())
- maybe_record_trace_start (lab->insn (), insn);
+ rtx_insn *temp;
+ unsigned int i;
+ FOR_EACH_VEC_SAFE_ELT (forced_labels, i, temp)
+ maybe_record_trace_start (temp, insn);
}
else if (returnjump_p (insn))
;
diff --git a/gcc/except.c b/gcc/except.c
index 8aeb4e8..bc6f30c 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -1278,8 +1278,7 @@ sjlj_emit_dispatch_table (rtx_code_label *dispatch_label, int num_dispatch)
label on the nonlocal_goto_label list. Since we're modeling these
CFG edges more exactly, we can use the forced_labels list instead. */
LABEL_PRESERVE_P (dispatch_label) = 1;
- forced_labels
- = gen_rtx_INSN_LIST (VOIDmode, dispatch_label, forced_labels);
+ vec_safe_push<rtx_insn *> (forced_labels, dispatch_label);
#endif
/* Load up exc_ptr and filter values from the function context. */
diff --git a/gcc/function.h b/gcc/function.h
index 501ef68..590a490 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -126,7 +126,7 @@ struct GTY(()) expr_status {
rtx x_apply_args_value;
/* List of labels that must never be deleted. */
- rtx_insn_list *x_forced_labels;
+ vec<rtx_insn *, va_gc> *x_forced_labels;
};
typedef struct call_site_record_d *call_site_record;
diff --git a/gcc/jump.c b/gcc/jump.c
index 5b433af..22f8a71 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -68,8 +68,6 @@ static int invert_exp_1 (rtx, rtx);
static void
rebuild_jump_labels_1 (rtx_insn *f, bool count_forced)
{
- rtx_insn_list *insn;
-
timevar_push (TV_REBUILD_JUMP);
init_label_info (f);
mark_all_labels (f);
@@ -79,9 +77,13 @@ 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 = insn->next ())
- if (LABEL_P (insn->insn ()))
- LABEL_NUSES (insn->insn ())++;
+ {
+ rtx_insn *insn;
+ unsigned int i;
+ FOR_EACH_VEC_SAFE_ELT (forced_labels, i, insn)
+ if (LABEL_P (insn))
+ LABEL_NUSES (insn)++;
+ }
timevar_pop (TV_REBUILD_JUMP);
}
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 04cf212..2a9a562 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -3888,9 +3888,10 @@ set_initial_label_offsets (void)
{
memset (offsets_known_at, 0, num_labels);
- for (rtx_insn_list *x = forced_labels; x; x = x->next ())
- if (x->insn ())
- set_label_offsets (x->insn (), NULL, 1);
+ unsigned int i;
+ rtx_insn *insn;
+ FOR_EACH_VEC_SAFE_ELT (forced_labels, i, insn)
+ set_label_offsets (insn, NULL, 1);
for (rtx_insn_list *x = nonlocal_goto_handler_labels; x; x = x->next ())
if (x->insn ())
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 2e9072f..1bae9e9 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -136,7 +136,7 @@ force_label_rtx (tree label)
gcc_assert (function);
- forced_labels = gen_rtx_INSN_LIST (VOIDmode, ref, forced_labels);
+ vec_safe_push (forced_labels, ref);
return ref;
}
@@ -190,7 +190,7 @@ expand_label (tree label)
}
if (FORCED_LABEL (label))
- forced_labels = gen_rtx_INSN_LIST (VOIDmode, label_r, forced_labels);
+ vec_safe_push<rtx_insn *> (forced_labels, label_r);
if (DECL_NONLOCAL (label) || FORCED_LABEL (label))
maybe_set_first_label_num (label_r);