[Bug c++/87205] Inefficient code generation for switch

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Sep 4 14:46:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87205

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |7.3.0, 8.2.0, 9.0

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
I can confirm that. I've got quite simple patch that eventually generates:

h:
.LFB0:
        movl    $42, %edi
        jmp     f

for both cases you provided.

By the way do you have a more complex test-case? This one is simple as all
non-default cases contain same code.


More information about the Gcc-bugs mailing list