/* 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.
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
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"
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 ()
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");
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;
case MATCH_DUP:
case MATCH_OP_DUP:
+ case MATCH_PAR_DUP:
++num_dups;
return;
d->n_alternatives = 0;
d->template = 0;
d->outfun = 0;
- d->n_alternatives = 0;
}
\f
char *
fprintf (stderr, "genoutput: ");
fprintf (stderr, s, a1, a2);
fprintf (stderr, "\n");
+
+ have_error = 1;
}
\f
int
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;