summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-21 14:01:37 +0000
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-21 14:01:37 +0000
commitb1a0077deb41f626582b48c0d08081fb8d20a208 (patch)
treee7d21d772e5ef8546e4cf56644276991e2166af5
parentbd18656e2c205b1d04c689604ab1730f310e0a07 (diff)
downloadgcc-b1a0077deb41f626582b48c0d08081fb8d20a208.tar.gz
define_bypass guard functions take a pair of rtx_insn
2014-08-21 David Malcolm <dmalcolm@redhat.com> * genautomata.c (output_internal_insn_latency_func): When writing the function "internal_insn_latency" to insn-automata.c, strengthen params "insn" and "insn2" from rtx to rtx_insn *, thus allowing the optional guard function of (define_bypass) clauses to expect a pair of rtx_insn *, rather than a pair of rtx. (output_insn_latency_func): When writing the function "insn_latency", add an "uncast_" prefix to params "insn" and "insn2", reintroducing "insn" and "insn2" as rtx_insn * locals using checked casts from the params, thus enabling the above change to the generated "internal_insn_latency" function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214273 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/genautomata.c10
2 files changed, 21 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6a366d3ee7a..12ef5146eba 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,16 @@
+2014-08-21 David Malcolm <dmalcolm@redhat.com>
+
+ * genautomata.c (output_internal_insn_latency_func): When writing
+ the function "internal_insn_latency" to insn-automata.c,
+ strengthen params "insn" and "insn2" from rtx to rtx_insn *, thus
+ allowing the optional guard function of (define_bypass) clauses to
+ expect a pair of rtx_insn *, rather than a pair of rtx.
+ (output_insn_latency_func): When writing the function
+ "insn_latency", add an "uncast_" prefix to params "insn" and
+ "insn2", reintroducing "insn" and "insn2" as rtx_insn * locals
+ using checked casts from the params, thus enabling the above
+ change to the generated "internal_insn_latency" function.
+
2014-08-21 Jan Hubicka <hubicka@ucw.cz>
PR tree-optimization/62091
diff --git a/gcc/genautomata.c b/gcc/genautomata.c
index 0c61278ff4c..3cd4d3a5009 100644
--- a/gcc/genautomata.c
+++ b/gcc/genautomata.c
@@ -8360,7 +8360,7 @@ output_internal_insn_latency_func (void)
decl_t decl;
struct bypass_decl *bypass;
- fprintf (output_file, "static int\n%s (int %s ATTRIBUTE_UNUSED,\n\tint %s ATTRIBUTE_UNUSED,\n\trtx %s ATTRIBUTE_UNUSED,\n\trtx %s ATTRIBUTE_UNUSED)\n",
+ fprintf (output_file, "static int\n%s (int %s ATTRIBUTE_UNUSED,\n\tint %s ATTRIBUTE_UNUSED,\n\trtx_insn *%s ATTRIBUTE_UNUSED,\n\trtx_insn *%s ATTRIBUTE_UNUSED)\n",
INTERNAL_INSN_LATENCY_FUNC_NAME, INTERNAL_INSN_CODE_NAME,
INTERNAL_INSN2_CODE_NAME, INSN_PARAMETER_NAME,
INSN2_PARAMETER_NAME);
@@ -8477,10 +8477,16 @@ output_internal_maximal_insn_latency_func (void)
static void
output_insn_latency_func (void)
{
- fprintf (output_file, "int\n%s (rtx %s, rtx %s)\n",
+ fprintf (output_file, "int\n%s (rtx uncast_%s, rtx uncast_%s)\n",
INSN_LATENCY_FUNC_NAME, INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME);
fprintf (output_file, "{\n int %s, %s;\n",
INTERNAL_INSN_CODE_NAME, INTERNAL_INSN2_CODE_NAME);
+ fprintf (output_file,
+ " rtx_insn *%s = safe_as_a <rtx_insn *> (uncast_%s);\n",
+ INSN_PARAMETER_NAME, INSN_PARAMETER_NAME);
+ fprintf (output_file,
+ " rtx_insn *%s = safe_as_a <rtx_insn *> (uncast_%s);\n",
+ INSN2_PARAMETER_NAME, INSN2_PARAMETER_NAME);
output_internal_insn_code_evaluation (INSN_PARAMETER_NAME,
INTERNAL_INSN_CODE_NAME, 0);
output_internal_insn_code_evaluation (INSN2_PARAMETER_NAME,