@@ -4467,9 +4467,29 @@ make_automaton_attrs (void)
XSTR (val->value, 0), XSTR (val->value, 0));
}
+ printf ("static int internal_dfa_insn_code_ (rtx);\n");
+ printf ("static int insn_default_latency_ (rtx);\n");
+ printf ("static int (*ptr_internal_dfa_insn_code) (rtx);\n");
+ printf ("static int (*ptr_insn_default_latency) (rtx);\n");
printf ("\n");
- printf ("int (*internal_dfa_insn_code) (rtx);\n");
- printf ("int (*insn_default_latency) (rtx);\n");
+ printf ("static int\n");
+ printf ("internal_dfa_insn_code_test_ (rtx insn)\n");
+ printf ("{\n");
+ printf (" int ret = internal_dfa_insn_code_ (insn);\n");
+ printf (" gcc_assert (ret == ptr_internal_dfa_insn_code (insn));\n");
+ printf (" return ret;\n");
+ printf ("}\n");
+ printf ("static int\n");
+ printf ("insn_default_latency_test_ (rtx insn)\n");
+ printf ("{\n");
+ printf (" int ret = insn_default_latency_ (insn);\n");
+ printf (" gcc_assert (ret == ptr_insn_default_latency (insn));\n");
+ printf (" return ret;\n");
+ printf ("}\n");
+ printf ("\n");
+ printf ("\n");
+ printf ("int (*internal_dfa_insn_code) (rtx) = internal_dfa_insn_code_test_;\n");
+ printf ("int (*insn_default_latency) (rtx) = insn_default_latency_test_;\n");
printf ("\n");
printf ("void\n");
printf ("init_sched_attrs (void)\n");
@@ -4550,10 +4570,10 @@ make_automaton_attrs (void)
write_test_expr (test, 0);
printf (")\n");
printf (" {\n");
- printf (" internal_dfa_insn_code\n");
+ printf (" ptr_internal_dfa_insn_code\n");
printf (" = internal_dfa_insn_code_%s;\n",
XSTR (val->value, 0));
- printf (" insn_default_latency\n");
+ printf (" ptr_insn_default_latency\n");
printf (" = insn_default_latency_%s;\n",
XSTR (val->value, 0));
printf (" }\n");
@@ -4566,7 +4586,7 @@ make_automaton_attrs (void)
XDELETEVEC (condexps);
}
- else
+ if (1)
{
code_exp = rtx_alloc (COND);
lats_exp = rtx_alloc (COND);
@@ -4588,8 +4608,16 @@ make_automaton_attrs (void)
XVECEXP (lats_exp, 0, i+1)
= make_numeric_value (decl->default_latency);
}
- make_internal_attr ("*internal_dfa_insn_code", code_exp, ATTR_NONE);
- make_internal_attr ("*insn_default_latency", lats_exp, ATTR_NONE);
+ if (tune_attr != NULL)
+ {
+ make_internal_attr ("*internal_dfa_insn_code_", code_exp, ATTR_NONE);
+ make_internal_attr ("*insn_default_latency_", lats_exp, ATTR_NONE);
+ }
+ else
+ {
+ make_internal_attr ("*internal_dfa_insn_code", code_exp, ATTR_NONE);
+ make_internal_attr ("*insn_default_latency", lats_exp, ATTR_NONE);
+ }
}
if (n_bypasses == 0)