This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/84436] Missed optimization with switch on enum constants returning the same value
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 19 Feb 2018 12:38:01 +0000
- Subject: [Bug c++/84436] Missed optimization with switch on enum constants returning the same value
- Auto-submitted: auto-generated
- References: <bug-84436-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84436
--- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> ---
Note that this is good for identity, but we could also turn a map 0->3, 1->4,
5->8 into x->x+3, or generally any map (with an unreachable default case) into
a polynomial (or some other simple function), the cost of which might be higher
or lower than the jump table. It probably isn't worth going too far in that
direction though.