https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80501
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- First of all, this is a missed-optimization on the VRP side: # RANGE [0, 128] NONZERO 128 _6 = _3 << 7; # RANGE ~[-127, -1] NONZERO 128 _8 = (signed char) _6; For arbitrary [0, 128] cast to signed char ~[-127, -1] is the right answer, sure, but if we take into account also the nonzero bits part, we'd be much better using [-128, 0] NONZERO 128 range. I'll try to debug the combine issue.