Closed
Description
Test case:
https://godbolt.org/z/daYcYhxad
bool foo(int a)
{
if ((a >> 3) + 2 == 0) return true;
else return (a < -16 || a > -9);
}
Some generalizations will be necessary, but this is motivated from the following gcc testsuite:
https://github.com/gcc-mirror/gcc/blob/master/gcc/testsuite/gcc.dg/tree-ssa/vrp76.c
Clang13 can optimize the above function foo
, but it cannot the original f3
. Therefore, there may be problems that differ from the value range. Sorry if my example is inappropriate.