[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Bug found in __mulhi3 - was Is this possibly a bug in
Re: [avr-gcc-list] Bug found in __mulhi3 - was Is this possibly a bug in avr-gcc ?
Tue, 27 Mar 2001 21:05:16 +0200 (CEST)
> The bug occurs when the function is called with the paramaters :-
> register R22 = 0x18
> register R23 = 0x00
> register R24 = 0x01
> register R25 = 0x02
> ie, the function is performing 0x201 * 0x18
> The returned value is 0x18 instead of 0x3018 and is therefore incorrect.
Congratulations - you found a real bug, I can reproduce this too.
I suspect one of the tests to exit the loop when arg1 or arg2 reaches
zero is wrong. But I don't yet see what is wrong... and that part of
the code has not changed for a very long time (except r20 -> r0), was
the same in 2.95.2 too.
> I have no idea where the source to this function is located, but i'm sure
> some of you do !
The chip I have is AT90S8535-8PI-0011. Not sure, could also be some
undocumented feature in setting flags? 513 * 1 = 1 is wrong too...