https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115896

--- Comment #2 from Gabriel Ravier <gabravier at gmail dot com> ---
Also somewhat of an opposite to `(a << cst0) == cst1` is `(cst0 << a) == cst1`,
which seems to be optimized by GCC in certain cases but not for `cst1 == 0`,
which LLVM does for e.g.:

#include <stdint.h>

bool f3(int32_t y)
{
    int32_t shl = 128 << y;
    return shl == 0;
}

(which can be optimized to `return (uint32_t)y >= 25`, which LLVM does but not
GCC)

Reply via email to