genattrtab.c (write_eligible_delay): Verify DELAY_INSN still has a delay slot in...
authorJeff Law <law@redhat.com>
Wed, 12 Apr 2017 16:08:18 +0000 (10:08 -0600)
committerJeff Law <law@gcc.gnu.org>
Wed, 12 Apr 2017 16:08:18 +0000 (10:08 -0600)
* genattrtab.c (write_eligible_delay): Verify DELAY_INSN still
has a delay slot in the generated code.

From-SVN: r246879

gcc/ChangeLog
gcc/genattrtab.c

index fc0becfe49fdf7da149296085bf81bd206e107b9..89af9cc1671639bbb7b14005ed526049b142e2f7 100644 (file)
@@ -1,5 +1,8 @@
 2017-04-12  Jeff Law  <law@redhat.com>
 
+       * genattrtab.c (write_eligible_delay): Verify DELAY_INSN still
+       has a delay slot in the generated code.
+
        * config/cris/cris.md (cris_preferred_reload_class): Return
        GENNONACR_REGS rather than GENERAL_REGS.
 
index cd4e6689db49b9af8f66e615882d7c37fc8e1fa3..3629b5fa4862c4c63dd4da192315e6075d9c5a76 100644 (file)
@@ -4416,6 +4416,9 @@ write_eligible_delay (FILE *outf, const char *kind)
   fprintf (outf, "{\n");
   fprintf (outf, "  rtx_insn *insn ATTRIBUTE_UNUSED;\n");
   fprintf (outf, "\n");
+  fprintf (outf, "  if (num_delay_slots (delay_insn) == 0)\n");
+  fprintf (outf, "    return 0;");
+  fprintf (outf, "\n");
   fprintf (outf, "  gcc_assert (slot < %d);\n", max_slots);
   fprintf (outf, "\n");
   /* Allow dbr_schedule to pass labels, etc.  This can happen if try_split