This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: i386 stack slot optimisation


> -O3 enables function inlining.  With function inlining, we can see that 
> the arrays are unused and we optimize them away.  Without the arrays, 
> the stack frames are small, and hence you get small offsets.

The external functions in my example using the arrays ensures that the
arrays are not optimized away. 

> FRAME_GROWS_DOWNWARD has little effect on frame offsets.

The registers that are spilled are allocated place in the stack frame
last, so when FRAME_GROWS_DOWNWARD, the displacement offsets are
smaller for spilled registers than with the stack frame growing upwards.

Spilled registeres are accessed more frequently than other entries in
the stack frame, so getting this right(which I think pretty much all
backends do, after a quick scan) has a significant positive impact on
code-size.


-- 
Øyvind Harboe
http://www.zylin.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]