Commit 7fa55ff6 by David Malcolm Committed by David Malcolm

Drop uncast_insn from param 1 of final_scan_insn

gcc/ChangeLog
2014-09-05  David Malcolm  <dmalcolm@redhat.com>

	* output.h (final_scan_insn): Strengthen first param from rtx to
	rtx_insn *.

	* final.c (final_scan_insn): Likewise, renaming it back from
	"uncast_insn" to "insn", eliminating the checked cast.

	* config/h8300/h8300.md (define_insn "jump"): Replace local rtx
	"vec" with an rtx_sequence * "seq", taking a copy of
	"final_sequence", and using methods of "seq" for clarity, and for
	type-safety in the calls to final_scan_insn.
	* config/mips/mips.c (mips_output_conditional_branch): Use methods
	of "final_sequence" for clarity, and for type-safety in the call to
	final_scan_insn.
	* config/sh/sh.c (print_slot): Strengthen param from rtx to
	rtx_sequence * and rename from "insn" to "seq".

From-SVN: r214961
parent 75677a67
2014-09-05 David Malcolm <dmalcolm@redhat.com> 2014-09-05 David Malcolm <dmalcolm@redhat.com>
* output.h (final_scan_insn): Strengthen first param from rtx to
rtx_insn *.
* final.c (final_scan_insn): Likewise, renaming it back from
"uncast_insn" to "insn", eliminating the checked cast.
* config/h8300/h8300.md (define_insn "jump"): Replace local rtx
"vec" with an rtx_sequence * "seq", taking a copy of
"final_sequence", and using methods of "seq" for clarity, and for
type-safety in the calls to final_scan_insn.
* config/mips/mips.c (mips_output_conditional_branch): Use methods
of "final_sequence" for clarity, and for type-safety in the call to
final_scan_insn.
* config/sh/sh.c (print_slot): Strengthen param from rtx to
rtx_sequence * and rename from "insn" to "seq".
2014-09-05 David Malcolm <dmalcolm@redhat.com>
* jump.c (delete_related_insns): Introduce a new local "table" by * jump.c (delete_related_insns): Introduce a new local "table" by
replacing JUMP_TABLE_DATA_P with a dyn_cast, then use the replacing JUMP_TABLE_DATA_P with a dyn_cast, then use the
get_labels method of "table" to simplify access to the labels in get_labels method of "table" to simplify access to the labels in
...@@ -2404,14 +2404,14 @@ ...@@ -2404,14 +2404,14 @@
bytes further than previously thought. The length-based bytes further than previously thought. The length-based
test for bra vs. jump is very conservative though, so the test for bra vs. jump is very conservative though, so the
branch will still be within range. */ branch will still be within range. */
rtvec vec; rtx_sequence *seq;
int seen; int seen;
vec = XVEC (final_sequence, 0); seq = final_sequence;
final_sequence = 0; final_sequence = 0;
final_scan_insn (RTVEC_ELT (vec, 1), asm_out_file, optimize, 1, & seen); final_scan_insn (seq->insn (1), asm_out_file, optimize, 1, & seen);
final_scan_insn (RTVEC_ELT (vec, 0), asm_out_file, optimize, 1, & seen); final_scan_insn (seq->insn (0), asm_out_file, optimize, 1, & seen);
INSN_DELETED_P (RTVEC_ELT (vec, 1)) = 1; INSN_DELETED_P (seq->insn (1)) = 1;
return ""; return "";
} }
} }
......
...@@ -12496,9 +12496,9 @@ mips_output_conditional_branch (rtx_insn *insn, rtx *operands, ...@@ -12496,9 +12496,9 @@ mips_output_conditional_branch (rtx_insn *insn, rtx *operands,
delay slot if is not annulled. */ delay slot if is not annulled. */
if (!INSN_ANNULLED_BRANCH_P (insn)) if (!INSN_ANNULLED_BRANCH_P (insn))
{ {
final_scan_insn (XVECEXP (final_sequence, 0, 1), final_scan_insn (final_sequence->insn (1),
asm_out_file, optimize, 1, NULL); asm_out_file, optimize, 1, NULL);
INSN_DELETED_P (XVECEXP (final_sequence, 0, 1)) = 1; INSN_DELETED_P (final_sequence->insn (1)) = 1;
} }
else else
output_asm_insn ("nop", 0); output_asm_insn ("nop", 0);
...@@ -12521,9 +12521,9 @@ mips_output_conditional_branch (rtx_insn *insn, rtx *operands, ...@@ -12521,9 +12521,9 @@ mips_output_conditional_branch (rtx_insn *insn, rtx *operands,
Use INSN's delay slot if is annulled. */ Use INSN's delay slot if is annulled. */
if (INSN_ANNULLED_BRANCH_P (insn)) if (INSN_ANNULLED_BRANCH_P (insn))
{ {
final_scan_insn (XVECEXP (final_sequence, 0, 1), final_scan_insn (final_sequence->insn (1),
asm_out_file, optimize, 1, NULL); asm_out_file, optimize, 1, NULL);
INSN_DELETED_P (XVECEXP (final_sequence, 0, 1)) = 1; INSN_DELETED_P (final_sequence->insn (1)) = 1;
} }
else else
output_asm_insn ("nop", 0); output_asm_insn ("nop", 0);
......
...@@ -184,7 +184,7 @@ static bool shmedia_space_reserved_for_target_registers; ...@@ -184,7 +184,7 @@ static bool shmedia_space_reserved_for_target_registers;
static void split_branches (rtx_insn *); static void split_branches (rtx_insn *);
static int branch_dest (rtx); static int branch_dest (rtx);
static void print_slot (rtx); static void print_slot (rtx_sequence *);
static rtx_code_label *add_constant (rtx, enum machine_mode, rtx); static rtx_code_label *add_constant (rtx, enum machine_mode, rtx);
static void dump_table (rtx_insn *, rtx_insn *); static void dump_table (rtx_insn *, rtx_insn *);
static bool broken_move (rtx_insn *); static bool broken_move (rtx_insn *);
...@@ -2641,11 +2641,11 @@ output_movedouble (rtx insn ATTRIBUTE_UNUSED, rtx operands[], ...@@ -2641,11 +2641,11 @@ output_movedouble (rtx insn ATTRIBUTE_UNUSED, rtx operands[],
another instruction, but couldn't because the other instruction expanded another instruction, but couldn't because the other instruction expanded
into a sequence where putting the slot insn at the end wouldn't work. */ into a sequence where putting the slot insn at the end wouldn't work. */
static void static void
print_slot (rtx insn) print_slot (rtx_sequence *seq)
{ {
final_scan_insn (XVECEXP (insn, 0, 1), asm_out_file, optimize, 1, NULL); final_scan_insn (seq->insn (1), asm_out_file, optimize, 1, NULL);
INSN_DELETED_P (XVECEXP (insn, 0, 1)) = 1; INSN_DELETED_P (seq->insn (1)) = 1;
} }
const char * const char *
......
...@@ -2171,7 +2171,7 @@ call_from_call_insn (rtx_call_insn *insn) ...@@ -2171,7 +2171,7 @@ call_from_call_insn (rtx_call_insn *insn)
both NOTE_INSN_PROLOGUE_END and NOTE_INSN_FUNCTION_BEG. */ both NOTE_INSN_PROLOGUE_END and NOTE_INSN_FUNCTION_BEG. */
rtx_insn * rtx_insn *
final_scan_insn (rtx uncast_insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED, final_scan_insn (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
int nopeepholes ATTRIBUTE_UNUSED, int *seen) int nopeepholes ATTRIBUTE_UNUSED, int *seen)
{ {
#ifdef HAVE_cc0 #ifdef HAVE_cc0
...@@ -2179,8 +2179,6 @@ final_scan_insn (rtx uncast_insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED, ...@@ -2179,8 +2179,6 @@ final_scan_insn (rtx uncast_insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
#endif #endif
rtx_insn *next; rtx_insn *next;
rtx_insn *insn = as_a <rtx_insn *> (uncast_insn);
insn_counter++; insn_counter++;
/* Ignore deleted insns. These can occur when we split insns (due to a /* Ignore deleted insns. These can occur when we split insns (due to a
......
...@@ -72,7 +72,7 @@ extern void final (rtx_insn *, FILE *, int); ...@@ -72,7 +72,7 @@ extern void final (rtx_insn *, FILE *, int);
/* The final scan for one insn, INSN. Args are same as in `final', except /* The final scan for one insn, INSN. Args are same as in `final', except
that INSN is the insn being scanned. Value returned is the next insn to that INSN is the insn being scanned. Value returned is the next insn to
be scanned. */ be scanned. */
extern rtx_insn *final_scan_insn (rtx, FILE *, int, int, int *); extern rtx_insn *final_scan_insn (rtx_insn *, FILE *, int, int, int *);
/* Replace a SUBREG with a REG or a MEM, based on the thing it is a /* Replace a SUBREG with a REG or a MEM, based on the thing it is a
subreg of. */ subreg of. */
......
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