[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in GCC 2.4.5 PL 1 with MiNTLibs PL 30
Markus Gutschke <srb242@math.uni-muenster.de> writes:
>I am not quite sure if this is the appropriate place to report a bug
>in GCC and/or the MiNT-Libs, but I hope somebody will be able to fix
>it.
>
>I am running GCC 2.4.5 Patchlevel 1
>with MintLibs Patchlevel 30
>
>When compiling the following code (with -O2)
>
> int *a;
>
> static void _test(int b,void *c)
> {
> long stack;
>
> stack = Super(0);
> test(a,b,c);
> Super((void *)stack);
> return;
> }
>
>GCC will not remove the parameters "a,b,c" from the stack until it
>returned from calling Super. Thus, the parameters will be pushed in
>supervisormode and removed in user mode!
I dont see that this is a bug, since the stack after the first Super()
call is in fact the user stack (!), so the pushing of the parameters
will take place in supervisor mode, but on the user stack.
When returning from the second Super() call, the user stack pointer is
again itself, and the args are removed from it.
This behavior to pile up stack arguments is one thing to speed things
up a bit, as the remove operations are done only after a number of calls
and not after every call.
Regards,
Ulrich