https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62191
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> --- vector(4) int _4; _4 = x_1(D) >> 31; _5 = VIEW_CONVERT_EXPR<vector(4) unsigned int>(_4); _6 = _5 >> 31; (lshiftrt (ashiftrt X N) 31) is just (lshiftrt X 31) The scalar case is handled in combine, probably by simplify_shift_const_1. We could tweak it to handle vectors, but mostly we should have a similar transformation in match.pd, and make sure it handles both scalars and vectors.