* cccp.c (xrealloc): Call malloc given a NULL old pointer.
* collect2.c, cppalloc.c, gcc.c, genattr.c, genattrtab.c: Likewise.
* gencodes.c, genconfig.c, genemit.c, genextract.c: Likewise.
* genflags.c, genopinit.c, genoutput.c, genpeep.c: Likewise.
* genrecog.c, mips-tfile.c, protoize.c: Likewise.
From-SVN: r24806
18 files changed:
+Thu Jan 21 17:45:18 1999 Richard Henderson <rth@cygnus.com>
+
+ * configure.in ({rs6000|powerpc}-ibm-aix4.[12]*): Add missing `then'.
+
+ * cccp.c (xrealloc): Call malloc given a NULL old pointer.
+ * collect2.c, cppalloc.c, gcc.c, genattr.c, genattrtab.c: Likewise.
+ * gencodes.c, genconfig.c, genemit.c, genextract.c: Likewise.
+ * genflags.c, genopinit.c, genoutput.c, genpeep.c: Likewise.
+ * genrecog.c, mips-tfile.c, protoize.c: Likewise.
+
Thu Jan 21 19:44:55 1999 Michael Meissner <meissner@cygnus.com>
* configure.in ({rs6000|powerpc}-ibm-aix4.[12]*): If
Thu Jan 21 19:44:55 1999 Michael Meissner <meissner@cygnus.com>
* configure.in ({rs6000|powerpc}-ibm-aix4.[12]*): If
- register PTR ptr = (PTR) realloc (old, size);
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
if (!ptr)
memory_full ();
return ptr;
if (!ptr)
memory_full ();
return ptr;
-xrealloc (ptr, size)
- PTR ptr;
+xrealloc (old, size)
+ PTR old;
- register PTR value = (PTR) realloc (ptr, size);
- if (value == 0)
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
+ if (ptr == 0)
fatal ("virtual memory exhausted");
fatal ("virtual memory exhausted");
- register PTR ptr = (PTR) realloc (old, size);
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
if (ptr == 0)
memory_full ();
return ptr;
if (ptr == 0)
memory_full ();
return ptr;
-xrealloc (ptr, size)
- PTR ptr;
+xrealloc (old, size)
+ PTR old;
- register PTR value = (PTR) realloc (ptr, size);
- if (value == 0)
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
+ if (ptr == 0)
fatal ("virtual memory exhausted");
fatal ("virtual memory exhausted");
-xrealloc (ptr, size)
- PTR ptr;
+xrealloc (old, size)
+ PTR old;
- register PTR result = (PTR) realloc (ptr, size);
- if (!result)
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
+ if (!ptr)
fatal ("virtual memory exhausted");
fatal ("virtual memory exhausted");
-xrealloc (ptr, size)
- PTR ptr;
+xrealloc (old, size)
+ PTR old;
- register PTR result = (PTR) realloc (ptr, size);
- if (!result)
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
+ if (!ptr)
fatal ("virtual memory exhausted");
fatal ("virtual memory exhausted");
-xrealloc (ptr, size)
- PTR ptr;
+xrealloc (old, size)
+ PTR old;
- register PTR result = (PTR) realloc (ptr, size);
- if (!result)
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
+ if (!ptr)
fatal ("virtual memory exhausted");
fatal ("virtual memory exhausted");
-xrealloc (ptr, size)
- PTR ptr;
+xrealloc (old, size)
+ PTR old;
- register PTR result = (PTR) realloc (ptr, size);
- if (!result)
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
+ if (!ptr)
fatal ("virtual memory exhausted");
fatal ("virtual memory exhausted");
-xrealloc (ptr, size)
- PTR ptr;
+xrealloc (old, size)
+ PTR old;
- register PTR result = (PTR) realloc (ptr, size);
- if (!result)
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
+ if (!ptr)
fatal ("virtual memory exhausted");
fatal ("virtual memory exhausted");
-xrealloc (ptr, size)
- PTR ptr;
+xrealloc (old, size)
+ PTR old;
- register PTR result = (PTR) realloc (ptr, size);
- if (!result)
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
+ if (!ptr)
fatal ("virtual memory exhausted");
fatal ("virtual memory exhausted");
-xrealloc (ptr, size)
- PTR ptr;
+xrealloc (old, size)
+ PTR old;
- register PTR result = (PTR) realloc (ptr, size);
- if (!result)
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
+ if (!ptr)
fatal ("virtual memory exhausted");
fatal ("virtual memory exhausted");
-xrealloc (ptr, size)
- PTR ptr;
+xrealloc (old, size)
+ PTR old;
- register PTR result = (PTR) realloc (ptr, size);
- if (!result)
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
+ if (!ptr)
fatal ("virtual memory exhausted");
fatal ("virtual memory exhausted");
-xrealloc (ptr, size)
- PTR ptr;
+xrealloc (old, size)
+ PTR old;
- register PTR result = (PTR) realloc (ptr, size);
- if (!result)
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
+ if (!ptr)
fatal ("virtual memory exhausted");
fatal ("virtual memory exhausted");
-xrealloc (ptr, size)
- PTR ptr;
+xrealloc (old, size)
+ PTR old;
- register PTR result = (PTR) realloc (ptr, size);
- if (!result)
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
+ if (!ptr)
fatal ("virtual memory exhausted");
fatal ("virtual memory exhausted");
-xrealloc (ptr, size)
- PTR ptr;
+xrealloc (old, size)
+ PTR old;
- register PTR result = (PTR) realloc (ptr, size);
- if (!result)
+ register PTR ptr;
+ if (ptr)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
+ if (!ptr)
fatal ("virtual memory exhausted");
fatal ("virtual memory exhausted");
- register PTR result = (PTR) realloc (ptr, size);
+ register PTR result;
+ if (ptr)
+ result = (PTR) realloc (ptr, size);
+ else
+ result = (PTR) malloc (size);
if (!result)
fatal ("Virtual memory exhausted.");
if (!result)
fatal ("Virtual memory exhausted.");
pointer_type old_space;
size_t byte_count;
{
pointer_type old_space;
size_t byte_count;
{
- register pointer_type rv = (pointer_type) realloc (old_space, byte_count);
+ register pointer_type rv;
+ if (old_space)
+ rv = (pointer_type) realloc (old_space, byte_count);
+ else
+ rv = (pointer_type) malloc (byte_count);
if (rv == NULL)
{
fprintf (stderr, "\n%s: virtual memory exceeded\n", pname);
if (rv == NULL)
{
fprintf (stderr, "\n%s: virtual memory exceeded\n", pname);