Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Feb 2001 20:05:06 -0600 (CST)
From:      Mike Meyer <mwm@mired.org>
To:        Kris Kennaway <kris@obsecurity.org>, christor@UG.CS.SUNYSB.EDU
Cc:        questions@freebsd.org
Subject:   Re: gcc running out of swap space during build...
Message-ID:  <14980.41426.806863.609748@guru.mired.org>
In-Reply-To: <65898979@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Kris Kennaway <kris@obsecurity.org> types:
> > It seems to me that if I give gcc an option that does not exist, it
> > should complain about it, shouldn't it?
> gcc treats anything above -O3 as equivalent to -O3. As noted, -O3 has
> optimizer bugs, which was causing it to fail for you.

There's a fair chance that even *without* the optimizer bugs, it would
fail - unless one of the bugs is "deal with out of memory errors
cleanly". Lots of optimization means means lots of global code
analysis, which means lots of memory usage. Possibly even exponential
in the size of the function. I'll bet builtin.c has some huge honking
function in it, so the compiler runs out of memory.

My favorite example of this is trying to compile Perl on a MIPS
compiler (which tells you how old the chestnut is). Doing it on a
machine with 24Meg of ram took 8 hours to compile the evaluator. Going
to 48 meg of ram in the machine brought it down to 15 minutes. Not
turning on optimization worked like a charm as well.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14980.41426.806863.609748>