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


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

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.

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

Tom Truscott 

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