This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

x-files must die: alloca


This patch eliminates all the xm-*.h and x-* gunk relating to alloca.
There are three basic chunks.

First, libiberty is changed so it always provides the C alloca
emulation.  The symbol is called C_alloca, not alloca.  libiberty.h
#defines alloca() to either __builtin_alloca() or C_alloca() depending
only on whether we are compiling with GCC or not.  You can force the
use of the C alloca by #defining USE_C_ALLOCA.  libiberty.h will
define USE_C_ALLOCA itself if it selects the C alloca - thus we can
continue to detect that and call alloca(0) where necessary.

Second, all references to alloca are eradicated from the gcc
subdirectory configuration logic and Makefiles, with one exception.
That one exception is BeOS, which apparently has draconian stack space
limits, such that GCC needs to use the C alloca even when being
compiled by GCC.  Forcing that is now much easier.  It is possible
that even more gunk could go away; I took out only obviously-related
stuff.  For instance, "CLIB=-lPW" in numerous x-host files may now be
unnecessary, but as I have no idea what libPW was, I left it alone.

Third, a side effect is that alloca is not available at all in
programs run during bootstrap; so all those programs are converted to
use some other form of allocation.  If you don't like this, give me a
build-time libiberty.

I tested this by running a bootstrap with CC set to "cc -DUSE_C_ALLOCA" 
on i686-linux.  This mimics an environment where GCC is not the system
compiler.  It would be nice if someone could test this patch on a host
where GCC really isn't the system compiler.

Should I continue to list every file below config/ touched by these
patches?  The lists are getting unwieldy.

zw

libiberty:
	* aclocal.m4 (libiberty_AC_FUNC_C_ALLOCA): New.
	* configure.in: Replace all alloca logic with a simple use of
	the above new macro.
	* config.table: Kill *-*-beos* entry.
	* config/mh-beos: Delete.
	* configure, config.in: Regenerate.

	* Makefile.in (ALLOCA, HFILES): Kill.
	(REQUIRED_OFILES): Add alloca.o.
	(alloca.o): Depend on libiberty.h.
	(argv.o): Don't depend on alloca-conf.h.
	* alloca-conf.h: Delete.
	* alloca.c: Include libiberty.h.  Kill all #ifdef emacs
	blocks.  Provide the C alloca unconditionally.  Use PTR where
	appropriate.  Make i00afunc static.
	* argv.c: Don't include alloca-conf.h.

include:
	* libiberty.h: Prototype C_alloca; define alloca to either
	__builtin_alloca or C_alloca as appropriate.

gcc:
	* aclocal.m4 (AM_GNU_GETTEXT): Don't AC_REQUIRE
	AC_FUNC_ALLOCA.
	* configure, config.in: Regenerate.
	* config.gcc: Remove references to deleted files.

	* genattr.c, genattrtab.c, genextract.c, genoutput.c,
	genrecog.c, rtl.c: Do not use alloca anywhere.

	* Makefile.in, build-make, system.h, config/x-interix,
	config/x-svr4, config/xm-interix.h, config/xm-openbsd.h,
	config/alpha/xm-alpha.h, config/alpha/xm-vms.h,
	config/arc/xm-arc.h, config/arm/xm-arm.h,
	config/d30v/xm-d30v.h, config/dsp16xx/xm-dsp16xx.h,
	config/h8300/xm-h8300.h, config/i370/x-oe,
	config/i370/xm-linux.h, config/i386/x-aix, config/i386/x-beos,
	config/i386/x-ncr3000, config/i386/x-sco5,
	config/i386/xm-dgux.h, config/i860/x-sysv4,
	config/i960/xm-i960.h, config/m32r/xm-m32r.h,
	config/m68k/x-crds, config/m68k/x-dpx2, config/m68k/x-hp320,
	config/m68k/x-hp320g, config/m69k/x-mot3300,
	config/m68k/x-mot3300-gas, config/m68k/xm-amix.h,
	config/m68k/xm-hp320.h, config/m68k/xm-m68kv.h,
	config/m68k/xm-mot3300.h, config/m88k/x-dolph,
	config/m88k/x-sysv4, config/m88k/x-tekXD88,
	config/m88k/xm-m88k.h, config/mcore/xm-mcore.h,
	config/mips/x-iris, config/mips/x-iris3,
	config/mips/x-sni-svr4, config/mips/x-sysv,
	config/mips/xm-iris6.h, config/mips/xm-mips.h,
	config/mips/xm-nws3250v4.h, config/pa/x-hpux,
	config/pa/x-pa-mpeix, config/pa/xm-pa.h,
	config/pa/xm-pa64hpux.h, config/pa/xm-pahpux.h,
	config/pa/xm-papro.h, config/romp/xm-romp.h,
	config/rs6000/x-aix31, config/rs6000/x-aix41,
	config/rs6000/x-beos, config/rs6000/x-lynx,
	config/rs6000/x-mach, config/rs6000/x-rs6000,
	config/rs6000/x-sysv4, config/rs6000/xm-rs6000.h,
	config/rs6000/xm-sysv4.h, config/sh/xm-sh.h,
	config/sparc/x-sysv4, config/sparc/xm-linux.h,
	config/sparc/xm-pbd.h, config/sparc/xm-sparc.h,
	config/vax/xm-vms.h: Eradicate all references to alloca and
	related stuff.

	* config/xm-alloca.h, config/clipper/x-clix,
	config/i386/xm-sysv4.h, config/i860/x-fx2800,
	config/i860/x-sysv3, config/m88k/x-sysv3,
	config/sparc/xm-sol2.h, config/we32k/x-we32k: Delete
	(contained only alloca related hacks).

	* config/i386/xm-beos.h, config/rs6000/xm-beos.h: Just define
	USE_C_ALLOCA.

===================================================================
Index: include/libiberty.h
--- include/libiberty.h	2000/11/22 08:32:26	1.14
+++ include/libiberty.h	2001/03/05 08:37:38
@@ -206,6 +206,20 @@ extern int vasprintf PARAMS ((char **, c
 
 #define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
 
+/* Drastically simplified alloca configurator.  If we're using GCC,
+   we use __builtin_alloca; otherwise we use the C alloca.  The C
+   alloca is always available.  You can override GCC by defining
+   USE_C_ALLOCA yourself.  */
+extern PTR C_alloca PARAMS((size_t));
+#undef alloca
+#if GCC_VERSION >= 2000 && !defined USE_C_ALLOCA
+# define alloca(x) __builtin_alloca(x)
+#else
+# define alloca(x) C_alloca(x)
+# undef USE_C_ALLOCA
+# define USE_C_ALLOCA 1
+#endif
+
 #ifdef __cplusplus
 }
 #endif
===================================================================
Index: libiberty/Makefile.in
--- libiberty/Makefile.in	2000/12/08 23:16:27	1.57
+++ libiberty/Makefile.in	2001/03/05 08:37:38
@@ -64,7 +64,6 @@ MAKEOVERRIDES =
 TARGETLIB = libiberty.a
 
 LIBOBJS = @LIBOBJS@
-ALLOCA = @ALLOCA@
 
 # A configuration can specify extra .o files that should be included,
 # even if they are in libc. (Perhaps the libc version is buggy.)
@@ -118,9 +117,6 @@ install-info: install-info-subdir
 clean-info: clean-info-subdir
 dvi: dvi-subdir
 
-# Include files that are in this directory.
-HFILES = alloca-conf.h
-
 # NOTE: If you add new files to the library, add them to this list
 # (alphabetical), and add them to REQUIRED_OFILES or funcs in
 # configure.in.
@@ -138,17 +134,17 @@ CFILES = asprintf.c alloca.c argv.c atex
 	xmalloc.c xmemdup.c xstrdup.c xstrerror.c
 
 # These are always included in the library.
-REQUIRED_OFILES = argv.o choose-temp.o concat.o cplus-dem.o cp-demangle.o     \
-	dyn-string.o fdmatch.o fnmatch.o getopt.o getopt1.o getpwd.o          \
-	getruntime.o hashtab.o hex.o floatformat.o md5.o objalloc.o obstack.o \
-	partition.o pexecute.o safe-ctype.o sort.o spaces.o splay-tree.o      \
-	strerror.o strsignal.o xatexit.o xexit.o xmalloc.o xmemdup.o          \
-	xstrdup.o xstrerror.o
+REQUIRED_OFILES = argv.o alloca.o choose-temp.o concat.o cplus-dem.o           \
+	cp-demangle.o dyn-string.o fdmatch.o fnmatch.o getopt.o getopt1.o      \
+	getpwd.o getruntime.o hashtab.o hex.o floatformat.o md5.o objalloc.o   \
+	obstack.o partition.o pexecute.o safe-ctype.o sort.o spaces.o          \
+	splay-tree.o strerror.o strsignal.o xatexit.o xexit.o xmalloc.o        \
+	xmemdup.o xstrdup.o xstrerror.o
 
-$(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA)
+$(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
 	-rm -f $(TARGETLIB)
 	$(AR) $(AR_FLAGS) $(TARGETLIB) \
-	  $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA)
+	  $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
 	$(RANLIB) $(TARGETLIB)
 
 INSTALL_DEST = @INSTALL_DEST@
@@ -197,8 +193,8 @@ stamp-picdir:
 
 etags tags: TAGS etags-subdir
 
-TAGS: $(CFILES) $(HFILES)
-	etags `for i in $(HFILES) $(CFILES); do echo $(srcdir)/$$i ; done`
+TAGS: $(CFILES)
+	etags `for i in $(CFILES); do echo $(srcdir)/$$i ; done`
 
 # The standalone demangler (c++filt) has been moved to binutils.
 demangle:
@@ -207,7 +203,7 @@ demangle:
 	@false
 
 ls:
-	@echo Makefile $(HFILES) $(CFILES)
+	@echo Makefile $(CFILES)
 
 # Need to deal with profiled libraries, too.
 
@@ -243,7 +239,6 @@ stamp-h: config.in config.status
 config.status: $(srcdir)/configure $(srcdir)/config.table
 	$(SHELL) ./config.status --recheck
 
-
 all-subdir check-subdir installcheck-subdir info-subdir	\
 install-info-subdir clean-info-subdir dvi-subdir install-subdir	\
 etags-subdir mostlyclean-subdir clean-subdir distclean-subdir \
@@ -254,11 +249,11 @@ maintainer-clean-subdir:
 	  cd $$dir && $(MAKE) $$target; \
 	done
 
-$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) $(ALLOCA): stamp-picdir
+$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS): stamp-picdir
 
-alloca.o: config.h
+alloca.o: config.h $(INCDIR)/libiberty.h
 atexit.o: config.h
-argv.o: config.h alloca-conf.h $(INCDIR)/libiberty.h
+argv.o: config.h $(INCDIR)/libiberty.h
 basename.o: $(INCDIR)/libiberty.h
 choose-temp.o: config.h
 clock.o: config.h
===================================================================
Index: libiberty/aclocal.m4
--- libiberty/aclocal.m4	2000/11/22 08:32:26	1.3
+++ libiberty/aclocal.m4	2001/03/05 08:37:39
@@ -134,3 +134,55 @@ define(AC_DEFINE_NOAUTOHEADER,
 [#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
 EOF
 ])
+
+# We always want a C version of alloca() compiled into libiberty,
+# because native-compiler support for the real alloca is so !@#$%
+# unreliable that GCC has decided to use it only when being compiled
+# by GCC.  This is the part of AC_FUNC_ALLOCA that calculates the
+# information alloca.c needs.
+AC_DEFUN(libiberty_AC_FUNC_C_ALLOCA,
+[AC_CACHE_CHECK(whether alloca needs Cray hooks, ac_cv_os_cray,
+[AC_EGREP_CPP(webecray,
+[#if defined(CRAY) && ! defined(CRAY2)
+webecray
+#else
+wenotbecray
+#endif
+], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
+if test $ac_cv_os_cray = yes; then
+  for ac_func in _getb67 GETB67 getb67; do
+    AC_CHECK_FUNC($ac_func, 
+      [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func, 
+  [Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP
+   systems. This function is required for alloca.c support on those
+   systems.])  break])
+  done
+fi
+
+AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
+[AC_TRY_RUN([find_stack_direction ()
+{
+  static char *addr = 0;
+  auto char dummy;
+  if (addr == 0)
+    {
+      addr = &dummy;
+      return find_stack_direction ();
+    }
+  else
+    return (&dummy > addr) ? 1 : -1;
+}
+main ()
+{
+  exit (find_stack_direction() < 0);
+}], 
+  ac_cv_c_stack_direction=1,
+  ac_cv_c_stack_direction=-1,
+  ac_cv_c_stack_direction=0)])
+AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction,
+  [Define if you know the direction of stack growth for your system;
+   otherwise it will be automatically deduced at run-time.
+        STACK_DIRECTION > 0 => grows toward higher addresses
+        STACK_DIRECTION < 0 => grows toward lower addresses
+        STACK_DIRECTION = 0 => direction of growth unknown])
+])
===================================================================
Index: libiberty/alloca-conf.h
--- libiberty/alloca-conf.h	Mon Mar  5 00:37:48 2001
+++ libiberty/alloca-conf.h	Tue May  5 13:32:27 1998
@@ -1,24 +0,0 @@
-#include "config.h"
-
-#if defined(__GNUC__) && !defined(C_ALLOCA)
-# ifndef alloca
-#  define alloca __builtin_alloca
-# endif
-#else /* ! defined (__GNUC__) */
-#  ifdef _AIX
- #pragma alloca
-#  else
-#  if defined(HAVE_ALLOCA_H) && !defined(C_ALLOCA)
-#   include <alloca.h>
-#  else /* ! defined (HAVE_ALLOCA_H) */
-#   ifdef __STDC__
-extern PTR alloca (size_t);
-#   else /* ! defined (__STDC__) */
-extern PTR alloca ();
-#   endif /* ! defined (__STDC__) */
-#  endif /* ! defined (HAVE_ALLOCA_H) */
-#  ifdef _WIN32
-#   include <malloc.h>
-#  endif
-# endif /* ! defined (_AIX) */
-#endif /* ! defined (__GNUC__) */
===================================================================
Index: libiberty/alloca.c
--- libiberty/alloca.c	1998/09/05 10:42:18	1.3
+++ libiberty/alloca.c	2001/03/05 08:37:39
@@ -25,6 +25,8 @@
 #include <config.h>
 #endif
 
+#include <libiberty.h>
+
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
@@ -32,67 +34,20 @@
 #include <stdlib.h>
 #endif
 
-#ifdef emacs
-#include "blockinput.h"
-#endif
-
-/* If compiling with GCC 2, this file's not needed.  Except of course if
-   the C alloca is explicitly requested.  */
-#if defined (USE_C_ALLOCA) || !defined (__GNUC__) || __GNUC__ < 2
-
-/* If someone has defined alloca as a macro,
-   there must be some other way alloca is supposed to work.  */
-#ifndef alloca
-
-#ifdef emacs
-#ifdef static
-/* actually, only want this if static is defined as ""
-   -- this is for usg, in which emacs must undefine static
-   in order to make unexec workable
-   */
-#ifndef STACK_DIRECTION
-you
-lose
--- libiberty/alloca.c	know STACK_DIRECTION at compile-time
-#endif /* STACK_DIRECTION undefined */
-#endif /* static */
-#endif /* emacs */
-
 /* If your stack is a linked list of frames, you have to
    provide an "address metric" ADDRESS_FUNCTION macro.  */
 
 #if defined (CRAY) && defined (CRAY_STACKSEG_END)
-long i00afunc ();
+static long i00afunc ();
 #define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
 #else
 #define ADDRESS_FUNCTION(arg) &(arg)
 #endif
 
-#if __STDC__
-typedef void *pointer;
-#else
-typedef char *pointer;
-#endif
-
 #ifndef NULL
 #define	NULL	0
 #endif
 
-/* Different portions of Emacs need to call different versions of
-   malloc.  The Emacs executable needs alloca to call xmalloc, because
-   ordinary malloc isn't protected from input signals.  On the other
-   hand, the utilities in lib-src need alloca to call malloc; some of
-   them are very simple, and don't have an xmalloc routine.
-
-   Non-Emacs programs expect this to call use xmalloc.
-
-   Callers below should use malloc.  */
-
-#ifndef emacs
-#define malloc xmalloc
-#endif
-extern pointer malloc ();
-
 /* Define STACK_DIRECTION if you know the direction of stack
    growth for your system; otherwise it will be automatically
    deduced at run-time.
@@ -168,9 +123,9 @@ static header *last_alloca_header = NULL
    caller, but that method cannot be made to work for some
    implementations of C, for example under Gould's UTX/32.  */
 
-pointer
-alloca (size)
-     unsigned size;
+PTR
+C_alloca (size)
+     size_t size;
 {
   auto char probe;		/* Probes stack depth: */
   register char *depth = ADDRESS_FUNCTION (probe);
@@ -186,17 +141,13 @@ alloca (size)
   {
     register header *hp;	/* Traverses linked list.  */
 
-#ifdef emacs
-    BLOCK_INPUT;
-#endif
-
     for (hp = last_alloca_header; hp != NULL;)
       if ((STACK_DIR > 0 && hp->h.deep > depth)
 	  || (STACK_DIR < 0 && hp->h.deep < depth))
 	{
 	  register header *np = hp->h.next;
 
-	  free ((pointer) hp);	/* Collect garbage.  */
+	  free ((PTR) hp);	/* Collect garbage.  */
 
 	  hp = np;		/* -> next header.  */
 	}
@@ -204,10 +155,6 @@ alloca (size)
 	break;			/* Rest are not deeper.  */
 
     last_alloca_header = hp;	/* -> last valid storage.  */
-
-#ifdef emacs
-    UNBLOCK_INPUT;
-#endif
   }
 
   if (size == 0)
@@ -216,7 +163,7 @@ alloca (size)
   /* Allocate combined header + user data storage.  */
 
   {
-    register pointer new = malloc (sizeof (header) + size);
+    register PTR new = xmalloc (sizeof (header) + size);
     /* Address of header.  */
 
     if (new == 0)
@@ -229,7 +176,7 @@ alloca (size)
 
     /* User storage begins just after header.  */
 
-    return (pointer) ((char *) new + sizeof (header));
+    return (PTR) ((char *) new + sizeof (header));
   }
 }
 
@@ -500,6 +447,3 @@ i00afunc (long address)
 
 #endif /* not CRAY2 */
 #endif /* CRAY */
-
-#endif /* no alloca */
-#endif /* not GCC version 2 */
===================================================================
Index: libiberty/argv.c
--- libiberty/argv.c	2000/12/08 03:00:26	1.7
+++ libiberty/argv.c	2001/03/05 08:37:39
@@ -48,7 +48,6 @@ extern char *strdup ();		/* Duplicate a 
 
 #endif	/* __STDC__ */
 
-#include "alloca-conf.h"
 
 #ifndef NULL
 #define NULL 0
===================================================================
Index: libiberty/config.table
--- libiberty/config.table	2000/05/11 14:16:25	1.16
+++ libiberty/config.table	2001/03/05 08:37:39
@@ -6,7 +6,6 @@ case "${host}" in
   *-*-freebsd2.2.[012])	frag=mh-fbsd21 ;;
   i370-*-opened*)       frag=mh-openedition ;;
   i[345]86-*-windows*)	frag=mh-windows ;;
-  *-*-beos*)		frag=mh-beos ;;
 esac
 
 frags=$frag
===================================================================
Index: libiberty/configure.in
--- libiberty/configure.in	2000/12/26 22:16:22	1.31
+++ libiberty/configure.in	2001/03/05 08:37:39
@@ -142,8 +142,7 @@ fi
 
 # For each of these functions, if the host does not provide the
 # function we want to put FN.o in LIBOBJS, and if the host does
-# provide the function, we want to define HAVE_FN in config.h.  Also,
-# if the host does not provide alloca, we set ALLOCA to alloca.o
+# provide the function, we want to define HAVE_FN in config.h.
 
 setobjs=
 CHECK=
@@ -158,7 +157,6 @@ if test -n "${with_target_subdir}"; then
   # newlib provide and which ones we will be expected to provide.
 
   if test "x${with_newlib}" = "xyes"; then
-    ALLOCA="alloca.o"
     LIBOBJS="asprintf.o basename.o insque.o random.o strdup.o vasprintf.o"
 
     for f in $funcs; do
@@ -277,28 +275,7 @@ if test -z "${setobjs}"; then
   # tests.  This will only work if the compiler works.
   AC_PROG_CC_WORKS
   AC_REPLACE_FUNCS($funcs)
-
-  case "${host}" in
-  *-*-interix)
-    # On Interix, it wrongly concludes that the MSVC compiler supports alloca.
-    # (MSVC does on Win32, not on Interix.)
-    # This should be temporary.
-
-    ac_cv_header_alloca_h=no
-    ac_cv_func_alloca_works=no
-    ALLOCA=alloca.o
-    cat >> confdefs.h <<\EOF
-#define C_ALLOCA 1
-EOF
-    cat >> confdefs.h <<EOF
-#define STACK_DIRECTION -1
-EOF
-    ;;
-  *)
-    AC_FUNC_ALLOCA
-    ;;
-  esac
-
+  libiberty_AC_FUNC_C_ALLOCA
   AC_FUNC_VFORK
   if test $ac_cv_func_vfork_works = no; then
     LIBOBJS="$LIBOBJS vfork.o"
===================================================================
Index: libiberty/config/mh-beos
--- libiberty/config/mh-beos	Mon Mar  5 00:37:49 2001
+++ libiberty/config/mh-beos	Tue May  5 13:32:27 1998
@@ -1,7 +0,0 @@
-# Host makefile fragment for BeOS
-
-# This is a temporary hack until the wimpy default 64k stack
-# limit in BeOS is either increased or made user settable somehow.
-# This probably won't happen until after the DR9 release.
-
-EXTRA_OFILES = alloca.o
===================================================================
Index: gcc/Makefile.in
--- gcc/Makefile.in	2001/03/03 03:31:59	1.615
+++ gcc/Makefile.in	2001/03/05 08:37:33
@@ -58,10 +58,6 @@ INTL_TARGETS = intl.all intl.install
 # This is overridden by configure.
 BOOT_LANGUAGES = c @all_boot_languages@
 
-ALLOCA =
-ALLOCA_FLAGS =
-ALLOCA_FINISH = true
-
 # Various ways of specifying flags for compilations:
 # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
 # BOOT_CFLAGS is the value of CFLAGS to pass to the stage2 and stage3
@@ -509,7 +505,6 @@ HOST_CFLAGS=$(ALL_CFLAGS) -DGENERATOR_FI
 HOST_CLIB=$(CLIB)
 HOST_LDFLAGS=$(LDFLAGS)
 HOST_CPPFLAGS=$(ALL_CPPFLAGS)
-HOST_ALLOCA=$(ALLOCA)
 HOST_MALLOC=$(MALLOC)
 HOST_OBSTACK=$(OBSTACK)
 HOST_VFPRINTF=$(VFPRINTF)
@@ -604,34 +599,32 @@ ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLA
 # Likewise.
 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
 
-# Even if ALLOCA is set, don't use it if compiling with GCC.
-USE_ALLOCA= ${ALLOCA}
-USE_HOST_ALLOCA= ` case "${HOST_ALLOCA}" in ?*) echo ${HOST_PREFIX}${HOST_ALLOCA} ;; esac `
 USE_HOST_MALLOC= ` case "${HOST_MALLOC}" in ?*) echo ${HOST_PREFIX}${HOST_MALLOC} ;; esac `
 USE_HOST_OBSTACK= ` case "${HOST_OBSTACK}" in ?*) echo ${HOST_PREFIX}${HOST_OBSTACK} ;; esac `
 USE_HOST_VFPRINTF= ` case "${HOST_VFPRINTF}" in ?*) echo ${HOST_PREFIX}${HOST_VFPRINTF} ;; esac `
 USE_HOST_DOPRINT= ` case "${HOST_DOPRINT}" in ?*) echo ${HOST_PREFIX}${HOST_DOPRINT} ;; esac `
 USE_HOST_STRSTR= ` case "${HOST_STRSTR}" in ?*) echo ${HOST_PREFIX}${HOST_STRSTR} ;; esac `
 
-# Dependency on obstack, alloca, malloc or whatever library facilities
+# Dependency on obstack, malloc or whatever library facilities
 # are not installed in the system libraries.
-# We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
-LIBDEPS= $(INTLLIBS) $(OBSTACK) $(ALLOCA) $(MALLOC) $(VFPRINTF) $(DOPRINT) $(STRSTR)
+# We don't use USE_* because backquote expansion doesn't work in deps.
+LIBDEPS= $(INTLLIBS) $(OBSTACK) $(MALLOC) $(VFPRINTF) $(DOPRINT) $(STRSTR)
 
 # Likewise, for use in the tools that must run on this machine
 # even if we are cross-building GCC.
-# We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
-HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_PREFIX)$(HOST_MALLOC) $(HOST_PREFIX)$(HOST_VFPRINTF) $(HOST_PREFIX)$(HOST_DOPRINT) $(HOST_PREFIX)$(HOST_STRSTR)
+HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_MALLOC) \
+	$(HOST_PREFIX)$(HOST_VFPRINTF) $(HOST_PREFIX)$(HOST_DOPRINT) \
+	$(HOST_PREFIX)$(HOST_STRSTR)
 
 # How to link with both our special library facilities
 # and the system's installed libraries.
-LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(INTLLIBS) @LIBS@ $(VFPRINTF) $(DOPRINT) $(STRSTR) $(CLIB) ../libiberty/libiberty.a
+LIBS =	$(OBSTACK) $(MALLOC) $(INTLLIBS) @LIBS@ $(VFPRINTF) $(DOPRINT) \
+	$(STRSTR) $(CLIB) ../libiberty/libiberty.a
 
 # Likewise, for use in the tools that must run on this machine
 # even if we are cross-building GCC.
-HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC)  \
-	    $(USE_HOST_VFPRINTF) $(USE_HOST_DOPRINT) $(USE_HOST_STRSTR)  \
-	    $(HOST_CLIB)
+HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_MALLOC) $(USE_HOST_VFPRINTF) \
+	    $(USE_HOST_DOPRINT) $(USE_HOST_STRSTR) $(HOST_CLIB)
 
 HOST_RTL = $(HOST_PREFIX)rtl.o $(HOST_PREFIX)bitmap.o \
 		$(HOST_PREFIX)ggc-none.o gensupport.o hashtab.o safe-ctype.o
@@ -1557,15 +1550,6 @@ mips-tdump.o : mips-tdump.c $(CONFIG_H) 
 # Build file to support OSF/rose half-pic format.
 halfpic.o: halfpic.c $(CONFIG_H) $(RTL_H) $(TREE_H) system.h
 
-# Normally this target is not used; but it is used if you
-# define ALLOCA=alloca.o.  In that case, you must get a suitable alloca.c
-# from the GNU Emacs distribution.
-alloca.o:	$(srcdir)/../libiberty/alloca.c
-	rm -f alloca.c
-	$(LN_S) $(srcdir)/../libiberty/alloca.c alloca.c
-	$(CC) $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) \
-	$(ALLOCA_FLAGS) -c alloca.c
-	$(ALLOCA_FINISH)
 #
 # Generate header and source files from the machine description,
 # and compile them.
@@ -1818,7 +1802,7 @@ gengenrtl.o : gengenrtl.c $(RTL_BASE_H) 
 # Compile the libraries to be used by gen*.
 # If we are not cross-building, gen* use the same .o's that cc1 will use,
 # and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict
-# with the rules for rtl.o, alloca.o, etc.
+# with the rules for rtl.o, etc.
 $(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(GCONFIG_H) system.h $(RTL_H) \
   bitmap.h $(GGC_H) toplev.h $(HASHTAB_H)
 	rm -f $(HOST_PREFIX)rtl.c
@@ -1837,11 +1821,6 @@ $(HOST_PREFIX_1)bitmap.o: $(srcdir)/bitm
 	sed -e 's/config[.]h/hconfig.h/' $(srcdir)/bitmap.c > $(HOST_PREFIX)bitmap.c
 	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)bitmap.c
 
-$(HOST_PREFIX_1)alloca.o: $(srcdir)/../libiberty/alloca.c
-	rm -f $(HOST_PREFIX)alloca.c
-	$(LN_S) $(srcdir)/../libiberty/alloca.c $(HOST_PREFIX)alloca.c
-	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c
-
 $(HOST_PREFIX_1)obstack.o: $(srcdir)/../libiberty/obstack.c $(GCONFIG_H)
 	rm -f $(HOST_PREFIX)obstack.c
 	sed -e 's/config[.]h/hconfig.h/' $(srcdir)/../libiberty/obstack.c > $(HOST_PREFIX)obstack.c
@@ -1874,7 +1853,7 @@ $(HOST_PREFIX_1)errors.o: errors.c
 
 
 # This satisfies the dependency that we get if you cross-compile a compiler
-# that does not need to compile alloca, malloc or whatever.
+# that does not need to compile, malloc or whatever.
 $(HOST_PREFIX_1):
 	touch $(HOST_PREFIX_1)
 
@@ -2293,7 +2272,7 @@ mostlyclean: $(INTL_MOSTLYCLEAN) lang.mo
 	-rm -rf libgcc
 # Delete the temporary source copies for cross compilation.
 	-rm -f $(HOST_PREFIX_1)rtl.c
-	-rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c
+	-rm -f $(HOST_PREFIX_1)malloc.c
 	-rm -f $(HOST_PREFIX_1)obstack.c
 # Delete the temp files made in the course of building libgcc.a.
 	-rm -f xlimits.h libgcc1-test
@@ -2307,7 +2286,7 @@ mostlyclean: $(INTL_MOSTLYCLEAN) lang.mo
 	-rm -f *.[0-9][0-9].* */*.[0-9][0-9].*
 # Delete some files made during installation.
 	-rm -f specs float.h-* enquire SYSCALLS.c.X SYSCALLS.c
-	-rm -f collect collect2 mips-tfile mips-tdump alloca.s
+	-rm -f collect collect2 mips-tfile mips-tdump
 # Delete files generated for fixproto
 	-rm -rf fix-header xsys-protos.h deduced.h tmp-deduced.h \
 	  gen-protos$(build_exeext) fixproto.list fixtmp.* fixhdr.ready
@@ -2362,7 +2341,7 @@ distclean: clean $(INTL_DISTCLEAN) lang.
 	-rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak
 	-rm -f testsuite/{gcc,g++}.{log,sum}
 	-rm -f intl/libintl.h libintl.h
-	-rm -f cxxmain.c splay-tree.c obstack.c alloca.c hashtab.c safe-ctype.c
+	-rm -f cxxmain.c splay-tree.c obstack.c hashtab.c safe-ctype.c
 	-rm -f mklibgcc libgcc.map gccbug .gdbinit configargs.h
 	-rm -f gcov.pod
 	-rm -f fixinc/Makefile
@@ -2902,11 +2881,6 @@ stage1_copy: stage1_build
 	touch stage1_copy
 	echo stage2_build > stage_last
 
-# This used to define ALLOCA as empty, but that would lead to bad results
-# for a subsequent `make install' since that would not have ALLOCA empty.
-# To prevent `make install' from compiling alloca.o and then relinking cc1
-# because alloca.o is newer, we permit these recursive makes to compile
-# alloca.o.  Then cc1 is newer, so it won't have to be relinked.
 stage2_build: stage1_copy
 	$(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \
 		 STAGE_PREFIX=stage1/ \
===================================================================
Index: gcc/aclocal.m4
--- gcc/aclocal.m4	2001/02/18 03:18:38	1.41
+++ gcc/aclocal.m4	2001/03/05 08:37:33
@@ -566,7 +566,6 @@ AC_DEFUN(AM_GNU_GETTEXT,
    AC_REQUIRE([AC_C_INLINE])dnl
    AC_REQUIRE([AC_TYPE_OFF_T])dnl
    AC_REQUIRE([AC_TYPE_SIZE_T])dnl
-   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
 
    AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
 unistd.h sys/param.h])
===================================================================
Index: gcc/build-make
--- gcc/build-make	2001/01/03 14:23:39	1.6
+++ gcc/build-make	2001/03/05 08:37:33
@@ -16,7 +16,6 @@ HOST_CFLAGS=$(INTERNAL_CFLAGS) $(T_CFLAG
 HOST_CLIB=
 HOST_LDFLAGS=$(LDFLAGS)
 HOST_CPPFLAGS=$(ALL_CPPFLAGS)
-HOST_ALLOCA=$(ALLOCA)
 HOST_MALLOC=$(MALLOC)
 HOST_OBSTACK=$(OBSTACK)
 
===================================================================
Index: gcc/config.gcc
--- gcc/config.gcc	2001/03/02 01:50:47	1.33
+++ gcc/config.gcc	2001/03/05 08:37:34
@@ -610,7 +610,6 @@ c4x-*)
 clipper-intergraph-clix*)
 	tm_file="${tm_file} svr3.h clipper/clix.h"
 	xm_file=clipper/xm-clix.h
-	xmake_file=clipper/x-clix
 	extra_headers=va-clipper.h
 	extra_parts="crtbegin.o crtend.o"
 	install_headers_dir=install-headers-cpio
@@ -945,7 +944,7 @@ i370-*-linux*)
 	fi
 	;;
 i[34567]86-*-chorusos*)
-	xm_file="${xm_file} xm-svr4.h i386/xm-sysv4.h"
+	xm_file="${xm_file} xm-svr4.h"
 	tm_file="i386/i386.h i386/att.h elfos.h i386/i386afe.h i386/i386elf.h i386/chorus.h"
 	tmake_file=i386/t-i386elf
 	xmake_file=x-svr4
@@ -956,7 +955,7 @@ i[34567]86-*-chorusos*)
 	esac
 	;;
 i[34567]86-*-elf*)
-	xm_file="${xm_file} xm-svr4.h i386/xm-sysv4.h"
+	xm_file="${xm_file} xm-svr4.h"
 	tm_file="i386/i386.h i386/att.h elfos.h i386/i386afe.h i386/i386elf.h"
 	tmake_file=i386/t-i386elf
 	xmake_file=x-svr4
@@ -971,12 +970,10 @@ i[34567]86-ibm-aix*)		# IBM PS/2 running
 		tm_file=i386/aix386ng.h
 		use_collect2=yes
 	fi
-	xm_file="xm-alloca.h ${xm_file}"
 	xm_defines=USG
 	xmake_file=i386/x-aix
 	;;
 i[34567]86-ncr-sysv4*)		# NCR 3000 - ix86 running system V.4
-	xm_file="xm-alloca.h ${xm_file}"
 	xm_defines="USG POSIX SMALL_ARG_MAX"
 	xmake_file=i386/x-ncr3000
 	if test x$stabs = xyes -a x$gas = xyes
@@ -1029,7 +1026,6 @@ i[34567]86-sequent-ptx2* | i[34567]86-se
 	install_headers_dir=install-headers-cpio
 	;;
 i[34567]86-sequent-ptx4* | i[34567]86-sequent-sysv4*)
-	xm_file="xm-alloca.h ${xm_file}"
 	if test x$gas = xyes
 	then
 		tm_file="${tm_file} usegas.h"
@@ -1251,7 +1247,7 @@ i[34567]86-*-rtems*|i[34567]86-*-rtemsel
 	fi
 	;;
 i[34567]86-*-sco3.2v5*)	# 80386 running SCO Open Server 5
-	xm_file="xm-alloca.h ${xm_file} i386/xm-sco5.h"
+	xm_file="${xm_file} i386/xm-sco5.h"
 	xm_defines="USG SVR3"
 	xmake_file=i386/x-sco5
 	install_headers_dir=install-headers-cpio
@@ -1305,7 +1301,6 @@ i[34567]86-*-sco*)	 	# 80386 running SCO
 	truncate_target=yes
 	;;
 i[34567]86-*-solaris2*)
-	xm_file="xm-alloca.h ${xm_file}"
 	xm_defines="USG POSIX SMALL_ARG_MAX"
 	tm_file=i386/sol2.h
 	if test x$gas = xyes; then
@@ -1330,7 +1325,6 @@ i[34567]86-*-solaris2*)
 	fi
 	;;
 i[34567]86-*-sysv5*)           # Intel x86 on System V Release 5
-       xm_file="xm-alloca.h ${xm_file}"
        xm_defines="USG POSIX"
        tm_file=i386/sysv5.h
        if test x$stabs = xyes
@@ -1345,7 +1339,6 @@ i[34567]86-*-sysv5*)           # Intel x
        fi
        ;;
 i[34567]86-*-sysv4*)		# Intel 80386's running system V.4
-	xm_file="xm-alloca.h ${xm_file}"
 	xm_defines="USG POSIX SMALL_ARG_MAX"
 	tm_file=i386/sysv4.h
 	if test x$stabs = xyes
@@ -1357,7 +1350,6 @@ i[34567]86-*-sysv4*)		# Intel 80386's ru
 	extra_parts="crtbegin.o crtend.o"
 	;;
 i[34567]86-*-udk*)      # Intel x86 on SCO UW/OSR5 Dev Kit
-	xm_file="xm-alloca.h ${xm_file}"
 	xm_defines="USG POSIX"
 	tm_file=i386/udk.h
 	tmake_file="i386/t-i386bare i386/t-crtpic i386/t-udk"
@@ -1367,7 +1359,7 @@ i[34567]86-*-udk*)      # Intel x86 on S
 	;;
 i[34567]86-*-osf1*)		# Intel 80386's running OSF/1 1.3+
 	cpu_type=i386
-	xm_file="${xm_file} xm-svr4.h i386/xm-sysv4.h i386/xm-osf1elf.h"
+	xm_file="${xm_file} xm-svr4.h i386/xm-osf1elf.h"
 	xm_defines="USE_C_ALLOCA SMALL_ARG_MAX"
 	if test x$stabs = xyes
 	then
@@ -1475,7 +1467,6 @@ i[34567]86-*-interix*)
 	fi
 	;;
 i[34567]86-dg-dgux*)
-	xm_file="xm-alloca.h ${xm_file}"
 	xm_defines="USG POSIX"
 	out_file=i386/dgux.c
 	tm_file=i386/dgux.h
@@ -1486,7 +1477,6 @@ i[34567]86-dg-dgux*)
 i860-alliant-*)		# Alliant FX/2800
 	tm_file="${tm_file} svr4.h i860/sysv4.h i860/fx2800.h"
 	xm_file="${xm_file}"
-	xmake_file=i860/x-fx2800
 	tmake_file=i860/t-fx2800
 	extra_parts="crtbegin.o crtend.o"
 	;;
@@ -1509,7 +1499,6 @@ i860-*-osf*)			# Intel Paragon XP/S, OSF
 i860-*-sysv3*)
 	tm_file="${tm_file} svr3.h i860/sysv3.h"
 	xm_defines="USG SVR3"
-	xmake_file=i860/x-sysv3
 	extra_parts="crtbegin.o crtend.o"
 	;;
 i860-*-sysv4*)
@@ -1609,7 +1598,6 @@ m68000-hp-bsd*)			# HP 9000/200 running 
 	extra_headers=math-68881.h
 	;;
 m68000-hp-hpux*)		# HP 9000 series 300
-	xm_file="xm-alloca.h ${xm_file}"
 	xm_defines="USG"
 	if test x$gas = xyes
 	then
@@ -1696,7 +1684,6 @@ m68k-bull-sysv*)		# Bull DPX/2
 	else
 		tm_file=m68k/dpx2.h
 	fi
-	xm_file="xm-alloca.h ${xm_file}"
 	xm_defines=USG
 	xmake_file=m68k/x-dpx2
 	use_collect2=yes
@@ -1704,7 +1691,6 @@ m68k-bull-sysv*)		# Bull DPX/2
 	;;
 m68k-atari-sysv4*)              # Atari variant of V.4.
 	tm_file=m68k/atari.h
-	xm_file="xm-alloca.h ${xm_file}"
 	xm_defines=USG
 	tmake_file=t-svr4
 	extra_parts="crtbegin.o crtend.o"
@@ -1713,7 +1699,7 @@ m68k-atari-sysv4*)              # Atari 
 	;;
 m68k-motorola-sysv*)
 	tm_file=m68k/mot3300.h
-	xm_file="xm-alloca.h m68k/xm-mot3300.h ${xm_file}"
+	xm_file="m68k/xm-mot3300.h ${xm_file}"
 	if test x$gas = xyes
 	then
 		xmake_file=m68k/x-mot3300-gas
@@ -1748,19 +1734,17 @@ m68k-ncr-sysv*)			# NCR Tower 32 SVR3
 	;;
 m68k-plexus-sysv*)
 	tm_file=m68k/plexus.h
-	xm_file="xm-alloca.h m68k/xm-plexus.h ${xm_file}"
+	xm_file="m68k/xm-plexus.h ${xm_file}"
 	xm_defines=USG
 	use_collect2=yes
 	extra_headers=math-68881.h
 	;;
 m68k-tti-*)
 	tm_file=m68k/pbb.h
-	xm_file="xm-alloca.h ${xm_file}"
 	xm_defines=USG
 	extra_headers=math-68881.h
 	;;
 m68k-crds-unos*)
-	xm_file="xm-alloca.h ${xm_file}"
 	xm_defines="USG unos"
 	xmake_file=m68k/x-crds
 	tm_file=m68k/crds.h
@@ -1769,7 +1753,6 @@ m68k-crds-unos*)
 	;;
 m68k-cbm-sysv4*)		# Commodore variant of V.4.
 	tm_file=m68k/amix.h
-	xm_file="xm-alloca.h ${xm_file}"
 	xm_defines=USG
 	xmake_file=m68k/x-amix
 	tmake_file=t-svr4
@@ -1808,7 +1791,6 @@ m68k-isi-bsd*)
 	extra_headers=math-68881.h
 	;;
 m68k-hp-hpux7*)	# HP 9000 series 300 running HPUX version 7.
-	xm_file="xm-alloca.h ${xm_file}"
 	xm_defines="USG"
 	if test x$gas = xyes
 	then
@@ -1824,7 +1806,6 @@ m68k-hp-hpux7*)	# HP 9000 series 300 run
 	float_format=m68k
 	;;
 m68k-hp-hpux*)	# HP 9000 series 300
-	xm_file="xm-alloca.h ${xm_file}"
 	xm_defines="USG"
 	if test x$gas = xyes
 	then
@@ -1962,7 +1943,6 @@ m68k*-*-openbsd*)
 	use_collect2=yes
 	;;
 m68k-*-sysv3*)			# Motorola m68k's running system V.3
-	xm_file="xm-alloca.h ${xm_file}"
 	xm_defines=USG
 	extra_parts="crtbegin.o crtend.o"
 	extra_headers=math-68881.h
@@ -1970,7 +1950,6 @@ m68k-*-sysv3*)			# Motorola m68k's runni
 	;;
 m68k-*-sysv4*)			# Motorola m68k's running system V.4
 	tm_file=m68k/m68kv4.h
-	xm_file="xm-alloca.h ${xm_file}"
 	xm_defines=USG
 	tmake_file=t-svr4
 	extra_parts="crtbegin.o crtend.o"
@@ -2096,7 +2075,6 @@ m88k-*-openbsd*)
 m88k-*-sysv3*)
 	tm_file=m88k/sysv3.h
 	extra_parts="crtbegin.o crtend.o"
-	xmake_file=m88k/x-sysv3
 	if test x$gas = xyes
 	then
 		tmake_file=m88k/t-m88k-gas
@@ -2903,7 +2881,6 @@ sh-*-*)
 	;;
 sparc-tti-*)
 	tm_file=sparc/pbd.h
-	xm_file="xm-alloca.h ${xm_file}"
 	xm_defines=USG
 	;;
 sparc64-wrs-vxworks*)
@@ -3013,7 +2990,7 @@ sparcv9-*-solaris2*)
 	else
 		tm_file=sparc/sol2-sld-64.h
 	fi
-	xm_file="sparc/xm-sysv4-64.h sparc/xm-sol2.h"
+	xm_file="sparc/xm-sysv4-64.h"
 	xm_defines="USG POSIX"
 	tmake_file="sparc/t-sol2 sparc/t-sol2-64"
 	if test x$gnu_ld = xyes; then
@@ -3039,7 +3016,7 @@ sparcv9-*-solaris2*)
 	fi
 	;;
 sparc-hal-solaris2*)
-        xm_file="sparc/xm-sysv4.h sparc/xm-sol2.h"
+        xm_file="sparc/xm-sysv4.h"
         xm_defines="USG POSIX"
         tm_file="sparc/sol2.h sparc/hal.h"
         tmake_file="sparc/t-halos sparc/t-sol2"
@@ -3067,7 +3044,7 @@ sparc-*-solaris2*)
 	else
 		tm_file=sparc/sol2-sld.h
 	fi
-	xm_file="sparc/xm-sysv4.h sparc/xm-sol2.h"
+	xm_file="sparc/xm-sysv4.h"
 	xm_defines="USG POSIX"
 	tmake_file=sparc/t-sol2
 	if test x$gnu_ld = xyes; then
@@ -3138,7 +3115,7 @@ sparc-*-sysv4*)
 	extra_parts="crtbegin.o crtend.o"
 	;;
 sparc-*-vxsim*)
-	xm_file="sparc/xm-sysv4.h sparc/xm-sol2.h"
+	xm_file="sparc/xm-sysv4.h"
 	xm_defines="USG POSIX"
 	tm_file=sparc/vxsim.h
 	tmake_file=sparc/t-vxsparc
===================================================================
Index: gcc/system.h
--- gcc/system.h	2001/03/03 03:32:55	1.88
+++ gcc/system.h	2001/03/05 08:37:37
@@ -112,12 +112,7 @@ extern int errno;
 
 #ifdef HAVE_STDLIB_H
 # include <stdlib.h>
-# ifdef USE_C_ALLOCA
-/* Note that systems that use glibc have a <stdlib.h> that includes
-   <alloca.h> that defines alloca, so let USE_C_ALLOCA override this. */
-# undef alloca
 #endif
-#endif
 
 /* If we don't have an overriding definition, set SUCCESS_EXIT_CODE and
    FATAL_EXIT_CODE to EXIT_SUCCESS and EXIT_FAILURE respectively,
@@ -550,11 +545,6 @@ extern void abort PARAMS ((void));
 #define UNION_INIT_ZERO , {0}
 #else
 #define UNION_INIT_ZERO
-#endif
-
-/* GCC now gives implicit declaration warnings for undeclared builtins.  */
-#if defined(__GNUC__) && defined (__SIZE_TYPE__)
-extern void *alloca (__SIZE_TYPE__);
 #endif
 
 /* Various error reporting routines want to use __FUNCTION__.  */
===================================================================
Index: gcc/config/x-interix
--- gcc/config/x-interix	1999/04/10 05:15:24	1.2
+++ gcc/config/x-interix	2001/03/05 08:37:37
@@ -1,11 +1,6 @@
 # These are host overrides
 # From config dir
 
-# Interix doesn't yet have alloca; it's better to use the portable C version for
-# bootstrapping.  Do this by defining ALLOCA.
-
-ALLOCA = alloca.o
-
 # See all the declarations.
 FIXPROTO_DEFINES = -D_XOPEN_SOURCE
 
===================================================================
Index: gcc/config/x-svr4
--- gcc/config/x-svr4	1998/12/16 21:00:18	1.2
+++ gcc/config/x-svr4	2001/03/05 08:37:37
@@ -1,9 +1,2 @@
-# Some versions of SVR4 have an alloca in /usr/ucblib/libucb.a, and if we are
-# careful to link that in after libc we can use it, but since newer versions of
-# SVR4 are dropping libucb, it is better to just use the portable C version for
-# bootstrapping.  Do this by defining ALLOCA.
-
-ALLOCA = alloca.o
-
 # See all the declarations.
 FIXPROTO_DEFINES = -D_XOPEN_SOURCE
===================================================================
Index: gcc/config/xm-alloca.h
--- gcc/config/xm-alloca.h	Mon Mar  5 00:37:43 2001
+++ gcc/config/xm-alloca.h	Tue May  5 13:32:27 1998
@@ -1,4 +0,0 @@
-/* If not compiled with GNU C, use the portable alloca.  */
-#ifndef __GNUC__
-#define USE_C_ALLOCA
-#endif
===================================================================
Index: gcc/config/xm-interix.h
--- gcc/config/xm-interix.h	2001/02/25 05:23:33	1.4
+++ gcc/config/xm-interix.h	2001/03/05 08:37:37
@@ -31,11 +31,6 @@ Boston, MA 02111-1307, USA.  */
 #endif
 #endif
 
-/* If not compiled with GNU C, use the portable alloca.  */
-#ifndef __GNUC__
-#define USE_C_ALLOCA 1
-#endif
-
 /* Our strategy for finding global constructors is a bit different, although
    not a lot. */
 #define DO_GLOBAL_CTORS_BODY						\
===================================================================
Index: gcc/config/xm-openbsd.h
--- gcc/config/xm-openbsd.h	2001/02/24 08:17:40	1.3
+++ gcc/config/xm-openbsd.h	2001/03/05 08:37:37
@@ -27,8 +27,3 @@ Boston, MA 02111-1307, USA.  */
    problems that may occur with gcc's interpretation.  */
 #undef POSIX
 #define POSIX
-
-/* Ensure we get gnu C's defaults.  */
-#ifdef __GNUC__
-#define alloca __builtin_alloca
-#endif
===================================================================
Index: gcc/config/alpha/xm-alpha.h
--- gcc/config/alpha/xm-alpha.h	2001/03/03 03:32:00	1.11
+++ gcc/config/alpha/xm-alpha.h	2001/03/05 08:37:37
@@ -27,19 +27,6 @@ Boston, MA 02111-1307, USA.  */
 #define	HOST_BITS_PER_LONG	64
 #define HOST_BITS_PER_LONGLONG  64
 
-/* If compiled with GNU C, use the builtin alloca.  */
-#ifndef alloca
-#if defined(__GNUC__) && !defined(USE_C_ALLOCA)
-#define alloca __builtin_alloca
-#else
-#if !defined(_WIN32) && !defined(USE_C_ALLOCA) && !defined(OPEN_VMS) && !defined(__INTERIX)
-#include <alloca.h>
-#else
-extern void *alloca ();
-#endif
-#endif
-#endif
-
 /* The host compiler has problems with enum bitfields since it makes
    them signed so we can't fit all our codes in.  */
 
===================================================================
Index: gcc/config/alpha/xm-vms.h
--- gcc/config/alpha/xm-vms.h	2001/02/25 05:23:34	1.7
+++ gcc/config/alpha/xm-vms.h	2001/03/05 08:37:37
@@ -69,8 +69,6 @@ Boston, MA 02111-1307, USA.  */
 #define HAVE_STRERROR
 #define HAVE_ATOLL
 
-#define USE_C_ALLOCA		/* Using alloca.c */
-
 #define HAVE_FCNTL_H 1
 #define HAVE_STDLIB_H 1
 #define HAVE_UNISTD_H 1
@@ -80,12 +78,6 @@ Boston, MA 02111-1307, USA.  */
 #define HAVE_TIME_H 1
 #define STDC_HEADERS 1
 #define HAVE_STRINGIZE 1
-
-#if __STDC__
-extern void *alloca (size_t);
-#else
-extern char *alloca (unsigned int);
-#endif
 
 #define OBJECT_SUFFIX ".obj"
 #define EXECUTABLE_SUFFIX ".exe"
===================================================================
Index: gcc/config/arc/xm-arc.h
--- gcc/config/arc/xm-arc.h	2001/03/03 03:32:00	1.4
+++ gcc/config/arc/xm-arc.h	2001/03/05 08:37:37
@@ -28,8 +28,3 @@ Boston, MA 02111-1307, USA.  */
 /* Doubles are stored in memory with the high order word first.  This
    matters when cross-compiling.  */
 #define HOST_WORDS_BIG_ENDIAN 1
-
-/* If compiled with Sun CC, the use of alloca requires this #include.  */
-#ifndef __GNUC__
-#include "alloca.h"
-#endif
===================================================================
Index: gcc/config/arm/xm-arm.h
--- gcc/config/arm/xm-arm.h	2001/03/03 03:32:00	1.6
+++ gcc/config/arm/xm-arm.h	2001/03/05 08:37:37
@@ -36,11 +36,6 @@ Boston, MA 02111-1307, USA.  */
 
 #define HOST_FLOAT_WORDS_BIG_ENDIAN 1
 
-/* If not compiled with GNU C, use C alloca.  */
-#ifndef __GNUC__
-#define USE_C_ALLOCA
-#endif
-
 /* If we have defined POSIX, but are compiling in the BSD environment, then
    we need to define getcwd in terms of getwd.  */
 #if defined (POSIX) && defined (_BSD_C)
===================================================================
Index: gcc/config/clipper/x-clix
--- gcc/config/clipper/x-clix	Mon Mar  5 00:37:43 2001
+++ gcc/config/clipper/x-clix	Tue May  5 13:32:27 1998
@@ -1 +0,0 @@
-ALLOCA = alloca.o
===================================================================
Index: gcc/config/d30v/xm-d30v.h
--- gcc/config/d30v/xm-d30v.h	2001/03/03 03:32:01	1.6
+++ gcc/config/d30v/xm-d30v.h	2001/03/05 08:37:37
@@ -34,11 +34,3 @@
 
 /* A C expression for the number of bits in `long' on the host machine.  */
 #define HOST_BITS_PER_LONG 32
-
-/* Define this macro to indicate that the compiler is running with the `alloca'
-   implemented in C.  */
-#ifndef __GNUC__
-#define USE_C_ALLOCA
-#else
-#define alloca __builtin_alloca
-#endif
===================================================================
Index: gcc/config/dsp16xx/xm-dsp16xx.h
--- gcc/config/dsp16xx/xm-dsp16xx.h	2001/03/03 03:32:01	1.5
+++ gcc/config/dsp16xx/xm-dsp16xx.h	2001/03/05 08:37:37
@@ -25,10 +25,3 @@ Boston, MA 02111-1307, USA.  */
 #define HOST_BITS_PER_INT 16
 #define HOST_BITS_PER_LONG 32
 #define HOST_BITS_PER_LONGLONG 64
-
-/* If compiled with GNU C, use the built-in alloca */
-#ifdef __GNUC__
-#define alloca __builtin_alloca
-#else
-#define USE_C_ALLOCA
-#endif
===================================================================
Index: gcc/config/h8300/xm-h8300.h
--- gcc/config/h8300/xm-h8300.h	2001/03/03 03:32:01	1.4
+++ gcc/config/h8300/xm-h8300.h	2001/03/05 08:37:37
@@ -24,10 +24,3 @@ Boston, MA 02111-1307, USA.  */
 #define HOST_BITS_PER_INT 16
 #define HOST_BITS_PER_LONG 32
 #define HOST_BITS_PER_LONGLONG 64
-
-/* If compiled with GNU C, use the built-in alloca */
-#ifdef __GNUC__
-#define alloca __builtin_alloca
-#else
-#define USE_C_ALLOCA
-#endif
===================================================================
Index: gcc/config/i370/x-oe
--- gcc/config/i370/x-oe	1999/09/08 06:23:46	1.3
+++ gcc/config/i370/x-oe	2001/03/05 08:37:37
@@ -2,10 +2,6 @@
 # Host is an i370 running OpenEdition
 #
 
-# Use GCC alloca
-
-ALLOCA = alloca.o
-
 # Don't bother fixing up header files, they're wierd
 
 STMP_FIXPROTO =
===================================================================
Index: gcc/config/i370/xm-linux.h
--- gcc/config/i370/xm-linux.h	2001/03/03 03:32:01	1.5
+++ gcc/config/i370/xm-linux.h	2001/03/05 08:37:37
@@ -31,13 +31,7 @@ Boston, MA 02111-1307, USA.  */
 
 #define HOST_WORDS_BIG_ENDIAN    
 
-/* If not compiled with GNU C, use the C alloca and use only int bitfields.  */
+/* If not compiled with GNU C, use only int bitfields.  */
 #ifndef __GNUC__
-#define USE_C_ALLOCA
-#if __STDC__
-extern void *alloca ();
-#else
-extern char *alloca ();
-#endif
 #define ONLY_INT_FIELDS
 #endif
===================================================================
Index: gcc/config/i386/x-aix
--- gcc/config/i386/x-aix	1998/12/16 21:04:51	1.2
+++ gcc/config/i386/x-aix	2001/03/05 08:37:37
@@ -1,6 +1,3 @@
-# There is an alloca in -lbsd, but it is limited to 32K
-ALLOCA = alloca.o
-
 # If you are running out of memory while compiling gcc, with the standard
 # /bin/cc uncomment MALLOCLIB line. That version of malloc is slower but
 # has less overhead than the one in libc.
===================================================================
Index: gcc/config/i386/x-beos
--- gcc/config/i386/x-beos	2000/11/15 15:56:59	1.2
+++ gcc/config/i386/x-beos	2001/03/05 08:37:37
@@ -1,12 +1,5 @@
 # configuration for BeOS
 INSTALL=install -c
 
-# Show we need to use the C version of ALLOCA
-ALLOCA=alloca.o
-# Use it regardless of whether we are compiling with gcc or not.
-USE_ALLOCA= `echo "${ALLOCA}"`
-USE_HOST_ALLOCA= `echo ${HOST_PREFIX}${HOST_ALLOCA}`
-SUBDIR_USE_ALLOCA = `if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi`
-
 # Don't run fixproto
 STMP_FIXPROTO =
===================================================================
Index: gcc/config/i386/x-ncr3000
--- gcc/config/i386/x-ncr3000	1998/12/16 21:04:56	1.2
+++ gcc/config/i386/x-ncr3000	2001/03/05 08:37:37
@@ -17,13 +17,6 @@ CCLIBFLAGS=
 
 # The rest is just x-i386v4.
 
-# Some versions of SVR4 have an alloca in /usr/ucblib/libucb.a, and if we are
-# careful to link that in after libc we can use it, but since newer versions of
-# SVR4 are dropping libucb, it is better to just use the portable C version for
-# bootstrapping.  Do this by defining ALLOCA.
-
-ALLOCA = alloca.o
-
 # We used to build all stages *without* shared libraries because that may make
 # debugging the compiler easier (until there is a GDB which supports
 # both Dwarf *and* svr4 shared libraries).
===================================================================
Index: gcc/config/i386/x-sco5
--- gcc/config/i386/x-sco5	1998/12/16 21:05:02	1.4
+++ gcc/config/i386/x-sco5	2001/03/05 08:37:37
@@ -3,8 +3,6 @@ RANLIB_TEST = false
 CC = cc
 OLDCC = cc
 CCLIBFLAGS =
-# We avoid the ALLOCA in -lPW becuase it gives us an evil index()
-ALLOCA = alloca.o
 
 # See all the declarations.
 FIXPROTO_DEFINES = -D_XOPEN_SOURCE -D_POSIX_C_SOURCE=2
===================================================================
Index: gcc/config/i386/xm-beos.h
--- gcc/config/i386/xm-beos.h	2001/03/03 03:32:01	1.5
+++ gcc/config/i386/xm-beos.h	2001/03/05 08:37:37
@@ -47,3 +47,10 @@ Boston, MA 02111-1307, USA.  */
 #define HAVE_PUTENV
 #endif
 #define HAVE_RENAME
+
+/* This is a temporary hack until the wimpy default 64k stack
+   limit in BeOS is either increased or made user settable somehow.
+   This probably won't happen until after the DR9 release.  */
+#undef USE_C_ALLOCA
+#define USE_C_ALLOCA 1
+
===================================================================
Index: gcc/config/i386/xm-dgux.h
--- gcc/config/i386/xm-dgux.h	2001/02/24 08:17:40	1.3
+++ gcc/config/i386/xm-dgux.h	2001/03/05 08:37:37
@@ -4,8 +4,3 @@
 
 #include "i386/xm-i386.h"
 #include "xm-svr4.h"
-
-/* If not compiled with GNU C, use the portable alloca.  */
-#ifndef __GNUC__
-#define USE_C_ALLOCA
-#endif
===================================================================
Index: gcc/config/i386/xm-sysv4.h
--- gcc/config/i386/xm-sysv4.h	Mon Mar  5 00:37:43 2001
+++ gcc/config/i386/xm-sysv4.h	Tue May  5 13:32:27 1998
@@ -1,5 +0,0 @@
-/* Configuration for GCC for Intel i386 running System V Release 4.  */
-
-#ifdef __HIGHC__
-#include <alloca.h>		/* for MetaWare High-C on NCR System 3000 */
-#endif
===================================================================
Index: gcc/config/i860/x-fx2800
--- gcc/config/i860/x-fx2800	Mon Mar  5 00:37:43 2001
+++ gcc/config/i860/x-fx2800	Tue May  5 13:32:27 1998
@@ -1,7 +0,0 @@
-
-# The Alliant FX2800 is supposed to conform to the SysV R4 i860 ABI,
-# but apparently the native compiler generates non ABI-compliant
-# function prologues and epilogues, so we need the alloca from emacs.
-#  -- hyc@hanauma.jpl.nasa.gov
-
-ALLOCA=alloca.o
===================================================================
Index: gcc/config/i860/x-sysv3
--- gcc/config/i860/x-sysv3	Mon Mar  5 00:37:43 2001
+++ gcc/config/i860/x-sysv3	Tue May  5 13:32:27 1998
@@ -1 +0,0 @@
-ALLOCA=alloca.o
===================================================================
Index: gcc/config/i860/x-sysv4
--- gcc/config/i860/x-sysv4	1998/12/16 21:05:45	1.2
+++ gcc/config/i860/x-sysv4	2001/03/05 08:37:37
@@ -1,36 +1,3 @@
-# The svr4 reference port for the i860 contains an alloca.o routine
-# in /usr/ucblib/libucb.a, but we can't just try to get that by
-# setting CLIB to /usr/ucblib/libucb.a because (unfortunately)
-# there are a lot of other routines in libucb.a which are supposed
-# to be the Berkeley versions of library routines normally found in
-# libc.a and many of these Berkeley versions are badly broken.  Thus,
-# if we try to link programs with libucb.a before libc.a, those
-# programs tend to crash.
-
-# Also, the alloca() routine supplied in early version of svr4 for
-# the i860 is non-ABI compliant.  It doesn't keep the stack aligned
-# to a 16-byte boundary as the ABI requires.
-
-# More importantly however, even a fully ABI compliant alloca() routine
-# would fail to work correctly with some versions of the native svr4 C
-# compiler currently being distributed for the i860 (as of 1/29/92).
-# The problem is that the native C compiler generates non-ABI-compliant
-# function epilogues which cut back the stack (upon function exit) in
-# an incorrect manner.  Specifically, they cut back the stack by adding
-# the nominal *static* frame size (determined statically at compile-time)
-# to the stack pointer rather than setting the stack pointer based upon
-# the current value of the frame pointer (as called for in the i860 ABI).
-# This can cause serious trouble in cases where you repeatedly call a
-# routine which itself calls alloca().  In such cases, the stack will
-# grow continuously until you finally run out of swap space or exceed
-# the system's process size limit.  To avoid this problem (which can
-# arise when a stage1 gcc is being used to build a stage2 gcc) you
-# *must* link in the C language version of alloca() which is supplied
-# with gcc to your stage1 version of gcc.  The following definition
-# forces that to happen.
-
-ALLOCA=alloca.o
-
 # We build all stages *without* shared libraries because that may make
 # debugging the compiler easier (until there is a GDB which supports
 # both Dwarf *and* svr4 shared libraries).
===================================================================
Index: gcc/config/i960/xm-i960.h
--- gcc/config/i960/xm-i960.h	2001/03/03 03:32:02	1.4
+++ gcc/config/i960/xm-i960.h	2001/03/05 08:37:37
@@ -24,8 +24,3 @@ Boston, MA 02111-1307, USA.  */
 #define HOST_BITS_PER_INT 32
 #define HOST_BITS_PER_LONG 32
 #define HOST_BITS_PER_LONGLONG 64
-
-/* If not compiled with GNU C, use the C alloca */
-#ifndef __GNUC__
-#define USE_C_ALLOCA
-#endif
===================================================================
Index: gcc/config/m32r/xm-m32r.h
--- gcc/config/m32r/xm-m32r.h	2001/03/03 03:32:02	1.4
+++ gcc/config/m32r/xm-m32r.h	2001/03/05 08:37:37
@@ -28,8 +28,3 @@ Boston, MA 02111-1307, USA.  */
 /* Doubles are stored in memory with the high order word first.  This
    matters when cross-compiling.  */
 #define HOST_WORDS_BIG_ENDIAN 1
-
-/* If compiled with Sun CC, the use of alloca requires this #include.  */
-#ifndef __GNUC__
-#include "alloca.h"
-#endif
===================================================================
Index: gcc/config/m68k/x-crds
--- gcc/config/m68k/x-crds	1998/12/16 21:07:45	1.2
+++ gcc/config/m68k/x-crds	2001/03/05 08:37:37
@@ -1,7 +1 @@
 CC = cc -Wx,-X23
-
-# The following line might be necessary as well or instead of the above.
-# If you find out that it is necessary,
-# or if you find out that it is not necessary,
-# please inform bug-gcc@prep.ai.mit.edu.
-# ALLOCA = alloca.o
===================================================================
Index: gcc/config/m68k/x-dpx2
--- gcc/config/m68k/x-dpx2	1998/12/16 21:07:46	1.2
+++ gcc/config/m68k/x-dpx2	2001/03/05 08:37:37
@@ -1,8 +1,3 @@
-# need this when using cc
-ALLOCA = alloca.o
-# avoid lossage assembling alloca.
-ALLOCA_FLAGS=-S
-ALLOCA_FINISH = $(AS) -o alloca.o alloca.s
 # be sure not to confuse ./as with /bin/as
 AS=`if [ x$(OLDCC) = x$(CC) ] ; then echo /bin/as; else echo $(GAS); fi`
 GAS = gas
===================================================================
Index: gcc/config/m68k/x-hp320
--- gcc/config/m68k/x-hp320	1999/08/07 07:39:28	1.3
+++ gcc/config/m68k/x-hp320	2001/03/05 08:37:37
@@ -1,15 +1,12 @@
 # Make assignments for compilation on HPUX with their C compiler.
 CC=cc -Wc,-Nw2000 -Wc,-Ns2000 -Wc,-Ne700 -Wc,-Np300
 OLDCC=cc -Wc,-Nw2000 -Wc,-Ns2000 -Wc,-Ne700 -Wc,-Np300
-ALLOCA=alloca.o
 
 # For CCLIBFLAGS you might want to specify the switch that
 # forces only 68000 instructions to be used.
 
 # Version 5 of HPUX had a compiler bug that made it crash with -g.
 # You must set CFLAGS to empty on version 5.
-
-# You must get alloca.c from GNU Emacs.
 
 # So putenv and other functions get seen by fixproto.
 FIXPROTO_DEFINES = -D_HPUX_SOURCE
===================================================================
Index: gcc/config/m68k/x-hp320g
--- gcc/config/m68k/x-hp320g	1999/08/07 07:39:28	1.3
+++ gcc/config/m68k/x-hp320g	2001/03/05 08:37:37
@@ -1,7 +1,6 @@
 # Make assignments for compilation on HPUX with their C compiler.
 CC=cc -Wc,-Nw2000 -Wc,-Ns2000 -Wc,-Ne700 -Wc,-Np300
 OLDCC=cc -Wc,-Nw2000 -Wc,-Ns2000 -Wc,-Ne700 -Wc,-Np300
-ALLOCA=alloca.o
 
 # For CCLIBFLAGS you might want to specify the switch that
 # forces only 68000 instructions to be used.
===================================================================
Index: gcc/config/m68k/x-mot3300
--- gcc/config/m68k/x-mot3300	1999/07/12 23:49:33	1.5
+++ gcc/config/m68k/x-mot3300	2001/03/05 08:37:37
@@ -1,5 +1,3 @@
-ALLOCA=alloca.o
-
 # This disables the long/short jump optimization.
 # I use sysV68 R3V7.1 RM04 (phdm@info.ucl.ac.be)
 # Since ss-950318, with jump optimization enabled, "as" issues a warning
===================================================================
Index: gcc/config/m68k/x-mot3300-gas
--- gcc/config/m68k/x-mot3300-gas	1998/12/16 21:07:52	1.2
+++ gcc/config/m68k/x-mot3300-gas	2001/03/05 08:37:37
@@ -1,5 +1,3 @@
-ALLOCA=alloca.o
-
 # This disables the long/short jump optimization.
 # I use sysV68 R3V7.1 RM04 (phdm@info.ucl.ac.be)
 # Since ss-950318, with jump optimization enabled, "as" issues a warning
===================================================================
Index: gcc/config/m68k/xm-amix.h
--- gcc/config/m68k/xm-amix.h	2001/02/25 05:23:35	1.5
+++ gcc/config/m68k/xm-amix.h	2001/03/05 08:37:37
@@ -20,7 +20,3 @@ the Free Software Foundation, 59 Temple 
 Boston, MA 02111-1307, USA.  */
 
 #include "m68k/xm-m68kv.h"	/* Use the System V flavor of m68k host */
-
-#if defined (__GNUC__) && __GNUC__ == 1
-#define alloca __builtin_alloca
-#endif
===================================================================
Index: gcc/config/m68k/xm-hp320.h
--- gcc/config/m68k/xm-hp320.h	1999/12/28 16:36:09	1.3
+++ gcc/config/m68k/xm-hp320.h	2001/03/05 08:37:37
@@ -2,9 +2,3 @@
 #define USG
 
 #include "m68k/xm-m68k.h"
-
-/* If compiling with HPUX compiler, we are probably using alloca.c,
-   so help it work right.  */
-#ifndef __GNUC__
-#define USE_C_ALLOCA
-#endif
===================================================================
Index: gcc/config/m68k/xm-m68kv.h
--- gcc/config/m68k/xm-m68kv.h	1998/12/16 21:08:06	1.2
+++ gcc/config/m68k/xm-m68kv.h	2001/03/05 08:37:37
@@ -3,7 +3,3 @@
 #include "m68k/xm-m68k.h"
 
 #define USG
-
-#ifndef __GNUC__
-#define USE_C_ALLOCA
-#endif
===================================================================
Index: gcc/config/m68k/xm-mot3300.h
--- gcc/config/m68k/xm-mot3300.h	2001/02/25 05:23:35	1.8
+++ gcc/config/m68k/xm-mot3300.h	2001/03/05 08:37:37
@@ -21,12 +21,3 @@ the Free Software Foundation, 59 Temple 
 Boston, MA 02111-1307, USA.  */
 
 #define USG 1
-
-/* do not use alloca from -lPW with cc, because function epilogues use %sp */
-#ifndef __GNUC__
-#ifdef __STDC__
-extern void *alloca ();
-#else
-extern char *alloca ();
-#endif
-#endif
===================================================================
Index: gcc/config/m88k/x-dolph
--- gcc/config/m88k/x-dolph	1998/12/16 21:08:42	1.2
+++ gcc/config/m88k/x-dolph	2001/03/05 08:37:37
@@ -6,12 +6,6 @@ EXTRA_PARTS=crtbegin.o crtend.o gcc.ld
 gcc.ld: $(srcdir)/config/m88k/dolphin.ld
 	rm -f gcc.ld; cp $(srcdir)/config/m88k/dolphin.ld gcc.ld
 
-# Green Hills C on Dolphin UNIX System V/88 Release 3.2  Version 3.6/5.86 does
-# not provide alloca. It does not harm to have it defined on version 3.8.alfa
-# even though it's not needed there.
-
-ALLOCA=alloca.o
-
 # Under DolphinOS 3.8.alfa, /bin/cc defines __GNUC__, but not __m88k__, 
 # causing gdstarg.h to fail. Defining __m88k__ does probably not hurt on
 # DolphinOS 3.6.
===================================================================
Index: gcc/config/m88k/x-sysv3
--- gcc/config/m88k/x-sysv3	Mon Mar  5 00:37:43 2001
+++ gcc/config/m88k/x-sysv3	Tue May  5 13:32:27 1998
@@ -1,7 +0,0 @@
-# this is m88k/x-sysv3
-
-# native compiler does not provide alloca
-
-ALLOCA = alloca.o
-
-# end m88k/x-sysv3
===================================================================
Index: gcc/config/m88k/x-sysv4
--- gcc/config/m88k/x-sysv4	1998/12/16 21:08:44	1.2
+++ gcc/config/m88k/x-sysv4	2001/03/05 08:37:37
@@ -4,7 +4,3 @@
 # results in a problem when <wait.h> includes <siginfo.h>.
 
 X_CFLAGS = -DNO_BUGS -D__STDC__=0
-
-# The CI5 compiler does not provide alloca.
-
-ALLOCA = alloca.o
===================================================================
Index: gcc/config/m88k/x-tekXD88
--- gcc/config/m88k/x-tekXD88	1998/12/16 21:08:45	1.2
+++ gcc/config/m88k/x-tekXD88	2001/03/05 08:37:37
@@ -4,9 +4,6 @@ EXTRA_PARTS=crtbegin.o crtend.o gcc.ld
 gcc.ld: $(srcdir)/config/m88k/tekXD88.ld
 	rm -f gcc.ld; cp $(srcdir)/config/m88k/tekXD88.ld ./gcc.ld
 
-# Green Hills C on the Tektronix XD88 does not provide alloca.
-ALLOCA=alloca.o
-
 # rc is cleaner, but the ar program sometimes crashes.
 # This is a workaround.
 AR_FLAGS=qc
===================================================================
Index: gcc/config/m88k/xm-m88k.h
--- gcc/config/m88k/xm-m88k.h	2001/03/03 03:32:02	1.8
+++ gcc/config/m88k/xm-m88k.h	2001/03/05 08:37:37
@@ -37,11 +37,6 @@ Boston, MA 02111-1307, USA.  */
 #endif
 #endif
 
-/* If not compiled with GNU C, use the C alloca */
-#ifndef __GNUC__
-#define USE_C_ALLOCA
-#endif
-
 /* For DG/UX, the best size is different.  */
 #ifdef __DGUX__
 #define OBSTACK_CHUNK_SIZE (8192-16)
===================================================================
Index: gcc/config/mcore/xm-mcore.h
--- gcc/config/mcore/xm-mcore.h	2001/03/03 03:32:02	1.3
+++ gcc/config/mcore/xm-mcore.h	2001/03/05 08:37:37
@@ -22,8 +22,3 @@ the Free Software Foundation, 675 Mass A
 #define HOST_BITS_PER_SHORT 16
 #define HOST_BITS_PER_INT   32
 #define HOST_BITS_PER_LONG  32
-
-/* If compiled with GNU C, use the built-in alloca.  */
-#ifdef __GNUC__
-#define alloca __builtin_alloca
-#endif
===================================================================
Index: gcc/config/mips/x-iris
--- gcc/config/mips/x-iris	1998/12/16 21:09:50	1.4
+++ gcc/config/mips/x-iris	2001/03/05 08:37:37
@@ -23,9 +23,6 @@
 # -lmalloc is supposed to be faster than the normal malloc
 CLIB		= -lmld -lmalloc
 
-# Show we need to use the C version of ALLOCA
-ALLOCA		= alloca.o
-
 # Find all of the declarations from the header files
 FIXPROTO_DEFINES= -D__EXTENSIONS__ -D_SGI_SOURCE -D_LANGUAGE_C_PLUS_PLUS
 
===================================================================
Index: gcc/config/mips/x-iris3
--- gcc/config/mips/x-iris3	1998/12/16 21:09:51	1.3
+++ gcc/config/mips/x-iris3	2001/03/05 08:37:37
@@ -25,6 +25,3 @@
 # -lmld is so we can link collect2 running native.
 # -lmalloc is supposed to be faster than the normal malloc
 CLIB		= -lmld -lmalloc
-
-# Show we need to use the C version of ALLOCA
-ALLOCA		= alloca.o
===================================================================
Index: gcc/config/mips/x-sni-svr4
--- gcc/config/mips/x-sni-svr4	1999/12/28 16:36:09	1.3
+++ gcc/config/mips/x-sni-svr4	2001/03/05 08:37:37
@@ -9,8 +9,3 @@
 CC		= $(OLDCC)
 OPT		=
 OLDCC		= cc -Olimit 3000 $(OPT)
-
-# Show we need to use the C version of ALLOCA
-# The SVR3 configurations have it, but the SVR4 configurations don't.
-# For now, just try using it for all SVR* configurations.
-ALLOCA		= alloca.o
===================================================================
Index: gcc/config/mips/x-sysv
--- gcc/config/mips/x-sysv	1998/12/16 21:10:00	1.2
+++ gcc/config/mips/x-sysv	2001/03/05 08:37:37
@@ -19,8 +19,3 @@ OLDCC		= cc -Wf,-XNg1500,-XNh2000 -Olimi
 # This enables collect2 to link.
 # Some systems use version 2.11 of the compilers.  Some use version 3.11.
 CLIB= -L/usr/lib/cmplrs/cc2.11 -L/usr/lib/cmplrs/cc3.11 -lmld
-
-# Show we need to use the C version of ALLOCA
-# The SVR3 configurations have it, but the SVR4 configurations don't.
-# For now, just try using it for all SVR* configurations.
-ALLOCA		= alloca.o
===================================================================
Index: gcc/config/mips/xm-iris6.h
--- gcc/config/mips/xm-iris6.h	1999/09/23 17:46:23	1.3
+++ gcc/config/mips/xm-iris6.h	2001/03/05 08:37:37
@@ -1,14 +1,3 @@
-#define MIPS_OVERRIDE_ALLOCA
-#ifndef __GNUC__
-#include <alloca.h>
-#else
-# ifdef __SIZE_TYPE__
-extern void *alloca (__SIZE_TYPE__);
-# else
-extern void *alloca ();
-# endif /* __SIZE_TYPE__ */
-#endif
-
 #include "mips/xm-mips.h"
 
 #define USG
===================================================================
Index: gcc/config/mips/xm-mips.h
--- gcc/config/mips/xm-mips.h	2001/03/03 03:32:02	1.8
+++ gcc/config/mips/xm-mips.h	2001/03/05 08:37:37
@@ -42,16 +42,3 @@ Boston, MA 02111-1307, USA.  */
    for compiling GNU C++.  */
 #define ONLY_INT_FIELDS 1
 #endif
-
-#ifndef MIPS_OVERRIDE_ALLOCA
-#ifndef __GNUC__
-#define USE_C_ALLOCA
-
-#ifdef __STDC__
-extern void * alloca ();
-#else
-extern char * alloca ();
-#endif
-
-#endif
-#endif /* not MIPS_OVERRIDE_ALLOCA */
===================================================================
Index: gcc/config/mips/xm-nws3250v4.h
--- gcc/config/mips/xm-nws3250v4.h	1998/12/16 21:10:08	1.2
+++ gcc/config/mips/xm-nws3250v4.h	2001/03/05 08:37:37
@@ -1,9 +1,3 @@
 #define USG
 
 #include "xm-mips.h"
-
-/* If compiling with mips compiler, we are probably using alloca.c,
-   so help it work right.  */
-#ifndef __GNUC__
-#define USE_C_ALLOCA
-#endif
===================================================================
Index: gcc/config/pa/x-pa-hpux
--- gcc/config/pa/x-pa-hpux	2000/07/27 15:26:05	1.3
+++ gcc/config/pa/x-pa-hpux	2001/03/05 08:37:37
@@ -1,4 +1,2 @@
-ALLOCA=alloca.o
-
 # So putenv and other functions get seen by fixproto.
 FIXPROTO_DEFINES = -D_HPUX_SOURCE -D_HIUX_SOURCE
===================================================================
Index: gcc/config/pa/x-pa-mpeix
--- gcc/config/pa/x-pa-mpeix	1999/09/07 10:26:35	1.1
+++ gcc/config/pa/x-pa-mpeix	2001/03/05 08:37:37
@@ -1,4 +1,3 @@
-ALLOCA=alloca.o
 X_CFLAGS=-I/usr/contrib/include -DSYSV -D_POSIX_SOURCE -D_SOCKET_SOURCE -D_MPEIX_SOURCE -DPOSIX -D_MPEXL_SOURCE
 CC=gcc
 AR=/bin/ar
===================================================================
Index: gcc/config/pa/xm-pa.h
--- gcc/config/pa/xm-pa.h	2001/03/03 03:32:03	1.7
+++ gcc/config/pa/xm-pa.h	2001/03/05 08:37:37
@@ -39,7 +39,3 @@ Boston, MA 02111-1307, USA.  */
 
 /* HP's compiler has problems with enum bitfields.  */
 #define ONLY_INT_FIELDS
-
-/* Always claim to use C alloca; this prevents losing if building with
-   gcc -fno-builtin ... */
-#define USE_C_ALLOCA
===================================================================
Index: gcc/config/pa/xm-pa64hpux.h
--- gcc/config/pa/xm-pa64hpux.h	2001/03/03 03:32:03	1.4
+++ gcc/config/pa/xm-pa64hpux.h	2001/03/05 08:37:37
@@ -18,7 +18,6 @@ along with GNU CC; see the file COPYING.
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-
 /* HP-UX is a flavor of System V */
 #define USG
 
@@ -35,7 +34,3 @@ Boston, MA 02111-1307, USA.  */
 
 /* HP's compiler has problems with enum bitfields.  */
 #define ONLY_INT_FIELDS
-
-/* Always claim to use C alloca; this prevents losing if building with
-   gcc -fno-builtin ...  */
-#define USE_C_ALLOCA
===================================================================
Index: gcc/config/pa/xm-pahpux.h
--- gcc/config/pa/xm-pahpux.h	2001/03/03 03:32:03	1.5
+++ gcc/config/pa/xm-pahpux.h	2001/03/05 08:37:37
@@ -35,7 +35,3 @@ Boston, MA 02111-1307, USA.  */
 
 /* HP's compiler has problems with enum bitfields.  */
 #define ONLY_INT_FIELDS
-
-/* Always claim to use C alloca; this prevents losing if building with
-   gcc -fno-builtin ... "  */
-#define USE_C_ALLOCA
===================================================================
Index: gcc/config/pa/xm-papro.h
--- gcc/config/pa/xm-papro.h	2001/03/03 03:32:03	1.7
+++ gcc/config/pa/xm-papro.h	2001/03/05 08:37:37
@@ -32,7 +32,3 @@ Boston, MA 02111-1307, USA.  */
 
 /* HP's compiler has problems with enum bitfields.  */
 #define ONLY_INT_FIELDS
-
-/* Always claim to use C alloca; this prevents losing if building with
-   gcc -fno-builtin ... */
-#define USE_C_ALLOCA
===================================================================
Index: gcc/config/romp/xm-romp.h
--- gcc/config/romp/xm-romp.h	2001/03/03 03:32:03	1.5
+++ gcc/config/romp/xm-romp.h	2001/03/05 08:37:37
@@ -27,10 +27,9 @@ Boston, MA 02111-1307, USA.  */
 
 #define HOST_WORDS_BIG_ENDIAN
 
-/* If compiled with hc, use the built-in alloca and memcpy.
+/* If compiled with hc, use the built-in memcpy.
    These definitions assume hc version 2.  */
 #ifdef __HIGHC__
-#define	alloca _Alloca
 #define bcopy(s,d,l) memcpy(d,s,l)
 #define FUNCTION_CONVERSION_BUG
 #endif
===================================================================
Index: gcc/config/rs6000/x-aix31
--- gcc/config/rs6000/x-aix31	1998/12/16 21:12:36	1.4
+++ gcc/config/rs6000/x-aix31	2001/03/05 08:37:37
@@ -1,7 +1,3 @@
-# configuration for IBM rs6000 running aix
-# Show we need to use the C version of ALLOCA
-ALLOCA=alloca.o
-
 # For some reason, we need -lm for cc1.
 # We need -lld for collect2 (actually this only matters
 # for a native compiler, but this is as good a place as any
===================================================================
Index: gcc/config/rs6000/x-aix41
--- gcc/config/rs6000/x-aix41	2000/09/23 15:23:13	1.4
+++ gcc/config/rs6000/x-aix41	2001/03/05 08:37:37
@@ -1,8 +1,5 @@
 # configuration for IBM RS/6000 running AIX 4.1+
 
-# Show we need to use the C version of ALLOCA
-ALLOCA=alloca.o
-
 # We need -lld for collect2 (actually this only matters
 # for a native compiler, but this is as good a place as any
 # to define the symbol).
===================================================================
Index: gcc/config/rs6000/x-beos
--- gcc/config/rs6000/x-beos	1998/12/16 21:12:39	1.2
+++ gcc/config/rs6000/x-beos	2001/03/05 08:37:37
@@ -1,9 +1,2 @@
 # configuration for BeOS
 INSTALL=install -c
-
-# Show we need to use the C version of ALLOCA
-ALLOCA=alloca.o
-# Use it regardless of whether we are compiling with gcc or not.
-USE_ALLOCA= `echo "${ALLOCA}"`
-USE_HOST_ALLOCA= `echo ${HOST_PREFIX}${HOST_ALLOCA}`
-SUBDIR_USE_ALLOCA = `if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi`
===================================================================
Index: gcc/config/rs6000/x-lynx
--- gcc/config/rs6000/x-lynx	1998/12/16 21:12:41	1.2
+++ gcc/config/rs6000/x-lynx	2001/03/05 08:37:37
@@ -5,9 +5,6 @@ OLDCC	= /bin/gcc
 # /bin/sh is too buggy, so use /bin/bash instead.
 SHELL = /bin/bash
 
-# Show we need to use the C version of ALLOCA
-ALLOCA=alloca.o
-
 # configuration for IBM rs6000 running lynx
 
 # For some reason, we need -lm for cc1.
===================================================================
Index: gcc/config/rs6000/x-mach
--- gcc/config/rs6000/x-mach	1998/12/16 21:12:43	1.2
+++ gcc/config/rs6000/x-mach	2001/03/05 08:37:37
@@ -1,7 +1,4 @@
 # configuration for IBM rs6000 running MACH
 
-# Show we need to use the C version of ALLOCA
-ALLOCA=alloca.o
-
 # For some reason, we need -lm for cc1.
 CLIB=-lm
===================================================================
Index: gcc/config/rs6000/x-rs6000
--- gcc/config/rs6000/x-rs6000	1998/12/16 21:12:44	1.2
+++ gcc/config/rs6000/x-rs6000	2001/03/05 08:37:37
@@ -1,8 +1,5 @@
 # configuration for IBM rs6000 running aix
 
-# Show we need to use the C version of ALLOCA
-ALLOCA=alloca.o
-
 # We need -lld for collect2 (actually this only matters
 # for a native compiler, but this is as good a place as any
 # to define the symbol).
===================================================================
Index: gcc/config/rs6000/x-sysv4
--- gcc/config/rs6000/x-sysv4	1998/12/16 21:12:45	1.2
+++ gcc/config/rs6000/x-sysv4	2001/03/05 08:37:37
@@ -1,2 +1 @@
 X_CFLAGS=-DSVR4
-ALLOCA=alloca.o
===================================================================
Index: gcc/config/rs6000/xm-beos.h
--- gcc/config/rs6000/xm-beos.h	2001/03/03 03:32:03	1.8
+++ gcc/config/rs6000/xm-beos.h	2001/03/05 08:37:37
@@ -31,10 +31,7 @@ Boston, MA 02111-1307, USA.  */
 
 #define	HOST_WORDS_BIG_ENDIAN
 
-/* Use the C alloca and use only int bitfields.  */
-
-#define USE_C_ALLOCA
-extern void *alloca ();
+/* Use only int bitfields.  */
 #define	ONLY_INT_FIELDS
 
 /* use ANSI/SYSV style byte manipulation routines instead of BSD ones */
@@ -65,3 +62,9 @@ extern void *alloca ();
 /* SYSTEM_INCLUDE_DIR is the location for system specific, non-POSIX headers. */
 
 #define SYSTEM_INCLUDE_DIR	"/boot/develop/headers/be"
+
+/* This is a temporary hack until the wimpy default 64k stack
+   limit in BeOS is either increased or made user settable somehow.
+   This probably won't happen until after the DR9 release.  */
+#undef USE_C_ALLOCA
+#define USE_C_ALLOCA 1
===================================================================
Index: gcc/config/rs6000/xm-rs6000.h
--- gcc/config/rs6000/xm-rs6000.h	2001/03/03 03:32:03	1.8
+++ gcc/config/rs6000/xm-rs6000.h	2001/03/05 08:37:37
@@ -28,14 +28,8 @@ Boston, MA 02111-1307, USA.  */
 
 #define	HOST_WORDS_BIG_ENDIAN
 
-/* If not compiled with GNU C, use the C alloca and use only int bitfields.  */
+/* If not compiled with GNU C, use only int bitfields.  */
 #ifndef __GNUC__
-#define USE_C_ALLOCA
-#if __STDC__
-extern void *alloca ();
-#else
-extern char *alloca ();
-#endif
 #define	ONLY_INT_FIELDS
 #endif
 
===================================================================
Index: gcc/config/rs6000/xm-sysv4.h
--- gcc/config/rs6000/xm-sysv4.h	2001/03/03 03:32:03	1.12
+++ gcc/config/rs6000/xm-sysv4.h	2001/03/05 08:37:37
@@ -34,14 +34,8 @@ Boston, MA 02111-1307, USA.  */
 #include "xm-linux.h"
 #endif
 
-/* if not compiled with GNU C, use the C alloca and use only int bitfields. */
+/* if not compiled with GNU C, use only int bitfields. */
 #ifndef __GNUC__
-#define	USE_C_ALLOCA
-#ifdef __STDC__
-extern void *alloca ();
-#else
-extern char *alloca ();
-#endif
 #undef ONLY_INT_FIELDS
 #define ONLY_INT_FIELDS
 #endif
===================================================================
Index: gcc/config/sh/xm-sh.h
--- gcc/config/sh/xm-sh.h	2001/03/03 03:32:03	1.4
+++ gcc/config/sh/xm-sh.h	2001/03/05 08:37:37
@@ -23,8 +23,3 @@ Boston, MA 02111-1307, USA.  */
 #define HOST_BITS_PER_SHORT 16
 #define HOST_BITS_PER_INT 32
 #define HOST_BITS_PER_LONG 32
-
-/* If compiled with GNU C, use the built-in alloca.  */
-#ifdef __GNUC__
-#define alloca __builtin_alloca
-#endif
===================================================================
Index: gcc/config/sparc/x-sysv4
--- gcc/config/sparc/x-sysv4	1998/12/16 21:13:55	1.2
+++ gcc/config/sparc/x-sysv4	2001/03/05 08:37:37
@@ -1,2 +1 @@
 X_CFLAGS=-DSVR4
-ALLOCA=alloca.o
===================================================================
Index: gcc/config/sparc/xm-linux.h
--- gcc/config/sparc/xm-linux.h	1998/12/16 21:13:56	1.5
+++ gcc/config/sparc/xm-linux.h	2001/03/05 08:37:37
@@ -1,5 +1,5 @@
 /* Configuration for GCC for SPARC running Linux-based GNU systems.
-   Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc.
    Contributed by Eddie C. Dost (ecd@skynet.be)
 
 This file is part of GNU CC.
@@ -20,7 +20,6 @@ the Free Software Foundation, 59 Temple 
 Boston, MA 02111-1307, USA.  */
 
 #ifndef inhibit_libc
-#include <alloca.h>
 #include <stdlib.h>
 #include <string.h>
 #endif
===================================================================
Index: gcc/config/sparc/xm-pbd.h
--- gcc/config/sparc/xm-pbd.h	2001/02/24 08:17:40	1.3
+++ gcc/config/sparc/xm-pbd.h	2001/03/05 08:37:37
@@ -3,7 +3,3 @@
 #include "sparc/xm-sparc.h"
 
 #define USG
-
-#ifndef __GNUC__
-#define USE_C_ALLOCA
-#endif
===================================================================
Index: gcc/config/sparc/xm-sol2.h
--- gcc/config/sparc/xm-sol2.h	Mon Mar  5 00:37:44 2001
+++ gcc/config/sparc/xm-sol2.h	Tue May  5 13:32:27 1998
@@ -1,4 +0,0 @@
-/* If not compiled with GNU C, include the system's <alloca.h> header.  */
-#ifndef __GNUC__
-#include <alloca.h>
-#endif
===================================================================
Index: gcc/config/sparc/xm-sparc.h
--- gcc/config/sparc/xm-sparc.h	2001/03/03 03:32:03	1.4
+++ gcc/config/sparc/xm-sparc.h	2001/03/05 08:37:37
@@ -29,8 +29,3 @@ Boston, MA 02111-1307, USA.  */
 /* Doubles are stored in memory with the high order word first.  This
    matters when cross-compiling.  */
 #define HOST_WORDS_BIG_ENDIAN 1
-
-/* If compiled with Sun CC, the use of alloca requires this #include.  */
-#ifndef __GNUC__
-#include "alloca.h"
-#endif
===================================================================
Index: gcc/config/vax/xm-vms.h
--- gcc/config/vax/xm-vms.h	2001/03/03 03:32:04	1.10
+++ gcc/config/vax/xm-vms.h	2001/03/05 08:37:37
@@ -116,7 +116,6 @@ Boston, MA 02111-1307, USA.  */
 /* Customizations/kludges for building with DEC's VAX C compiler
    rather than GCC.  */
 
-#define USE_C_ALLOCA		/* using alloca.c */
 #define QSORT_WORKAROUND	/* do not use VAXCRTL's qsort */
 
 /* use ANSI/SYSV style byte manipulation routines instead of BSD ones */
@@ -170,15 +169,6 @@ Boston, MA 02111-1307, USA.  */
 #include <string.h>
 /* this is for genopinit.c */
  #pragma message disable (undefescap)
-#endif
-
-#if defined(USE_C_ALLOCA) && !defined(alloca)
-/* Declare alloca() using similar logic to that in alloca.c.  */
-#ifdef __STDC__
-extern void *alloca(unsigned);
-#else
-extern char *alloca();
-#endif
 #endif
 
 #define OBJECT_SUFFIX ".obj"
===================================================================
Index: gcc/config/we32k/x-we32k
--- gcc/config/we32k/x-we32k	Mon Mar  5 00:37:44 2001
+++ gcc/config/we32k/x-we32k	Tue May  5 13:32:27 1998
@@ -1 +0,0 @@
-ALLOCA=alloca.o
===================================================================
Index: gcc/genattr.c
--- gcc/genattr.c	2000/11/10 16:01:14	1.38
+++ gcc/genattr.c	2001/03/05 08:37:35
@@ -279,11 +279,9 @@ from the machine description file `md'. 
 
 	  if (unit == 0)
 	    {
-	      int len = strlen (name) + 1;
 	      unit = (struct function_unit *)
-		alloca (sizeof (struct function_unit));
-	      unit->name = (char *) alloca (len);
-	      memcpy (unit->name, name, len);
+		xmalloc (sizeof (struct function_unit));
+	      unit->name = xstrdup (name);
 	      unit->multiplicity = multiplicity;
 	      unit->simultaneity = simultaneity;
 	      unit->ready_cost.min = unit->ready_cost.max = ready_cost;
===================================================================
Index: gcc/genattrtab.c
--- gcc/genattrtab.c	2000/12/16 19:00:57	1.87
+++ gcc/genattrtab.c	2001/03/05 08:37:36
@@ -117,9 +117,6 @@ struct obstack *temp_obstack = &obstack2
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free free
 
-/* enough space to reserve for printing out ints */
-#define MAX_DIGITS (HOST_BITS_PER_INT * 3 / 10 + 3)
-
 /* Define structures used to record attributes and values.  */
 
 /* As each DEFINE_INSN, DEFINE_PEEPHOLE, or DEFINE_ASM_ATTRIBUTES is
@@ -365,8 +362,8 @@ rtx pic_offset_table_rtx;
 static void attr_hash_add_rtx	PARAMS ((int, rtx));
 static void attr_hash_add_string PARAMS ((int, char *));
 static rtx attr_rtx		PARAMS ((enum rtx_code, ...));
-static char *attr_printf	PARAMS ((int, const char *, ...))
-  ATTRIBUTE_PRINTF_2;
+static char *attr_printf	PARAMS ((const char *, ...))
+  ATTRIBUTE_PRINTF_1;
 static char *attr_string        PARAMS ((const char *, int));
 static rtx check_attr_test	PARAMS ((rtx, int, int));
 static rtx check_attr_value	PARAMS ((rtx, struct attr_desc *));
@@ -736,30 +733,27 @@ attr_rtx VPARAMS ((enum rtx_code code, .
   return h->u.rtl;
 }
 
-/* Create a new string printed with the printf line arguments into a space
-   of at most LEN bytes:
+/* Create a new string printed with the printf line arguments.  Yah, it
+   uses a fixed size buffer.
 
-   rtx attr_printf (len, format, [arg1, ..., argn])  */
+   rtx attr_printf (format, [arg1, ..., argn])  */
 
 static char *
-attr_printf VPARAMS ((register int len, const char *fmt, ...))
+attr_printf VPARAMS ((const char *fmt, ...))
 {
 #ifndef ANSI_PROTOTYPES
-  register int len;
   const char *fmt;
 #endif
   va_list p;
-  register char *str;
+  char str[256];
 
   VA_START (p, fmt);
 
 #ifndef ANSI_PROTOTYPES
-  len = va_arg (p, int);
   fmt = va_arg (p, const char *);
 #endif
 
   /* Print the string into a temporary location.  */
-  str = (char *) alloca (len);
   vsprintf (str, fmt, p);
   va_end (p);
 
@@ -1643,8 +1637,7 @@ expand_delays ()
 	  newexp = attr_rtx (IF_THEN_ELSE, condexp,
 			     make_numeric_value (1), make_numeric_value (0));
 
-	  p = attr_printf (sizeof ("*delay__") + MAX_DIGITS * 2,
-			   "*delay_%d_%d",
+	  p = attr_printf ("*delay_%d_%d",
 			   delay->num, i / 3);
 	  make_internal_attr (p, newexp, 1);
 
@@ -1655,8 +1648,7 @@ expand_delays ()
 	      newexp = attr_rtx (IF_THEN_ELSE, condexp,
 				 make_numeric_value (1),
 				 make_numeric_value (0));
-	      p = attr_printf (sizeof ("*annul_true__") + MAX_DIGITS * 2,
-			       "*annul_true_%d_%d", delay->num, i / 3);
+	      p = attr_printf ("*annul_true_%d_%d", delay->num, i / 3);
 	      make_internal_attr (p, newexp, 1);
 	    }
 
@@ -1667,8 +1659,7 @@ expand_delays ()
 	      newexp = attr_rtx (IF_THEN_ELSE, condexp,
 				 make_numeric_value (1),
 				 make_numeric_value (0));
-	      p = attr_printf (sizeof ("*annul_false__") + MAX_DIGITS * 2,
-			       "*annul_false_%d_%d", delay->num, i / 3);
+	      p = attr_printf ("*annul_false_%d_%d", delay->num, i / 3);
 	      make_internal_attr (p, newexp, 1);
 	    }
 	}
@@ -1920,8 +1911,7 @@ expand_units ()
 					   != unit->issue_delay.max);
 	  if (unit->needs_conflict_function)
 	    {
-	      str = attr_printf (strlen (unit->name) + sizeof ("*_cost_") + MAX_DIGITS,
-				 "*%s_cost_%d", unit->name, op->num);
+	      str = attr_printf ("*%s_cost_%d", unit->name, op->num);
 	      make_internal_attr (str, issue_exp, 1);
 	    }
 
@@ -1983,12 +1973,12 @@ expand_units ()
   /* Create an array of ops for each unit.  Add an extra unit for the
      result_ready_cost function that has the ops of all other units.  */
   unit_ops = (struct function_unit_op ***)
-    alloca ((num_units + 1) * sizeof (struct function_unit_op **));
+    xmalloc ((num_units + 1) * sizeof (struct function_unit_op **));
   unit_num = (struct function_unit **)
-    alloca ((num_units + 1) * sizeof (struct function_unit *));
+    xmalloc ((num_units + 1) * sizeof (struct function_unit *));
 
   unit_num[num_units] = unit = (struct function_unit *)
-    alloca (sizeof (struct function_unit));
+    xmalloc (sizeof (struct function_unit));
   unit->num = num_units;
   unit->num_opclasses = 0;
 
@@ -1997,7 +1987,7 @@ expand_units ()
       unit_num[num_units]->num_opclasses += unit->num_opclasses;
       unit_num[unit->num] = unit;
       unit_ops[unit->num] = op_array = (struct function_unit_op **)
-	alloca (unit->num_opclasses * sizeof (struct function_unit_op *));
+	xmalloc (unit->num_opclasses * sizeof (struct function_unit_op *));
 
       for (op = unit->ops; op; op = op->next)
 	op_array[op->num] = op;
@@ -2005,7 +1995,7 @@ expand_units ()
 
   /* Compose the array of ops for the extra unit.  */
   unit_ops[num_units] = op_array = (struct function_unit_op **)
-    alloca (unit_num[num_units]->num_opclasses
+    xmalloc (unit_num[num_units]->num_opclasses
 	    * sizeof (struct function_unit_op *));
 
   for (unit = units, i = 0; unit; i += unit->num_opclasses, unit = unit->next)
@@ -2149,8 +2139,7 @@ expand_units ()
 		}
 
 	      /* Make an attribute for use in the blockage function.  */
-	      str = attr_printf (strlen (unit->name) + sizeof ("*_block_") + MAX_DIGITS,
-				 "*%s_block_%d", unit->name, op->num);
+	      str = attr_printf ("*%s_block_%d", unit->name, op->num);
 	      make_internal_attr (str, blockage, 1);
 	    }
 
@@ -2182,13 +2171,11 @@ expand_units ()
 	      newexp = operate_exp (RANGE_OP, min_blockage, max_blockage);
 	      newexp = simplify_knowing (newexp, unit->condexp);
 
-	      str = attr_printf (strlen (unit->name) + sizeof ("*_unit_blockage_range"),
-				 "*%s_unit_blockage_range", unit->name);
+	      str = attr_printf ("*%s_unit_blockage_range", unit->name);
 	      make_internal_attr (str, newexp, 20);
 	    }
 
-	  str = attr_printf (strlen (unit->name) + sizeof ("*_unit_ready_cost"),
-			     "*%s_unit_ready_cost", unit->name);
+	  str = attr_printf ("*%s_unit_ready_cost", unit->name);
 	}
       else
 	str = "*result_ready_cost";
@@ -2229,8 +2216,7 @@ expand_units ()
 	}
 
       /* Simplifying caseexp with simplify_by_exploding doesn't win.  */
-      str = attr_printf (strlen (unit->name) + sizeof ("*_cases"),
-			 "*%s_cases", unit->name);
+      str = attr_printf ("*%s_cases", unit->name);
       make_internal_attr (str, caseexp, 1);
     }
 }
@@ -2284,7 +2270,7 @@ encode_units_mask (x)
 	  ;
       else
 	j = ~i;
-      return attr_rtx (CONST_STRING, attr_printf (MAX_DIGITS, "%d", j));
+      return attr_rtx (CONST_STRING, attr_printf ("%d", j));
 
     case REG:
     case QUEUED:
@@ -2571,9 +2557,10 @@ simplify_cond (exp, insn_code, insn_inde
   rtx defval = XEXP (exp, 1);
   rtx new_defval = XEXP (exp, 1);
   int len = XVECLEN (exp, 0);
-  rtx *tests = (rtx *) alloca (len * sizeof (rtx));
+  rtx *tests = (rtx *) xmalloc (len * sizeof (rtx));
   int allsame = 1;
   char *first_spacer;
+  rtx ret;
 
   /* This lets us free all storage allocated below, if appropriate.  */
   first_spacer = (char *) obstack_finish (rtl_obstack);
@@ -2656,11 +2643,12 @@ simplify_cond (exp, insn_code, insn_inde
   if (len == 0)
     {
       if (GET_CODE (defval) == COND)
-	return simplify_cond (defval, insn_code, insn_index);
-      return defval;
+	ret = simplify_cond (defval, insn_code, insn_index);
+      else
+	ret = defval;
     }
   else if (allsame)
-    return exp;
+    ret = exp;
   else
     {
       rtx newexp = rtx_alloc (COND);
@@ -2668,8 +2656,10 @@ simplify_cond (exp, insn_code, insn_inde
       XVEC (newexp, 0) = rtvec_alloc (len);
       memcpy (XVEC (newexp, 0)->elem, tests, len * sizeof (rtx));
       XEXP (newexp, 1) = new_defval;
-      return newexp;
+      ret = newexp;
     }
+  free (tests);
+  return ret;
 }
 
 /* Remove an insn entry from an attribute value.  */
@@ -2864,13 +2854,12 @@ evaluate_eq_attr (exp, value, insn_code,
     }
   else if (GET_CODE (value) == SYMBOL_REF)
     {
-      char *p, *string;
+      char *p;
+      char string[256];
 
       if (GET_CODE (exp) != EQ_ATTR)
 	abort ();
 
-      string = (char *) alloca (2 + strlen (XSTR (exp, 0))
-				+ strlen (XSTR (exp, 1)));
       strcpy (string, XSTR (exp, 0));
       strcat (string, "_");
       strcat (string, XSTR (exp, 1));
@@ -3513,7 +3502,7 @@ optimize_attrs ()
 
   /* Make 2 extra elements, for "code" values -2 and -1.  */
   insn_code_values
-    = (struct attr_value_list **) alloca ((insn_code_number + 2)
+    = (struct attr_value_list **) xmalloc ((insn_code_number + 2)
 					  * sizeof (struct attr_value_list *));
   memset ((char *) insn_code_values, 0,
 	 (insn_code_number + 2) * sizeof (struct attr_value_list *));
@@ -3521,9 +3510,6 @@ optimize_attrs ()
   /* Offset the table address so we can index by -2 or -1.  */
   insn_code_values += 2;
 
-  /* Allocate the attr_value_list structures using xmalloc rather than
-     alloca, because using alloca can overflow the maximum permitted
-     stack limit on SPARC Lynx.  */
   iv = ivbuf = ((struct attr_value_list *)
 		xmalloc (num_insn_ents * sizeof (struct attr_value_list)));
 
@@ -3593,6 +3579,7 @@ optimize_attrs ()
     }
 
   free (ivbuf);
+  free (insn_code_values - 2);
 }
 
 #if 0
@@ -3641,6 +3628,7 @@ simplify_by_exploding (exp)
   rtx *condtest, *condval;
   int i, j, total, ndim = 0;
   int most_tests, num_marks, new_marks;
+  rtx ret;
 
   /* Locate all the EQ_ATTR expressions.  */
   if (! find_and_mark_used_attributes (exp, &list, &ndim) || ndim == 0)
@@ -3655,7 +3643,7 @@ simplify_by_exploding (exp)
      cover the domain of the attribute.  This makes the expanded COND form
      order independent.  */
 
-  space = (struct dimension *) alloca (ndim * sizeof (struct dimension));
+  space = (struct dimension *) xmalloc (ndim * sizeof (struct dimension));
 
   total = 1;
   for (ndim = 0; list; ndim++)
@@ -3710,8 +3698,8 @@ simplify_by_exploding (exp)
   for (i = 0; i < ndim; i++)
     space[i].current_value = space[i].values;
 
-  condtest = (rtx *) alloca (total * sizeof (rtx));
-  condval = (rtx *) alloca (total * sizeof (rtx));
+  condtest = (rtx *) xmalloc (total * sizeof (rtx));
+  condval = (rtx *) xmalloc (total * sizeof (rtx));
 
   /* Expand the tests and values by iterating over all values in the
      attribute space.  */
@@ -3727,6 +3715,7 @@ simplify_by_exploding (exp)
 
   /* We are now finished with the original expression.  */
   unmark_used_attributes (0, space, ndim);
+  free (space);
 
   /* Find the most used constant value and make that the default.  */
   most_tests = -1;
@@ -3753,27 +3742,32 @@ simplify_by_exploding (exp)
 
   /* Give up if nothing is constant.  */
   if (num_marks == 0)
-    return exp;
-
+    ret = exp;
+  
   /* If all values are the default, use that.  */
-  if (total == most_tests)
-    return defval;
+  else if (total == most_tests)
+    ret = defval;
 
   /* Make a COND with the most common constant value the default.  (A more
      complex method where tests with the same value were combined didn't
      seem to improve things.)  */
-  condexp = rtx_alloc (COND);
-  XVEC (condexp, 0) = rtvec_alloc ((total - most_tests) * 2);
-  XEXP (condexp, 1) = defval;
-  for (i = j = 0; i < total; i++)
-    if (condval[i] != defval)
-      {
-	XVECEXP (condexp, 0, 2 * j) = condtest[i];
-	XVECEXP (condexp, 0, 2 * j + 1) = condval[i];
-	j++;
-      }
-
-  return condexp;
+  else
+    {
+      condexp = rtx_alloc (COND);
+      XVEC (condexp, 0) = rtvec_alloc ((total - most_tests) * 2);
+      XEXP (condexp, 1) = defval;
+      for (i = j = 0; i < total; i++)
+	if (condval[i] != defval)
+	  {
+	    XVECEXP (condexp, 0, 2 * j) = condtest[i];
+	    XVECEXP (condexp, 0, 2 * j + 1) = condval[i];
+	    j++;
+	  }
+      ret = condexp;
+    }
+  free (condtest);
+  free (condval);
+  return ret;
 }
 
 /* Set the MEM_VOLATILE_P flag for all EQ_ATTR expressions in EXP and
@@ -5677,7 +5671,7 @@ write_complex_function (unit, name, conn
   struct attr_desc *case_attr, *attr;
   struct attr_value *av, *common_av;
   rtx value;
-  char *str;
+  char str[256];
   int using_case;
   int i;
 
@@ -5694,7 +5688,6 @@ write_complex_function (unit, name, conn
   printf ("    {\n");
 
   /* Write the `switch' statement to get the case value.  */
-  str = (char *) alloca (strlen (unit->name) + strlen (name) + strlen (connection) + 10);
   sprintf (str, "*%s_cases", unit->name);
   case_attr = find_attr (str, 0);
   if (! case_attr)
@@ -5933,7 +5926,7 @@ make_numeric_value (n)
   if (n < 20 && int_values[n])
     return int_values[n];
 
-  p = attr_printf (MAX_DIGITS, "%d", n);
+  p = attr_printf ("%d", n);
   exp = attr_rtx (CONST_STRING, p);
 
   if (n < 20)
@@ -6047,18 +6040,6 @@ main (argc, argv)
 
   if (argc <= 1)
     fatal ("No input file name.");
-
-#if defined (RLIMIT_STACK) && defined (HAVE_GETRLIMIT) && defined (HAVE_SETRLIMIT)
-  /* Get rid of any avoidable limit on stack size.  */
-  {
-    struct rlimit rlim;
-
-    /* Set the stack limit huge so that alloca does not fail.  */
-    getrlimit (RLIMIT_STACK, &rlim);
-    rlim.rlim_cur = rlim.rlim_max;
-    setrlimit (RLIMIT_STACK, &rlim);
-  }
-#endif
 
   if (init_md_reader (argv[1]) != SUCCESS_EXIT_CODE)
     return (FATAL_EXIT_CODE);
===================================================================
Index: gcc/genextract.c
--- gcc/genextract.c	2000/05/18 22:05:14	1.43
+++ gcc/genextract.c	2001/03/05 08:37:36
@@ -120,7 +120,7 @@ gen_insn (insn)
   else
     for (i = XVECLEN (insn, 1) - 1; i >= 0; i--)
       {
-	char *path = (char *) alloca (2);
+	char path[2];
 
 	path[0] = 'a' + i;
 	path[1] = 0;
@@ -221,7 +221,7 @@ walk_rtx (x, path)
       dupnums[dup_count] = XINT (x, 0);
       dup_count++;
       
-      newpath = (char *) alloca (depth + 2);
+      newpath = (char *) xmalloc (depth + 2);
       strcpy (newpath, path);
       newpath[depth + 1] = 0;
       
@@ -230,13 +230,14 @@ walk_rtx (x, path)
 	  newpath[depth] = '0' + i;
 	  walk_rtx (XVECEXP (x, 1, i), newpath);
         }
+      free (newpath);
       return;
       
     case MATCH_OPERATOR:
       oplocs[XINT (x, 0)] = xstrdup (path);
       op_count = MAX (op_count, XINT (x, 0) + 1);
 
-      newpath = (char *) alloca (depth + 2);
+      newpath = (char *) xmalloc (depth + 2);
       strcpy (newpath, path);
       newpath[depth + 1] = 0;
 
@@ -245,13 +246,14 @@ walk_rtx (x, path)
 	  newpath[depth] = '0' + i;
 	  walk_rtx (XVECEXP (x, 2, i), newpath);
 	}
+      free (newpath);
       return;
 
     case MATCH_PARALLEL:
       oplocs[XINT (x, 0)] = xstrdup (path);
       op_count = MAX (op_count, XINT (x, 0) + 1);
 
-      newpath = (char *) alloca (depth + 2);
+      newpath = (char *) xmalloc (depth + 2);
       strcpy (newpath, path);
       newpath[depth + 1] = 0;
 
@@ -260,6 +262,7 @@ walk_rtx (x, path)
 	  newpath[depth] = 'a' + i;
 	  walk_rtx (XVECEXP (x, 2, i), newpath);
 	}
+      free (newpath);
       return;
 
     case ADDRESS:
@@ -270,7 +273,7 @@ walk_rtx (x, path)
       break;
     }
 
-  newpath = (char *) alloca (depth + 2);
+  newpath = (char *) xmalloc (depth + 2);
   strcpy (newpath, path);
   newpath[depth + 1] = 0;
 
@@ -293,6 +296,7 @@ walk_rtx (x, path)
 	    }
 	}
     }
+  free (newpath);
 }
 
 /* Given a PATH, representing a path down the instruction's
===================================================================
Index: gcc/genoutput.c
--- gcc/genoutput.c	2000/12/13 16:26:45	1.58
+++ gcc/genoutput.c	2001/03/05 08:37:36
@@ -241,13 +241,14 @@ output_prologue ()
 /* We need to define all predicates used.  Keep a list of those we
    have defined so far.  There normally aren't very many predicates
    used, so a linked list should be fast enough.  */
+struct predicate { const char *name; struct predicate *next; };
 
 static void
 output_predicate_decls ()
 {
-  struct predicate { const char *name; struct predicate *next; } *predicates = 0;
+  struct predicate *predicates = 0;
   register struct operand_data *d;
-  struct predicate *p;
+  struct predicate *p, *next;
 
   for (d = odata; d; d = d->next)
     if (d->predicate && d->predicate[0])
@@ -260,7 +261,7 @@ output_predicate_decls ()
 	  {
 	    printf ("extern int %s PARAMS ((rtx, enum machine_mode));\n",
 		    d->predicate);
-	    p = (struct predicate *) alloca (sizeof (struct predicate));
+	    p = (struct predicate *) xmalloc (sizeof (struct predicate));
 	    p->name = d->predicate;
 	    p->next = predicates;
 	    predicates = p;
@@ -268,6 +269,11 @@ output_predicate_decls ()
       }
 
   printf ("\n\n");
+  for (p = predicates; p; p = next)
+    {
+      next = p->next;
+      free (p);
+    }
 }
 
 static void
===================================================================
Index: gcc/genrecog.c
--- gcc/genrecog.c	2001/03/02 21:41:36	1.94
+++ gcc/genrecog.c	2001/03/05 08:37:37
@@ -766,7 +766,7 @@ add_to_sequence (pattern, last, position
   if (depth > max_depth)
     max_depth = depth;
 
-  subpos = (char *) alloca (depth + 2);
+  subpos = (char *) xmalloc (depth + 2);
   strcpy (subpos, position);
   subpos[depth + 1] = 0;
 
@@ -796,7 +796,7 @@ add_to_sequence (pattern, last, position
 				     last, subpos, insn_type, 0);
 	      last = &sub->success;
 	    }
-	  return sub;
+	  goto ret;
 	}
 
       /* Else nothing special.  */
@@ -1027,6 +1027,8 @@ add_to_sequence (pattern, last, position
   if (this->tests == NULL)
     abort ();
 
+ ret:
+  free (subpos);
   return sub;
 }
 
===================================================================
Index: gcc/rtl.c
--- gcc/rtl.c	2001/02/24 03:57:59	1.88
+++ gcc/rtl.c	2001/03/05 08:37:37
@@ -997,7 +997,7 @@ rtx
 read_rtx (infile)
      FILE *infile;
 {
-  register int i, j, list_counter;
+  register int i, j;
   RTX_CODE tmp_code;
   register const char *format_ptr;
   /* tmp_char is a buffer used for reading decimal integers
@@ -1111,40 +1111,31 @@ again:
 
       case 'E':
 	{
-	  register struct rtx_list *next_rtx, *rtx_list_link;
-	  struct rtx_list *list_rtx = NULL;
+	  /* Obstack to store scratch vector in.  */
+	  struct obstack vector_stack;
+	  int list_counter = 0;
+	  rtvec return_vec = NULL_RTVEC;
 
 	  c = read_skip_spaces (infile);
 	  if (c != '[')
 	    fatal_expected_char (infile, '[', c);
 
 	  /* add expressions to a list, while keeping a count */
-	  next_rtx = NULL;
-	  list_counter = 0;
+	  obstack_init (&vector_stack);
 	  while ((c = read_skip_spaces (infile)) && c != ']')
 	    {
 	      ungetc (c, infile);
 	      list_counter++;
-	      rtx_list_link = (struct rtx_list *)
-		alloca (sizeof (struct rtx_list));
-	      rtx_list_link->value = read_rtx (infile);
-	      if (next_rtx == 0)
-		list_rtx = rtx_list_link;
-	      else
-		next_rtx->next = rtx_list_link;
-	      next_rtx = rtx_list_link;
-	      rtx_list_link->next = 0;
+	      obstack_ptr_grow (&vector_stack, (PTR) read_rtx (infile));
 	    }
-	  /* get vector length and allocate it */
-	  XVEC (return_rtx, i) = (list_counter
-				  ? rtvec_alloc (list_counter) : NULL_RTVEC);
 	  if (list_counter > 0)
 	    {
-	      next_rtx = list_rtx;
-	      for (j = 0; j < list_counter; j++,
-		   next_rtx = next_rtx->next)
-		XVECEXP (return_rtx, i, j) = next_rtx->value;
+	      return_vec = rtvec_alloc (list_counter);
+	      memcpy (&return_vec->elem[0], obstack_finish (&vector_stack),
+		      list_counter * sizeof (rtx));
 	    }
+	  XVEC (return_rtx, i) = return_vec;
+	  obstack_free (&vector_stack, NULL);
 	  /* close bracket gotten */
 	}
 	break;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]