This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/17843] Warning not given for unreachable code in a switch
- 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: 5 Oct 2004 18:04:39 -0000
- Subject: [Bug middle-end/17843] Warning not given for unreachable code in a switch
- References: <20041005144957.17843.dhruvbird@yahoo.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-05 18:04 -------
This is because switches are not optimizated as much as ifs or anything else is. The warning which
Wolfgang gives is a different bug which is already filed.
Note the tree which are generated is "(int) (x != 0)" so we are switching on that but the middle-end
does not produce good RTL for that to optimize right.
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Component|c++ |middle-end
Keywords| |diagnostic
Summary|Warning not given. |Warning not given for
| |unreachable code in a switch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17843