Commit b47f38a5 by David Malcolm Committed by David Malcolm

jump.c: Use rtx_insn in a few places (also touches rtl.h and cfgexpand.c)

gcc/
	* rtl.h (rebuild_jump_labels): Strengthen param "f" from rtx to
	rtx_insn *.
	(rebuild_jump_labels_chain): Likewise for param "chain".

	* cfgexpand.c (pass_expand::execute): Add checked cast to
	rtx_insn * when calling rebuild_jump_labels_chain in region where
	we know e->insns.r is non-NULL.

	* jump.c (rebuild_jump_labels_1): Strengthen param "f" from rtx to
	rtx_insn *.
	(rebuild_jump_labels): Likewise.
	(rebuild_jump_labels_chain): Likewise for param "chain".
	(cleanup_barriers): Likewise for locals "insn", "next", "prev".
	(init_label_info): Likewise for param "f".
	(maybe_propagate_label_ref): Likewise for params "jump_insn",
	"prev_nonjump_insn".
	(mark_all_labels): Likewise for param "f" and locals "insn",
	"prev_nonjump_insn".

From-SVN: r214341
parent 070a1983
2014-08-22 David Malcolm <dmalcolm@redhat.com> 2014-08-22 David Malcolm <dmalcolm@redhat.com>
* rtl.h (rebuild_jump_labels): Strengthen param "f" from rtx to
rtx_insn *.
(rebuild_jump_labels_chain): Likewise for param "chain".
* cfgexpand.c (pass_expand::execute): Add checked cast to
rtx_insn * when calling rebuild_jump_labels_chain in region where
we know e->insns.r is non-NULL.
* jump.c (rebuild_jump_labels_1): Strengthen param "f" from rtx to
rtx_insn *.
(rebuild_jump_labels): Likewise.
(rebuild_jump_labels_chain): Likewise for param "chain".
(cleanup_barriers): Likewise for locals "insn", "next", "prev".
(init_label_info): Likewise for param "f".
(maybe_propagate_label_ref): Likewise for params "jump_insn",
"prev_nonjump_insn".
(mark_all_labels): Likewise for param "f" and locals "insn",
"prev_nonjump_insn".
2014-08-22 David Malcolm <dmalcolm@redhat.com>
* ira-int.h (struct ira_allocno_copy): Strengthen field "insn" * ira-int.h (struct ira_allocno_copy): Strengthen field "insn"
from rtx to rtx_insn *insn. from rtx to rtx_insn *insn.
(ira_create_copy): Strengthen param "insn" from rtx to rtx_insn *. (ira_create_copy): Strengthen param "insn" from rtx to rtx_insn *.
......
...@@ -5865,7 +5865,7 @@ pass_expand::execute (function *fun) ...@@ -5865,7 +5865,7 @@ pass_expand::execute (function *fun)
{ {
if (e->insns.r) if (e->insns.r)
{ {
rebuild_jump_labels_chain (e->insns.r); rebuild_jump_labels_chain (as_a <rtx_insn *> (e->insns.r));
/* Put insns after parm birth, but before /* Put insns after parm birth, but before
NOTE_INSNS_FUNCTION_BEG. */ NOTE_INSNS_FUNCTION_BEG. */
if (e->src == ENTRY_BLOCK_PTR_FOR_FN (fun) if (e->src == ENTRY_BLOCK_PTR_FOR_FN (fun)
......
...@@ -62,8 +62,8 @@ along with GCC; see the file COPYING3. If not see ...@@ -62,8 +62,8 @@ along with GCC; see the file COPYING3. If not see
or even change what is live at any point. or even change what is live at any point.
So perhaps let combiner do it. */ So perhaps let combiner do it. */
static void init_label_info (rtx); static void init_label_info (rtx_insn *);
static void mark_all_labels (rtx); static void mark_all_labels (rtx_insn *);
static void mark_jump_label_1 (rtx, rtx, bool, bool); static void mark_jump_label_1 (rtx, rtx, bool, bool);
static void mark_jump_label_asm (rtx, rtx); static void mark_jump_label_asm (rtx, rtx);
static void redirect_exp_1 (rtx *, rtx, rtx, rtx); static void redirect_exp_1 (rtx *, rtx, rtx, rtx);
...@@ -72,7 +72,7 @@ static int returnjump_p_1 (rtx *, void *); ...@@ -72,7 +72,7 @@ static int returnjump_p_1 (rtx *, void *);
/* Worker for rebuild_jump_labels and rebuild_jump_labels_chain. */ /* Worker for rebuild_jump_labels and rebuild_jump_labels_chain. */
static void static void
rebuild_jump_labels_1 (rtx f, bool count_forced) rebuild_jump_labels_1 (rtx_insn *f, bool count_forced)
{ {
rtx insn; rtx insn;
...@@ -96,7 +96,7 @@ rebuild_jump_labels_1 (rtx f, bool count_forced) ...@@ -96,7 +96,7 @@ rebuild_jump_labels_1 (rtx f, bool count_forced)
instructions and jumping insns that have labels as operands instructions and jumping insns that have labels as operands
(e.g. cbranchsi4). */ (e.g. cbranchsi4). */
void void
rebuild_jump_labels (rtx f) rebuild_jump_labels (rtx_insn *f)
{ {
rebuild_jump_labels_1 (f, true); rebuild_jump_labels_1 (f, true);
} }
...@@ -105,7 +105,7 @@ rebuild_jump_labels (rtx f) ...@@ -105,7 +105,7 @@ rebuild_jump_labels (rtx f)
forced_labels. It can be used on insn chains that aren't the forced_labels. It can be used on insn chains that aren't the
main function chain. */ main function chain. */
void void
rebuild_jump_labels_chain (rtx chain) rebuild_jump_labels_chain (rtx_insn *chain)
{ {
rebuild_jump_labels_1 (chain, false); rebuild_jump_labels_1 (chain, false);
} }
...@@ -121,12 +121,12 @@ rebuild_jump_labels_chain (rtx chain) ...@@ -121,12 +121,12 @@ rebuild_jump_labels_chain (rtx chain)
static unsigned int static unsigned int
cleanup_barriers (void) cleanup_barriers (void)
{ {
rtx insn; rtx_insn *insn;
for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{ {
if (BARRIER_P (insn)) if (BARRIER_P (insn))
{ {
rtx prev = prev_nonnote_insn (insn); rtx_insn *prev = prev_nonnote_insn (insn);
if (!prev) if (!prev)
continue; continue;
...@@ -134,7 +134,7 @@ cleanup_barriers (void) ...@@ -134,7 +134,7 @@ cleanup_barriers (void)
{ {
/* Make sure we do not split a call and its corresponding /* Make sure we do not split a call and its corresponding
CALL_ARG_LOCATION note. */ CALL_ARG_LOCATION note. */
rtx next = NEXT_INSN (prev); rtx_insn *next = NEXT_INSN (prev);
if (NOTE_P (next) if (NOTE_P (next)
&& NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION) && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
...@@ -191,9 +191,9 @@ make_pass_cleanup_barriers (gcc::context *ctxt) ...@@ -191,9 +191,9 @@ make_pass_cleanup_barriers (gcc::context *ctxt)
notes whose labels don't occur in the insn any more. */ notes whose labels don't occur in the insn any more. */
static void static void
init_label_info (rtx f) init_label_info (rtx_insn *f)
{ {
rtx insn; rtx_insn *insn;
for (insn = f; insn; insn = NEXT_INSN (insn)) for (insn = f; insn; insn = NEXT_INSN (insn))
{ {
...@@ -229,7 +229,7 @@ init_label_info (rtx f) ...@@ -229,7 +229,7 @@ init_label_info (rtx f)
load into a jump_insn that uses it. */ load into a jump_insn that uses it. */
static void static void
maybe_propagate_label_ref (rtx jump_insn, rtx prev_nonjump_insn) maybe_propagate_label_ref (rtx_insn *jump_insn, rtx_insn *prev_nonjump_insn)
{ {
rtx label_note, pc, pc_src; rtx label_note, pc, pc_src;
...@@ -277,9 +277,9 @@ maybe_propagate_label_ref (rtx jump_insn, rtx prev_nonjump_insn) ...@@ -277,9 +277,9 @@ maybe_propagate_label_ref (rtx jump_insn, rtx prev_nonjump_insn)
Combine consecutive labels, and count uses of labels. */ Combine consecutive labels, and count uses of labels. */
static void static void
mark_all_labels (rtx f) mark_all_labels (rtx_insn *f)
{ {
rtx insn; rtx_insn *insn;
if (current_ir_type () == IR_RTL_CFGLAYOUT) if (current_ir_type () == IR_RTL_CFGLAYOUT)
{ {
...@@ -309,7 +309,7 @@ mark_all_labels (rtx f) ...@@ -309,7 +309,7 @@ mark_all_labels (rtx f)
} }
else else
{ {
rtx prev_nonjump_insn = NULL; rtx_insn *prev_nonjump_insn = NULL;
for (insn = f; insn; insn = NEXT_INSN (insn)) for (insn = f; insn; insn = NEXT_INSN (insn))
{ {
if (INSN_DELETED_P (insn)) if (INSN_DELETED_P (insn))
......
...@@ -3056,8 +3056,8 @@ extern unsigned int reg_or_subregno (const_rtx); ...@@ -3056,8 +3056,8 @@ extern unsigned int reg_or_subregno (const_rtx);
extern int redirect_jump_1 (rtx, rtx); extern int redirect_jump_1 (rtx, rtx);
extern void redirect_jump_2 (rtx, rtx, rtx, int, int); extern void redirect_jump_2 (rtx, rtx, rtx, int, int);
extern int redirect_jump (rtx, rtx, int); extern int redirect_jump (rtx, rtx, int);
extern void rebuild_jump_labels (rtx); extern void rebuild_jump_labels (rtx_insn *);
extern void rebuild_jump_labels_chain (rtx); extern void rebuild_jump_labels_chain (rtx_insn *);
extern rtx reversed_comparison (const_rtx, enum machine_mode); extern rtx reversed_comparison (const_rtx, enum machine_mode);
extern enum rtx_code reversed_comparison_code (const_rtx, const_rtx); extern enum rtx_code reversed_comparison_code (const_rtx, const_rtx);
extern enum rtx_code reversed_comparison_code_parts (enum rtx_code, const_rtx, extern enum rtx_code reversed_comparison_code_parts (enum rtx_code, const_rtx,
......
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