This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Short Displacement Optimizations.
- From: dewar at gnat dot com (Robert Dewar)
- To: gcc at gcc dot gnu dot org, naveens at noida dot hcltech dot com
- Date: Wed, 3 Apr 2002 08:14:37 -0500 (EST)
- Subject: Re: Short Displacement Optimizations.
<<In general it is desirable to minimize the number of instructions used for
setting appropriate locations in the frame.Although I am still investigating
the problems
further, I would like to know views of the community on this.And would be
keen
to implement a solution.
>>
It is certainly normal procedure in compilers to sort local variables by
increasing size. That minimizes gaps and as Naveen points out minimizes
cost of large displacements. I would consider this absolutely standard
practice. I am a bit surprised this is not already done.
Indeed what many compilers do is to decide that big static arrays should
not be handled statically but instead treated like dynamic arrays with
a separate pointer allocated on the stack in the easily accessible
fixed part.