summaryrefslogtreecommitdiff
path: root/gcc/genattrtab.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2015-10-22 13:18:05 -0600
committerJeff Law <law@gcc.gnu.org>2015-10-22 13:18:05 -0600
commit71e558ef30be263c83aa3cb48ba2b4fd13729ec3 (patch)
tree06f531f631409981667204a33ef61e75bae1b02f /gcc/genattrtab.c
parent8d535dab41846796712adabc2beb260f26ad457e (diff)
[PATCH] Fix abort in write_eligible_delay
[PATCH] Fix abort in write_eligible_delay * genattrtab.c (main): If we do not have any annul-true or annul-false slots, then write out a dummy eligible_for_annul_true or eligible_for_annul_false as needed. From-SVN: r229184
Diffstat (limited to 'gcc/genattrtab.c')
-rw-r--r--gcc/genattrtab.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c
index 8d1fa6c9bbf..32b837c287c 100644
--- a/gcc/genattrtab.c
+++ b/gcc/genattrtab.c
@@ -4411,6 +4411,26 @@ write_indent (FILE *outf, int indent)
fprintf (outf, " ");
}
+/* If the target does not have annul-true or annul-false delay slots, this
+ function will create a dummy eligible_for function on OUTF which always
+ returns false. KIND will be annul_true or annul_false. */
+
+static void
+write_dummy_eligible_delay (FILE *outf, const char *kind)
+{
+ /* Write function prelude. */
+
+ fprintf (outf, "int\n");
+ fprintf (outf, "eligible_for_%s (rtx_insn *delay_insn ATTRIBUTE_UNUSED,\n"
+ " int slot ATTRIBUTE_UNUSED,\n"
+ " rtx_insn *candidate_insn ATTRIBUTE_UNUSED,\n"
+ " int flags ATTRIBUTE_UNUSED)\n",
+ kind);
+ fprintf (outf, "{\n");
+ fprintf (outf, " return 0;\n");
+ fprintf (outf, "}\n\n");
+}
+
/* Write a subroutine that is given an insn that requires a delay slot, a
delay slot ordinal, and a candidate insn. It returns nonzero if the
candidate can be placed in the specified delay slot of the insn.
@@ -5307,8 +5327,14 @@ main (int argc, char **argv)
(The function to compute the number of delay slots will be written
below.) */
write_eligible_delay (attr_file, "delay");
- write_eligible_delay (attr_file, "annul_true");
- write_eligible_delay (attr_file, "annul_false");
+ if (have_annul_true)
+ write_eligible_delay (attr_file, "annul_true");
+ else
+ write_dummy_eligible_delay (attr_file, "annul_true");
+ if (have_annul_false)
+ write_eligible_delay (attr_file, "annul_false");
+ else
+ write_dummy_eligible_delay (attr_file, "annul_false");
/* Write out constant delay slot info. */
write_const_num_delay_slots (attr_file);