int f(int x) { return ~(x-1);//should be -x }
int f(int x) { return ~ (-x); // x-1 }
int f(int x) { return - (~x); // should be x-1 }
Confirmed.
Actually, the function in Comment #2 should generate "x + 1".
Created attachment 8183 [details] testcase
Created attachment 8184 [details] Fold unary operations This folds the three cases givin in this bug.
Fixed.