[gnu.gcc.bug] gcc "fails" in stage1 compile

johns@calvin.EE.CORNELL.EDU (John Sahr) (10/17/89)

computer: Decstation 3100, 8Mbyte memory
gcc v1.36, ftp'd from prep.ai.mit.edu

I have been attempting to install gcc-1.36 on a Decstation 3100, 8 Mb.
After running "config.gcc decstation", the first compile with cc runs
fine.

However, the stage 1 self compile grabs more and more and more virtual
memory, until the whole computer just stops (can't rlogin, can't login, etc).
I did remove the "-g" from the CFLAGS in the stage 1 compile.  Is there
an alternate compilation order, or something, that is less memory hungry?
Is there a minimum amount of real memory for gcc to compile in finite time?

We have a disk that we can construct a 400 Mb swap space on: would this help?

Of course, I would like very much to hear from someone who has got it 
running on a ds3100.

-- 
John Sahr,     Dept. of Electrical Eng., Cornell University, Ithaca, NY 14853
johns@{alfven,calvin}.ee.cornell.edu,  {rochester,cmcl2}!cornell!calvin!johns

piet@cs.ruu.nl (Piet van Oostrum) (10/23/89)

In article <1407@calvin.EE.CORNELL.EDU>, johns@calvin (John Sahr) writes:
 `computer: Decstation 3100, 8Mbyte memory
 `gcc v1.36, ftp'd from prep.ai.mit.edu
 `
 `I have been attempting to install gcc-1.36 on a Decstation 3100, 8 Mb.
 `After running "config.gcc decstation", the first compile with cc runs
 `fine.
 `
 `However, the stage 1 self compile grabs more and more and more virtual
 `memory, until the whole computer just stops (can't rlogin, can't login, etc).
 `I did remove the "-g" from the CFLAGS in the stage 1 compile.  Is there
 `an alternate compilation order, or something, that is less memory hungry?

This happens also on other workstations. The problem is in the alloca()
emulation using malloc(). This grabs more and more memory until finally the
machine thrashes, paging in and out like mad.

This will not happen if you don't specify -O.

Solution:

Either compile the first compiler with gcc and take care that your alloca
is #defined as _builtin_alloca.

Or if you can't start with gcc:
Do the stage1 and stage2 compilation without the -O flag. (both, otherwise
they will not compare equal)
To get an optimized compiler, you can then redo the stage1/stage2 stuff (or
call them stage3/stage4) with gcc -O. Don't forget to #define alloca.

I think someone reported the omission of the #define alloca in the mips
configuration. 
-- 
Piet van Oostrum, Dept of Computer Science, University of Utrecht
Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht,  The Netherlands.
Telephone: +31-30-531806      Internet: piet@cs.ruu.nl
Telefax:   +31-30-513791      Uucp: uunet!mcsun!hp4nl!ruuinf!piet