Re: gcc complier
Re: gcc complier
- Subject: Re: gcc complier
- From: David Fang <email@hidden>
- Date: Tue, 8 Feb 2005 11:20:14 -0500 (EST)
Hi,
I've experienced gcc completely hosing my machine until it runs
out of memory on several accounts, but they were always caused by bad code
on my part. In all cases, gcc did not emit any feedback on the command
line, it just kept running... To offer two shots in the dark from my
experience:
1) Non-terminating recursive instantiating templates (accidental
or intentional) will keep the compiler busy indefinitely. Example: a
template with a size_t parameter whose member depends on the member value
of the same template with parameter +1.
2) Most curious was a pathological case of bad parsing. This was
difficult to reduce to a snippet of code, but basically I had a typo where
I wrote ':' instead of '::' -- this was the only error. I gather that the
gcc parser hit one of those extremely rare cases where the number of
possible states exploded exponentially, eating up 2 GB of VM in a matter
of minutes.
In both cases, CPU usage was indeed saturated. In case 1) I saw
memory usage climb at a slow but steady rate, probably depends on
recusion complexity. In case 2) memory usage shot off the roof in about a
minute, after which I received the intimidating message:
Virtual memory exhausted.
I didn't really consider either of these cases 'bugs' because they
came from my own bad code, but some diagnostics of compiler progress
would've been nice.
Perhaps others can share bizarre experiences?
> > We've developing in C++ in XCode using gcc compiler. We currently have
> > a small project of just a few hundred lines but it takes a long time
> > to compile. The CPU goes to 100% and just stays there for 30 seconds.
> > Our project is going to grow 100 times in the next few months. If my
> > math is correct, it will take us an hour to compile it.
> > Has anyone experienced performance issues with gcc compiler?
> Is it really GCC that uses all that CPU? Use the command line utility
> "top" to find out what is really consuming your CPU resources while
> compiling. You can also use Shark to see what Xcode is doing in greater
> detail. If you think something looks strange, file a performance bug
> report to Apple via their web based bug reporter.
>
> You might also want to check the mailing list archives for hints on how
> to make Xcode / GCC faster - for example by using precompiled headers.
David Fang
Computer Systems Laboratory
Electrical & Computer Engineering
Cornell University
http://www.csl.cornell.edu/~fang/ -- *gag* work in progress
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden