http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59569
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Bingfeng Mei from comment #9) > Seems simple patch is to just bypass permutation for constant operand as > vec_oprnd is a constant vector with identical elements. > > Index: tree-vect-stmts.c > =================================================================== > --- tree-vect-stmts.c (revision 206176) > +++ tree-vect-stmts.c (working copy) > @@ -5353,7 +5353,8 @@ vectorizable_store (gimple stmt, gimple_ > set_ptr_info_alignment (get_ptr_info (dataref_ptr), align, > misalign); > > - if (negative) > + if (negative > + && !CONSTANT_CLASS_P (gimple_assign_rhs1 (stmt))) > { > tree perm_mask = perm_mask_for_reverse (vectype); > tree perm_dest I think checking dt == vect_constant_def || dt == vect_external_def would be more appropriate. But, IMNSHO you don't need to check at the analysis phase !perm_mask_for_reverse (vectype) either.