https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81320
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2017-07-11 Ever confirmed|0 |1 --- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> --- We fail to warn in f2 because we compare the expression in the conditional sequentially, but that doesn't work due to left-to-right associativity: we compare i == 0 with i == 1 and then i == 0 || i == 1 with i == 0. The fix would probably be to keep [low, high] pairs for every comparison and then compare the pairs.