Bug 18363 - build fails when using optimization
Summary: build fails when using optimization
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.3.4
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: memory-hog
Depends on:
Blocks:
 
Reported: 2004-11-07 21:05 UTC by Alex.Prinsier@aphexer.homedns.org
Modified: 2007-05-17 15:30 UTC (History)
3 users (show)

See Also:
Host: i486-slackware-linux-gnu
Target: i486-slackware-linux-gnu
Build: i486-slackware-linux-gnu
Known to work: 3.3.3
Known to fail:
Last reconfirmed:


Attachments
this generates the error.... (88.23 KB, application/octet-stream)
2004-11-07 21:10 UTC, Alex Prinsier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex.Prinsier@aphexer.homedns.org 2004-11-07 21:05:01 UTC
	The same code builds without the -O flag but gcc 'crashes' when adding optimization...
	I wasn't sure if I had to include the binary Config.ii.bz2 in this mail... I'm using gccbug so it seems a bit odd to include binary data here.
	Instead I uploaded it, you can download it here: http://aphexer.dyndns.org/bug/Config.ii.bz2 (in the same directory there are some other maybe
	interesting files).

Environment:
System: Linux slack 2.4.26 #21 Mon Jun 14 19:17:44 PDT 2004 i686 unknown unknown GNU/Linux
Architecture: i686

	
host: i486-slackware-linux-gnu
build: i486-slackware-linux-gnu
target: i486-slackware-linux-gnu
configured with: ../gcc-3.3.4/configure --prefix=/usr --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --target=i486-slackware-linux --host=i486-slackware-linux

How-To-Repeat:
	I use this to compile: g++ -Wall -save-temps -DHAVE_CONFIG_H -I. -I. -I../.. -g -O -MT Config.o -MD -MP -MF ".deps/Config.Tpo" -c -o Config.o Config.cpp
Comment 1 Alex.Prinsier@aphexer.homedns.org 2004-11-07 21:05:01 UTC
Fix:
	Remove the -O argument.
Comment 2 Alex Prinsier 2004-11-07 21:10:55 UTC
Created attachment 7490 [details]
this generates the error....

Didn't know I could attach this here... So now I did :) You can download
related code at http://aphexer.dyndns.org/bug/ (in case you want to see what I
actually wrote, this preprocessed thing seems a bit cryptic to me :))
Comment 3 Alex Prinsier 2004-11-07 21:15:27 UTC
Can this be caused by insufficient memory? This machine only has 32MB of ram...
Comment 4 Andrew Pinski 2004-11-07 21:16:56 UTC
Yes most likley.

What is the error message?
Comment 5 Alex Prinsier 2004-11-07 21:22:30 UTC
Now it's on that next file but it's the same error:

if g++ -DHAVE_CONFIG_H -I. -I. -I../..     -g -O2 -MT HFormat.o -MD -MP -MF
".deps/HFormat.Tpo" -c -o HFormat.o HFormat.cpp; \
then mv -f ".deps/HFormat.Tpo" ".deps/HFormat.Po"; else rm -f
".deps/HFormat.Tpo"; exit 1; fi
g++: Internal error: Killed (program cc1plus)
Please submit a full bug report.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make: *** [HFormat.o] Error 1
Comment 6 Andrew Pinski 2004-11-07 21:24:04 UTC
Yes this is a case where 32M is just too little for compiling C++ code in 3.3, you might want to try 3.4.
Comment 7 Alex Prinsier 2004-11-07 21:28:11 UTC
Isn't this error a bit misleading? Something like "Not enouph memory,
aborting..." seems alot more clear! Maybe this is something which can be changed
for a next release?

Well my problem is actually solved... just add more ram :)

Maybe it's a good idea too put another note on the checklist before reporting a
bug: "do you have enouph ram? (check with 'free' while compiling)".

Thanks for helping.
Comment 8 Andrew Pinski 2004-11-07 21:29:38 UTC
g++: Internal error: Killed (program cc1plus)

The kernel is killing cc1plus for hitting memory limits and not gcc crashing.
Comment 9 Eric Botcazou 2007-05-17 15:30:24 UTC
Not a GCC bug.