This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/82404] Unnecessary instructions in switch table
- 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, 03 Oct 2017 08:23:16 +0000
- Subject: [Bug middle-end/82404] Unnecessary instructions in switch table
- Auto-submitted: auto-generated
- References: <bug-82404-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82404
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Note you can only do it if the enum has enumerations from to 0 to power of 2 -
1,
if you have say enum E { E0, E1, E2 } and switch (e) { case E0: ... case E1:
... case E2: ... } you can't remove the default case, because calling it with e
== 3
is still valid.