From d6e1e8b8d1663dd2b25bc9e27ca099568848c641 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 9 Sep 2014 15:14:03 +0000 Subject: [PATCH] Handcode gen_rtx_INSN gcc/ChangeLog: 2014-09-09 David Malcolm * combine.c (try_combine): Eliminate checked cast on result of gen_rtx_INSN. * emit-rtl.c (gen_rtx_INSN): New function, improving over the prior autogenerated one by strengthening the return type and params 2 and 3 from rtx to rtx_insn *, and by naming the params. * gengenrtl.c (special_rtx): Add INSN to those that are special-cased. * rtl.h (gen_rtx_INSN): New prototype. From-SVN: r215083 --- gcc/ChangeLog | 11 +++++++++++ gcc/combine.c | 7 +++---- gcc/emit-rtl.c | 11 +++++++++++ gcc/gengenrtl.c | 1 + gcc/rtl.h | 4 ++++ 5 files changed, 30 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4427243913f..97d0fbc7251 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2014-09-09 David Malcolm + + * combine.c (try_combine): Eliminate checked cast on result of + gen_rtx_INSN. + * emit-rtl.c (gen_rtx_INSN): New function, improving over the prior + autogenerated one by strengthening the return type and params 2 and 3 + from rtx to rtx_insn *, and by naming the params. + * gengenrtl.c (special_rtx): Add INSN to those that are + special-cased. + * rtl.h (gen_rtx_INSN): New prototype. + 2014-09-09 David Malcolm * ira.c (ira_update_equiv_info_by_shuffle_insn): Use NULL rather diff --git a/gcc/combine.c b/gcc/combine.c index 60524b5f201..0ec7f852c47 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -2772,10 +2772,9 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0, never appear in the insn stream so giving it the same INSN_UID as I2 will not cause a problem. */ - i1 = as_a ( - gen_rtx_INSN (VOIDmode, NULL_RTX, i2, BLOCK_FOR_INSN (i2), - XVECEXP (PATTERN (i2), 0, 1), INSN_LOCATION (i2), - -1, NULL_RTX)); + i1 = gen_rtx_INSN (VOIDmode, NULL, i2, BLOCK_FOR_INSN (i2), + XVECEXP (PATTERN (i2), 0, 1), INSN_LOCATION (i2), + -1, NULL_RTX); INSN_UID (i1) = INSN_UID (i2); SUBST (PATTERN (i2), XVECEXP (PATTERN (i2), 0, 0)); diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index e3df826fda2..0acdd08bda4 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -424,6 +424,17 @@ gen_rtx_INSN_LIST (enum machine_mode mode, rtx insn, rtx insn_list) insn_list)); } +rtx_insn * +gen_rtx_INSN (enum machine_mode mode, rtx_insn *prev_insn, rtx_insn *next_insn, + basic_block bb, rtx pattern, int location, int code, + rtx reg_notes) +{ + return as_a (gen_rtx_fmt_uuBeiie (INSN, mode, + prev_insn, next_insn, + bb, pattern, location, code, + reg_notes)); +} + rtx gen_rtx_CONST_INT (enum machine_mode mode ATTRIBUTE_UNUSED, HOST_WIDE_INT arg) { diff --git a/gcc/gengenrtl.c b/gcc/gengenrtl.c index 885dd200c27..d3eca985e3e 100644 --- a/gcc/gengenrtl.c +++ b/gcc/gengenrtl.c @@ -125,6 +125,7 @@ special_rtx (int idx) { return (strcmp (defs[idx].enumname, "EXPR_LIST") == 0 || strcmp (defs[idx].enumname, "INSN_LIST") == 0 + || strcmp (defs[idx].enumname, "INSN") == 0 || strcmp (defs[idx].enumname, "CONST_INT") == 0 || strcmp (defs[idx].enumname, "REG") == 0 || strcmp (defs[idx].enumname, "SUBREG") == 0 diff --git a/gcc/rtl.h b/gcc/rtl.h index ddf89b0d05c..fae3b5d5384 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -3089,6 +3089,10 @@ get_mem_attrs (const_rtx x) extern rtx_expr_list *gen_rtx_EXPR_LIST (enum machine_mode, rtx, rtx); extern rtx_insn_list *gen_rtx_INSN_LIST (enum machine_mode, rtx, rtx); +extern rtx_insn * +gen_rtx_INSN (enum machine_mode mode, rtx_insn *prev_insn, rtx_insn *next_insn, + basic_block bb, rtx pattern, int location, int code, + rtx reg_notes); extern rtx gen_rtx_CONST_INT (enum machine_mode, HOST_WIDE_INT); extern rtx gen_rtx_CONST_VECTOR (enum machine_mode, rtvec); extern rtx gen_raw_REG (enum machine_mode, int); -- 2.30.2