[Bug middle-end/82404] Unnecessary instructions in switch table
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Oct 3 08:23:00 GMT 2017
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.
More information about the Gcc-bugs
mailing list