Re: GCC stack size
Re: GCC stack size
- Subject: Re: GCC stack size
- From: Ryan McGann <email@hidden>
- Date: Fri, 20 Feb 2009 19:11:42 -0800
On Feb 20, 2009, at 4:54 PM, Jan Brittenson wrote:
Ryan McGann wrote:
We are currently using -O3 because the code is pretty compute-
bound, and on other platforms -O3 has a nice 5% boost compared to -
O2. But changing it to -O2 doesn't even help, we have to go all the
way to -O1 to get a usable stack of 400 bytes (still 4x larger than
our Linux driver).
These are shorthand to turn on/off the various optimization options.
If I were you I'd find out what exactly they expand to, and which of
the options cause the stack bloat.
Then I'd explicitly turn off that, or those, optimizations. It may
take some guesswork and experimentation
with the a la carte options. You might also be able to find a way
to reorder the code to work around.
For instance, if it's caused by -fstack-realign, then try compiling
with -O3 -fno-stack-realign.
The difference from your Linux driver is probably just a function of
gcc version used. When your Linux
build environment catches up you'll likely find you have the foot
print issues there as well.
I should have mentioned that all the drivers use g++ 4.0.1 to compile.
For whatever reason, on Linux and FreeBSD, -O3 expands to something
very different on Mac OS X.
I guess the divide & conquer approach is the one I'll take to figure
out the offending compiler option(s) but I was hoping somebody had a
smoking gun, since -O3 expands to about 25 options.
Ryan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden