http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51356
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-11-30 17:28:47 UTC --- Created attachment 25956 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25956 gcc47-pr51356.patch The problem is that PowerPC returns a TImode vector from get_vectype_for_scalar_type of DImode boolean/integer type. vect_recog_bool_pattern sees a store of a DImode boolean, attempts to optimize it but doesn't just create the pattern stmts etc., but also already changes DR_STMT. Later on in vect_pattern_recog_1 if (VECTOR_MODE_P (TYPE_MODE (type_in))) is unfortunately not true (while type_in is a vector, it doesn't have vector mode) and thus the caller thinks type_in is a scalar type, but get_vectype_for_scalar_type on it fails, therefore vect_mark_pattern_stmts isn't called, yet DR_STMT has been already adjusted. This patch fixes it by giving up in that case already in vect_recog_bool_pattern. Alternative would be to check for VECTOR_TYPE in vect_pattern_recog_1 instead of testing for vector mode? Not sure how useful that would be though, I doubt we could actually vectorize it anyway.