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]

Re: ppc and maybe also other cpu's stack problem


You wrote:
> The following allocates two copies of struct dumdidum on stack:
> 
> > void    func(void)
> > {
> > { struct dumdidum big; DoSomething(&big); }
> > { struct dumdidum big; DoSomething(&big); }
> > }
> 
> 
> The reason is that preserve_temp_slots in function.c
> decrements the "level" of the struct when its address
> is taken, in case it is used as a result
> of a ({...}) construct (see comment on lines 1086..1093 of function.c
> 

I'll look at it.

> Obviously in this case no ({...}) construct is involved.
> There may be a simple fix for this simple case,
> but preseve_temp_slots is called from lots of places which was
> worrisome, and also some of the comments seemed at odds with the code.
> 

In reality it is a ({ construct and it's essentiell for inline os call macros
for me. Now imagine a lot of these calls in a function and suddenly
your stack runs amok and there's no other way to handle this.


> I suspect this code is mostly in limbo, awaiting
> a more comprehensively efficient way to allocate stack space.
> 

Indeed.

Regards

---
Ralph Schmidt,laire@t-online.de(private),NextMail welcome

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