From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17947 invoked by alias); 30 Nov 2011 17:29:57 -0000 Received: (qmail 17935 invoked by uid 22791); 30 Nov 2011 17:29:56 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_TM X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 30 Nov 2011 17:29:42 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/51356] [4.7 Regression] FAIL: gfortran.dg/anyallcount_1.f90 -O3 (internal compiler error) on powerpc-apple-darwin9 with -m32 Date: Wed, 30 Nov 2011 18:19:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-11/txt/msg02872.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51356 --- Comment #1 from Jakub Jelinek 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.