This is the mail archive of the
mailing list for the GCC project.
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