This is the mail archive of the 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]

Re: Local optimization on i386 ?

Richard Henderson wrote:
> On Wed, Dec 01, 1999 at 12:55:38AM +0100, Jamie Lokier wrote:
> > And tons of wasted space in the stack frame -- is
> > GCC aligning every 4 byte structure to 16 bytes for a reason?
> No it isn't.  But you may well have gotten stack slots allocated
> for variables that were subsequently optimized away.  We can't
> currently compact the stack frame when this happens.

As far as I can tell, none of them are optimised away.  I would be
rather pleased if they were.

I'm really surprised to see that /all/ the locals in a particular
function are on 32 byte alignment relative to %ebp.  And all of them but
1 are only 4 bytes (it's a class wrapping a pointer).  There are only 5
of those pointers, but the locals frame ends up 160 bytes long with the
pointers at every 32 bytes.

I've chopped and changed the code, both in the function and in the
classes.  I've tried using the return-value extension, and implicit
conversions to/from unwrapped pointers, and still the locals are 32
bytes aligned.  It's the only function that uses that kind of class,
which is why it might not be that particular function.

But you could be right.  It could be that every time I use a
pointer-wrapper temporary, 7 more are created on the side.  It's not a
preferred-stack-boundary thing as I tried setting that to 2.

-- Jamie

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