This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/82404] Unnecessary instructions in switch table


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]