ppc and maybe also other cpu's stack problem
Thomas R. Truscott
trt@cs.duke.edu
Mon Jul 10 09:39:00 GMT 2000
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
More information about the Gcc
mailing list