OSDN Git Service

* genautomata.c (output_internal_insn_latency_func,
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Jan 2003 07:31:51 +0000 (07:31 +0000)
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Jan 2003 07:31:51 +0000 (07:31 +0000)
output_print_reservation_func): Short circuit when there is no
automaton to generate code for.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61588 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/genautomata.c

index 171f03d..923bd7b 100644 (file)
@@ -1,3 +1,9 @@
+2003-01-21  Zack Weinberg  <zack@codesourcery.com>
+
+       * genautomata.c (output_internal_insn_latency_func,
+       output_print_reservation_func): Short circuit when there is no
+       automaton to generate code for.
+
 2003-01-21  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * Makefile.in (ssa-ccp.o): Depend on coretypes.h $(TM_H).
index 3fe4553..bb1a9d9 100644 (file)
@@ -8920,12 +8920,19 @@ output_internal_insn_latency_func ()
           INTERNAL_INSN_LATENCY_FUNC_NAME, INTERNAL_INSN_CODE_NAME,
           INTERNAL_INSN2_CODE_NAME, INSN_PARAMETER_NAME,
           INSN2_PARAMETER_NAME);
-  fprintf (output_file, "\n\tint %s;\n\tint %s;\n",
+  fprintf (output_file,
+          "\n\tint %s ATTRIBUTE_UNUSED;\n\tint %s ATTRIBUTE_UNUSED;\n",
           INTERNAL_INSN_CODE_NAME, INTERNAL_INSN2_CODE_NAME);
   fprintf (output_file,
           "\trtx %s ATTRIBUTE_UNUSED;\n\trtx %s ATTRIBUTE_UNUSED;\n{\n",
           INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME);
 
+  if (DECL_INSN_RESERV (advance_cycle_insn_decl)->insn_num == 0)
+    {
+      fputs ("  return 0;\n}\n\n", output_file);
+      return;
+    }
+
   fprintf (output_file, "  static const %s default_latencies[] =\n    {",
           tabletype);
 
@@ -9015,11 +9022,20 @@ output_print_reservation_func ()
   decl_t decl;
   int i, j;
 
-  fprintf (output_file, "void\n%s (%s, %s)\n\tFILE *%s;\n\trtx %s;\n{\n",
+  fprintf (output_file,
+          "void\n%s (%s, %s)\n\tFILE *%s;\n\trtx %s ATTRIBUTE_UNUSED;\n{\n",
            PRINT_RESERVATION_FUNC_NAME, FILE_PARAMETER_NAME,
            INSN_PARAMETER_NAME, FILE_PARAMETER_NAME,
            INSN_PARAMETER_NAME);
 
+  if (DECL_INSN_RESERV (advance_cycle_insn_decl)->insn_num == 0)
+    {
+      fprintf (output_file, "  fputs (\"%s\", %s);\n}\n\n",
+              NOTHING_NAME, FILE_PARAMETER_NAME);
+      return;
+    }
+
+
   fputs ("  static const char *const reservation_names[] =\n    {",
         output_file);