From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21017 invoked by alias); 10 Oct 2010 13:27:52 -0000 Received: (qmail 21007 invoked by uid 22791); 10 Oct 2010 13:27:51 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,MISSING_MID 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; Sun, 10 Oct 2010 13:27:45 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/45902] CPU2006 benchmark sphinx3 fails with vectorization 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: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: irar at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: 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 Date: Sun, 10 Oct 2010 13:27:00 -0000 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: 2010-10/txt/msg00843.txt.bz2 Message-ID: <20101010132700.Uh-_KxUbfuNLgbsHhzbvuWkYSIMhgsFzuuYzA2D8-_M@z> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45902 --- Comment #9 from Richard Guenther 2010-10-10 13:26:39 UTC --- (In reply to comment #8) > The problem is in creation of constant operands for SLP, and is caused by my > patch r155882, which takes the type for the constant from the constant itself. > This was needed for pointers, but is bad for other cases, like shift of shorts > that is treated as int here, causing wrong code generation. > > I am going to test this patch now: > > Index: tree-vect-slp.c > =================================================================== > --- tree-vect-slp.c (revision 164987) > +++ tree-vect-slp.c (working copy) > @@ -1894,13 +1894,20 @@ vect_get_constant_vectors (slp_tree slp_ > } > > if (CONSTANT_CLASS_P (op)) > - constant_p = true; > + { > + constant_p = true; > + if (POINTER_TYPE_P (TREE_TYPE (gimple_assign_lhs (stmt)))) > + vector_type = get_vectype_for_scalar_type (TREE_TYPE (op)); > + else > + vector_type = STMT_VINFO_VECTYPE (stmt_vinfo); > + } > else > - constant_p = false; > + { > + constant_p = false; > + vector_type = get_vectype_for_scalar_type (TREE_TYPE (op)); > + } > > - vector_type = get_vectype_for_scalar_type (TREE_TYPE (op)); > gcc_assert (vector_type); > - > nunits = TYPE_VECTOR_SUBPARTS (vector_type); > > /* NUMBER_OF_COPIES is the number of times we need to use the same values in I certainly would prefer unconditional use of STMT_VINFO_VECTYPE (stmt_vinfo). Why should that not work?