https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80138
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- So the reason why it disappears with: "(w >= y) && (w < y+h)" is that GCC has only one bit to say if we should not warn again on an expression and using () causes that bit to be set :). GCC needs more bits for that but nobody has decided to fix that. as for the warning being spurious, I don't think it is. We have: if (!(y >= r.y && y < r.y + r.h)) { int yc = r.y+10; if (yc >= r.y && yc < r.y + r.h) { return 1; } } So take: int yc = r.y+10; if (yc >= r.y && yc < r.y + r.h) You have: int yc = r.y+10; if (r.y+10 >= r.y && r.y+10 < r.y + r.h) Well r.y+10 >= r.y is causing the warning.