[Bug middle-end/105126] [9/10/11/12 Regression] Optimization regression gcc inserts not needed movsx when using switch statement

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Apr 20 10:18:39 GMT 2022


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Bet this is related to the unfortunately still not existent type demotion pass
(that would need to be followed by some late type promotion pass before
expansion or before vectorization on the for vectorization only copy of loops).
Or we could just demote switches.
We do some demotions right now solely in the FEs (get_narrower and the like),
which is something that could handle this case, but that wouldn't handle the
case where the promotion is only visible after some propagation etc., and needs
actually analysis of all the case label values (case labels out of bounds need
to be DCEd or if they are ranges, narrowed).


More information about the Gcc-bugs mailing list