Re: [cc65] Overflows in signed comparisions

Date view Thread view Subject view

From: Groepaz (groepaz_at_gmx.net)
Date: 2003-10-10 21:57:46


On Friday 10 October 2003 21:32, Ullrich von Bassewitz wrote:
> On Fri, Oct 10, 2003 at 08:20:29PM +0200, Groepaz wrote:
> > wow....nice one :) all of the tests work again (ie, no more crashes) and
> > additionally 5 of 9 previously failing tests even return the correct
> > result(s) :=) lemme see if i can isolate the remaining problem(s) .... :)
>
> Maybe it's easier if you send me the test code?

hehe well maybe....but i dont mind working it out either :=P thing is that
those tests that contain the bugs atm consist of a relativly large piece
of code (containing a lot of small tests) and they just tell if everything
worked or not, with no chance to see which specific test failed.... and i
am fixing that (a bit atleast :=P) while tracking down those problems :) (i
am planning to use the testsuite on sdcc later, so that kinda features are
needed *casting evil spells on sdcc* :))

however, i'll try to make another "useable" version of the testsuite ASAP so
you can check yourself.... i fixed and extended the "cbmcvt.c" from the 
compiler source aswell (now matches the currently used ascii->petscii mapping
and can convert in both directions) since using "petcat" in the testsuite
proved to be responsible for some wrongly reported errors. (and ofcourse, the
cbmcvt program is useful not only for the testsuite :=))

> No, I've generated undefined behaviour in the type conversion code. Shame
> on me, I should know - and it was discussed a few months ago in
> de.comp.lang.c: Shifting a variable by the number of bits it has does not
> create zero but is undefined. So
>
>         Expr->ConstVal |= ((~0L) << NewBits);
>
> is invalid if NewBits is the number of bits in a long. This is what caused
> the problem.


oh :o) that might be the reason for rotate4.c failing too (wondering whats wrong
with it just right now :=)) ooh... and does it also affects assigning signed chars to 
signed ints? (the test i checked 5 mins ago failed because of a bug in this area)

anyway....more to that later, maybe i'll manage to upload an updated testsuite 
tonite then :)

gpz

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-10-10 22:03:11 CEST