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.