This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/12150] [3.3/3.4 regression] warning in dead code (comparison is always false) [regression]
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Sep 2003 16:35:20 -0000
- Subject: [Bug c/12150] [3.3/3.4 regression] warning in dead code (comparison is always false) [regression]
- References: <20030903084134.12150.mattias@virtutech.se>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12150
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |minor
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-09-03 16:35 -------
It might be a regression but as I said this did not warn either (so is this a regression too because it
does warn, no it is not):
unsigned f(unsigned x)
{
return x >= 1ull << 32 ? 1 : 0;
}
The problem is the front-end warns as it is building the tree so really there is no way of knowing if
the code is reachable or not.
Also this is minor at least. Also the code where this warns is common between all C based
(C,ObjC, and C++)
I still say this is not a regression as there is no way (at least currently) to know when the front-end
warns if the code is not reachable (dead).