This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/49706] No warning for (!x > 1) which is always false
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 12 Jul 2011 09:28:08 +0000
- Subject: [Bug c/49706] No warning for (!x > 1) which is always false
- Auto-submitted: auto-generated
- References: <bug-49706-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49706
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-07-12 09:27:38 UTC ---
-Wtype-limits is apparently just in shorten_compare and vrp, while here it is
optimized by fold. For
_Bool x;
...
if (x > 1)
or
struct { unsigned int i : 1; } x;
...
if (x.i > 1)
we don't warn either.