Commit 800dcd86 by Trevor Saunders Committed by Trevor Saunders

make recog () take a rtx_insn *

gcc/ChangeLog:

2016-11-21  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* config/v850/v850.c (expand_prologue): Adjust.
	(expand_epilogue): Likewise.
	* expr.c (init_expr_target): Likewise.
	* genrecog.c (print_subroutine): Always make the argument type
	rtx_insn *.
	* recog.h: Adjust prototype.

From-SVN: r242651
parent f370536c
2016-11-21 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> 2016-11-21 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* config/v850/v850.c (expand_prologue): Adjust.
(expand_epilogue): Likewise.
* expr.c (init_expr_target): Likewise.
* genrecog.c (print_subroutine): Always make the argument type
rtx_insn *.
* recog.h: Adjust prototype.
2016-11-21 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* config/aarch64/aarch64.c (aarch64_emit_unlikely_jump): split * config/aarch64/aarch64.c (aarch64_emit_unlikely_jump): split
up variables to make some rtx_insn *. up variables to make some rtx_insn *.
* config/alpha/alpha.c (emit_unlikely_jump): Likewise. * config/alpha/alpha.c (emit_unlikely_jump): Likewise.
...@@ -1741,7 +1741,7 @@ expand_prologue (void) ...@@ -1741,7 +1741,7 @@ expand_prologue (void)
v850_all_frame_related (save_all); v850_all_frame_related (save_all);
code = recog (save_all, NULL_RTX, NULL); code = recog (save_all, NULL, NULL);
if (code >= 0) if (code >= 0)
{ {
rtx insn = emit_insn (save_all); rtx insn = emit_insn (save_all);
...@@ -1887,7 +1887,7 @@ expand_epilogue (void) ...@@ -1887,7 +1887,7 @@ expand_epilogue (void)
offset -= 4; offset -= 4;
} }
code = recog (restore_all, NULL_RTX, NULL); code = recog (restore_all, NULL, NULL);
if (code >= 0) if (code >= 0)
{ {
......
...@@ -109,7 +109,7 @@ static HOST_WIDE_INT int_expr_size (tree); ...@@ -109,7 +109,7 @@ static HOST_WIDE_INT int_expr_size (tree);
void void
init_expr_target (void) init_expr_target (void)
{ {
rtx insn, pat; rtx pat;
machine_mode mode; machine_mode mode;
int num_clobbers; int num_clobbers;
rtx mem, mem1; rtx mem, mem1;
...@@ -125,7 +125,7 @@ init_expr_target (void) ...@@ -125,7 +125,7 @@ init_expr_target (void)
useless RTL allocations. */ useless RTL allocations. */
reg = gen_rtx_REG (word_mode, LAST_VIRTUAL_REGISTER + 1); reg = gen_rtx_REG (word_mode, LAST_VIRTUAL_REGISTER + 1);
insn = rtx_alloc (INSN); rtx_insn *insn = as_a<rtx_insn *> (rtx_alloc (INSN));
pat = gen_rtx_SET (NULL_RTX, NULL_RTX); pat = gen_rtx_SET (NULL_RTX, NULL_RTX);
PATTERN (insn) = pat; PATTERN (insn) = pat;
......
...@@ -5099,11 +5099,6 @@ print_pattern (output_state *os, pattern_routine *routine) ...@@ -5099,11 +5099,6 @@ print_pattern (output_state *os, pattern_routine *routine)
static void static void
print_subroutine (output_state *os, state *s, int proc_id) print_subroutine (output_state *os, state *s, int proc_id)
{ {
/* For now, the top-level "recog" takes a plain "rtx", and performs a
checked cast to "rtx_insn *" for use throughout the rest of the
function and the code it calls. */
const char *insn_param
= proc_id > 0 ? "rtx_insn *insn" : "rtx uncast_insn";
printf ("\n"); printf ("\n");
switch (os->type) switch (os->type)
{ {
...@@ -5116,8 +5111,8 @@ print_subroutine (output_state *os, state *s, int proc_id) ...@@ -5116,8 +5111,8 @@ print_subroutine (output_state *os, state *s, int proc_id)
else else
printf ("int\nrecog"); printf ("int\nrecog");
printf (" (rtx x1 ATTRIBUTE_UNUSED,\n" printf (" (rtx x1 ATTRIBUTE_UNUSED,\n"
"\t%s ATTRIBUTE_UNUSED,\n" "\trtx_insn *insn ATTRIBUTE_UNUSED,\n"
"\tint *pnum_clobbers ATTRIBUTE_UNUSED)\n", insn_param); "\tint *pnum_clobbers ATTRIBUTE_UNUSED)\n");
break; break;
case SPLIT: case SPLIT:
...@@ -5142,11 +5137,6 @@ print_subroutine (output_state *os, state *s, int proc_id) ...@@ -5142,11 +5137,6 @@ print_subroutine (output_state *os, state *s, int proc_id)
if (proc_id == 0) if (proc_id == 0)
{ {
printf (" recog_data.insn = NULL;\n"); printf (" recog_data.insn = NULL;\n");
if (os->type == RECOG)
{
printf (" rtx_insn *insn ATTRIBUTE_UNUSED;\n");
printf (" insn = safe_as_a <rtx_insn *> (uncast_insn);\n");
}
} }
print_state (os, s, 2, true); print_state (os, s, 2, true);
printf ("}\n"); printf ("}\n");
......
...@@ -124,7 +124,7 @@ extern int offsettable_address_addr_space_p (int, machine_mode, rtx, ...@@ -124,7 +124,7 @@ extern int offsettable_address_addr_space_p (int, machine_mode, rtx,
ADDR_SPACE_GENERIC) ADDR_SPACE_GENERIC)
extern bool mode_dependent_address_p (rtx, addr_space_t); extern bool mode_dependent_address_p (rtx, addr_space_t);
extern int recog (rtx, rtx, int *); extern int recog (rtx, rtx_insn *, int *);
#ifndef GENERATOR_FILE #ifndef GENERATOR_FILE
static inline int recog_memoized (rtx_insn *insn); static inline int recog_memoized (rtx_insn *insn);
#endif #endif
......
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