avr-gcc-list
[Top][All Lists]
Advanced

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

[avr-gcc-list] vararg bug?


From: Harald Kipp
Subject: [avr-gcc-list] vararg bug?
Date: Tue Jan 16 06:02:04 2001

As this is my first appearence in this list, I'd
like to say hello to everybody. Being born and
living in Germany, my English might be a little
bit unpolished, but I'll try my very best. :-)

The topic: Using the Win32 port of 2.95.2,
I discovered a problem. Assume

int f2(a1, ...)
{
   /* Some code */
}

int f1(b1)
{
    /* Some code */
    f2(x1, x2, x3);
    ret y1;
}

int main(void)
{
    /* Some code */
    w1 = f1(z1);
}

Sometimes(!) it happened, that w1 is not y1.
After I checked the assembler output, I found,
that the compiler corrects the stack pointer
before returning from f1(), BUT AFTER the result
has been stored in R24:R25. The problem is, that
sometimes R24 or R25 is used for the stack pointer
update, which destroys the previously stored
result.

I tried to figure out, how the compiler selects
the register for the stack correction  - without 
any success.

Any ideas?

Btw., of course I asked Volker Oth, but he never
heard anything about this problem.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]