Problem
When the program
void main() {
long val = (((long) 1) * ((long) 1));
assert(val == 1);
}
is run with command line
tri -arithMode:ilp32 example.c
it gives
(error "-1 is out of bounds (min 0, max 1)")
Other Error: -1 is out of bounds (min 0, max 1)
The expected result is SAFE. Using arithMode:lp64 or arithMode:llp64 gives the same result.
Note
Both
void main() {
long val = (((long) 1) * (1L));
assert(val == 1);
}
and
void main() {
long val = ((1L) * (1L));
assert(val == 1);
}
work fine. This may suggest that something is off when doing type casts.