Christian Jullien wrote:
I think you're right.
Bug occurs when int (0xffffffff) is promoted to long long
(0xffffffffffffffff). Then right shift and back to int conversion returns a
false result.
Another possible fix is to cast to (unsigned int) as with
if (t1 == VT_LLONG) {
l1 = v1->c.ll;
} else {
l1 = (unsigned int)v1->c.i;
}
For my test case it works but will probably break many things.
As professional software developer I know how long it takes to test
everything after a fix. This fix can break many things and I don't want
(have to time) to become a TinyCC maintainer.
I think that long long computation/promotion should only occur when type is
declared as long long.
I let you decide how you want to address this bug.
Well, then thanks for reporting. I pushed a fix on the mob branch.
http://repo.or.cz/w/tinycc.git?a=commitdiff;h=1fe4008fa3472ad0ae23f3901b64f9995a08952d
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/tinycc-devel