summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2014-09-09 15:14:03 +0000
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2014-09-09 15:14:03 +0000
commitf935868a274a39590a4b78f984c0bc98283d980f (patch)
treee9fd85a935c135494fbf5adfc6fce9d4b291818a
parent382f116f732d210b36037e52c50b62fb3885c635 (diff)
downloadgcc-f935868a274a39590a4b78f984c0bc98283d980f.tar.gz
Handcode gen_rtx_INSN
gcc/ChangeLog: 2014-09-09 David Malcolm <dmalcolm@redhat.com> * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215083 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/combine.c7
-rw-r--r--gcc/emit-rtl.c11
-rw-r--r--gcc/gengenrtl.c1
-rw-r--r--gcc/rtl.h4
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,5 +1,16 @@
2014-09-09 David Malcolm <dmalcolm@redhat.com>
+ * 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 <dmalcolm@redhat.com>
+
* ira.c (ira_update_equiv_info_by_shuffle_insn): Use NULL rather
than NULL_RTX.
(no_equiv): Likewise.
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 <rtx_insn *> (
- 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 <rtx_insn *> (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);