[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in GCC 2.4.5 PL 1 with MiNTLibs PL 30



Hi,

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! A workaround looks like
this:

                int *a;
                
                static void _test(int b,void *c)
                {
                   long stack;
                   
                   stack = Super(0);
                   if (stack)
                           test(a,b,c);
                   Super((void *)stack);
                   return;
                }

This will cause GCC to update the stack when leaving the "if"-branch.
This problem did not occur with previous versions of GCC; could
somebody please have a look at it and either fix GCC or patch the
MiNTLibs to cause a stack update operation after calling Super().

Thanx


Markus

-- 

--------------------------------------------------------------------
Markus Gutschke | Internet: Markus.Gutschke@uni-muenster.de
Papenbusch 31   |       or: srb242@math.uni-muenster.de
48159 M"unster  | `Death --- no excuse for not working'
W-Germany       |            (`Supreme Being' in `Time Bandits')