summaryrefslogtreecommitdiff
path: root/gcc/genrecog.c
diff options
context:
space:
mode:
authormiyuki <miyuki@138bc75d-0d04-0410-961f-82ee72b054a4>2015-06-06 05:39:16 +0000
committermiyuki <miyuki@138bc75d-0d04-0410-961f-82ee72b054a4>2015-06-06 05:39:16 +0000
commit58a87a29ba8b650e6dc901fbe4a37fe905a046be (patch)
tree59990e06cf8ced52d365080821323351c4790c1c /gcc/genrecog.c
parent9f96175798df76cbd74e3081e5384857315fc921 (diff)
downloadgcc-58a87a29ba8b650e6dc901fbe4a37fe905a046be.tar.gz
Promote types of rtl expressions to rtx_insn in gen_split and gen_peephole2
* combine.c (combine_split_insns): Remove cast. * config/bfin/bfin.c (hwloop_fail): Add cast in try_split call. * config/sh/sh.c (sh_try_split_insn_simple): Remove cast. * config/sh/sh_treg_combine.cc (sh_treg_combine::execute): Add cast. * emit-rtl.c (try_split): Promote type of trial argument to rtx_insn. * genemit.c (gen_split): Change return type of generated functions to rtx_insn. * genrecog.c (get_failure_return): Use NULL instead of NULL_RTX. (print_subroutine_start): Promote rtx to rtx_insn in gen_split_* and gen_peephole2_* functions. (print_subroutine, main): Likewise. * recog.c (peephole2_optimize): Remove cast. (peep2_next_insn): Promote return type to rtx_insn. * recog.h (peep2_next_insn): Fix prototype. * rtl.h (try_split, split_insns): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224183 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genrecog.c')
-rw-r--r--gcc/genrecog.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index 4b6dee64b5a..217eb500751 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -4307,7 +4307,7 @@ get_failure_return (routine_type type)
case SPLIT:
case PEEPHOLE2:
- return "NULL_RTX";
+ return "NULL";
}
gcc_unreachable ();
}
@@ -5061,7 +5061,7 @@ print_subroutine_start (output_state *os, state *s, position *root)
if (os->type == SUBPATTERN || os->type == RECOG)
printf (" int res ATTRIBUTE_UNUSED;\n");
else
- printf (" rtx res ATTRIBUTE_UNUSED;\n");
+ printf (" rtx_insn *res ATTRIBUTE_UNUSED;\n");
}
/* Output the definition of pattern routine ROUTINE. */
@@ -5111,7 +5111,7 @@ print_pattern (output_state *os, pattern_routine *routine)
static void
print_subroutine (output_state *os, state *s, int proc_id)
{
- /* For now, the top-level functions take a plain "rtx", and perform a
+ /* 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
@@ -5134,29 +5134,31 @@ print_subroutine (output_state *os, state *s, int proc_id)
case SPLIT:
if (proc_id)
- printf ("static rtx\nsplit_%d", proc_id);
+ printf ("static rtx_insn *\nsplit_%d", proc_id);
else
- printf ("rtx\nsplit_insns");
- printf (" (rtx x1 ATTRIBUTE_UNUSED, %s ATTRIBUTE_UNUSED)\n",
- insn_param);
+ printf ("rtx_insn *\nsplit_insns");
+ printf (" (rtx x1 ATTRIBUTE_UNUSED, rtx_insn *insn ATTRIBUTE_UNUSED)\n");
break;
case PEEPHOLE2:
if (proc_id)
- printf ("static rtx\npeephole2_%d", proc_id);
+ printf ("static rtx_insn *\npeephole2_%d", proc_id);
else
- printf ("rtx\npeephole2_insns");
+ printf ("rtx_insn *\npeephole2_insns");
printf (" (rtx x1 ATTRIBUTE_UNUSED,\n"
- "\t%s ATTRIBUTE_UNUSED,\n"
- "\tint *pmatch_len_ ATTRIBUTE_UNUSED)\n", insn_param);
+ "\trtx_insn *insn ATTRIBUTE_UNUSED,\n"
+ "\tint *pmatch_len_ ATTRIBUTE_UNUSED)\n");
break;
}
print_subroutine_start (os, s, &root_pos);
if (proc_id == 0)
{
printf (" recog_data.insn = NULL;\n");
- printf (" rtx_insn *insn ATTRIBUTE_UNUSED;\n");
- printf (" insn = safe_as_a <rtx_insn *> (uncast_insn);\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);
printf ("}\n");
@@ -5323,7 +5325,7 @@ main (int argc, char **argv)
/* Declare the gen_split routine that we'll call if the
pattern matches. The definition comes from insn-emit.c. */
- printf ("extern rtx gen_split_%d (rtx_insn *, rtx *);\n",
+ printf ("extern rtx_insn *gen_split_%d (rtx_insn *, rtx *);\n",
next_insn_code);
break;
@@ -5335,7 +5337,7 @@ main (int argc, char **argv)
/* Declare the gen_peephole2 routine that we'll call if the
pattern matches. The definition comes from insn-emit.c. */
- printf ("extern rtx gen_peephole2_%d (rtx_insn *, rtx *);\n",
+ printf ("extern rtx_insn *gen_peephole2_%d (rtx_insn *, rtx *);\n",
next_insn_code);
break;