OSDN Git Service

Update FSF address.
[pf3gnuchains/gcc-fork.git] / gcc / genoutput.c
index 70173dc..bbf6200 100644 (file)
@@ -1,5 +1,5 @@
 /* Generate code from to output assembler insns as recognized from rtl.
-   Copyright (C) 1987, 1988, 1992 Free Software Foundation, Inc.
+   Copyright (C) 1987, 1988, 1992, 1994, 1995 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -15,7 +15,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 
 /* This program reads the machine description for the compiler target machine
@@ -90,7 +91,7 @@ It would not make an case in output_insn_hairy because the template
 given in the entry is a constant (it does not start with `*').  */
 \f
 #include <stdio.h>
-#include "config.h"
+#include "hconfig.h"
 #include "rtl.h"
 #include "obstack.h"
 
@@ -165,6 +166,11 @@ struct data *end_of_insn_data;
    for this machine description.  */
 
 int have_constraints;
+
+/* Nonzero if some error has occurred.  We will make all errors fatal, but
+   might as well continue until we see all of them.  */
+
+static int have_error;
 \f
 static void
 output_prologue ()
@@ -217,7 +223,7 @@ output_epilogue ()
   printf ("\nrtx (*const insn_gen_function[]) () =\n  {\n");
   for (d = insn_data; d; d = d->next)
     {
-      if (d->name)
+      if (d->name && d->name[0] != '*')
        printf ("    gen_%s,\n", d->name);
       else
        printf ("    0,\n");
@@ -232,7 +238,7 @@ output_epilogue ()
     char * next_name;
     register struct data *n;
 
-    for (n = insn_data, next = 0; n; n = n->next, next++)
+    for (n = insn_data, next = 1; n; n = n->next, next++)
       if (n->name)
        {
          next_name = n->name;
@@ -497,6 +503,7 @@ scan_operands (part, this_address_p, this_strict_low)
 
     case MATCH_DUP:
     case MATCH_OP_DUP:
+    case MATCH_PAR_DUP:
       ++num_dups;
       return;
 
@@ -846,9 +853,9 @@ gen_split (split)
   mybzero (d->strict_low, sizeof strict_low);
 
   d->n_dups = 0;
+  d->n_alternatives = 0;
   d->template = 0;
   d->outfun = 0;
-  d->n_alternatives = 0;
 }
 \f
 char *
@@ -918,6 +925,8 @@ error (s, a1, a2)
   fprintf (stderr, "genoutput: ");
   fprintf (stderr, s, a1, a2);
   fprintf (stderr, "\n");
+
+  have_error = 1;
 }
 \f
 int
@@ -972,14 +981,16 @@ main (argc, argv)
   output_epilogue ();
 
   fflush (stdout);
-  exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
+  exit (ferror (stdout) != 0 || have_error
+       ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
+
   /* NOTREACHED */
   return 0;
 }
 
 static int
 n_occurrences (c, s)
-     char c;
+     int c;
      char *s;
 {
   int n = 0;