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

--- Comment #6 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Eric Gallager from comment #5)

> keeping bug open for the enhancement to -Wtautological-compare

I tried out the code in comment 1 on recent gcc trunk
and the problem seems to be fixed:

Alphasrc $ ~/gcc/results/bin/g++ -c -g -O2 -Wall jan22a.cc
jan22a.cc: In function ‘void f(int)’:
jan22a.cc:6:24: warning: bitwise comparison always evaluates to false
[-Wtautological-compare]
    6 |         if ((n & 0x30) == 1)
      |             ~~~~~~~~~~ ^~ ~
Alphasrc $

Reply via email to