aboutsummaryrefslogtreecommitdiff
path: root/gcc/genpeep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/genpeep.c')
-rw-r--r--gcc/genpeep.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/gcc/genpeep.c b/gcc/genpeep.c
index 99fcec54ce5..dfba042e9b5 100644
--- a/gcc/genpeep.c
+++ b/gcc/genpeep.c
@@ -1,5 +1,5 @@
/* Generate code from machine description to perform peephole optimizations.
- Copyright (C) 1987, 1989, 1992, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1987, 89, 92, 97, 98, 1999 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -46,9 +46,9 @@ struct link
int vecelt;
};
-char *xmalloc PROTO((unsigned));
-static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
-void fancy_abort PROTO((void));
+static void fatal PVPROTO ((const char *, ...))
+ ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
+void fancy_abort PROTO((void)) ATTRIBUTE_NORETURN;
static int max_opno;
@@ -384,40 +384,44 @@ print_code (code)
}
}
-char *
+PTR
xmalloc (size)
- unsigned size;
+ size_t size;
{
- register char *val = (char *) malloc (size);
+ register PTR val = (PTR) malloc (size);
if (val == 0)
fatal ("virtual memory exhausted");
return val;
}
-char *
-xrealloc (ptr, size)
- char *ptr;
- unsigned size;
+PTR
+xrealloc (old, size)
+ PTR old;
+ size_t size;
{
- char *result = (char *) realloc (ptr, size);
- if (!result)
+ register PTR ptr;
+ if (old)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
+ if (!ptr)
fatal ("virtual memory exhausted");
- return result;
+ return ptr;
}
static void
-fatal VPROTO ((char *format, ...))
+fatal VPROTO ((const char *format, ...))
{
-#ifndef __STDC__
- char *format;
+#ifndef ANSI_PROTOTYPES
+ const char *format;
#endif
va_list ap;
VA_START (ap, format);
-#ifndef __STDC__
- format = va_arg (ap, char *);
+#ifndef ANSI_PROTOTYPES
+ format = va_arg (ap, const char *);
#endif
fprintf (stderr, "genpeep: ");
@@ -466,10 +470,12 @@ from the machine description file `md'. */\n\n");
printf ("#include \"config.h\"\n");
printf ("#include \"system.h\"\n");
+ printf ("#include \"insn-config.h\"\n");
printf ("#include \"rtl.h\"\n");
printf ("#include \"regs.h\"\n");
printf ("#include \"output.h\"\n");
printf ("#include \"real.h\"\n");
+ printf ("#include \"recog.h\"\n");
printf ("#include \"except.h\"\n\n");
printf ("extern rtx peep_operand[];\n\n");