Closed davidgiven closed 5 years ago
The smallconst2 rules all assume that the constant is 8-bits wide and don't sign extend it, causing incorrect results when the constant is negative.
Trivial test case:
int foo(int n) { printf("~ is %d\n", n & ~1); }
The smallconst2 rules all assume that the constant is 8-bits wide and don't sign extend it, causing incorrect results when the constant is negative.
Trivial test case:
int foo(int n) { printf("~ is %d\n", n & ~1); }