This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/51356] [4.7 Regression] FAIL: gfortran.dg/anyallcount_1.f90 -O3 (internal compiler error) on powerpc-apple-darwin9 with -m32
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 30 Nov 2011 17:28:47 +0000
- Subject: [Bug tree-optimization/51356] [4.7 Regression] FAIL: gfortran.dg/anyallcount_1.f90 -O3 (internal compiler error) on powerpc-apple-darwin9 with -m32
- Auto-submitted: auto-generated
- References: <bug-51356-4@http.gcc.gnu.org/bugzilla/>
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.