From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5624 invoked by alias); 10 Oct 2010 12:48:08 -0000 Received: (qmail 5611 invoked by uid 22791); 10 Oct 2010 12:48:07 -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 12:48:03 +0000 From: "irar at il dot ibm.com" 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: irar at il dot ibm.com 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 12:48: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/msg00842.txt.bz2 Message-ID: <20101010124800.kJD3ddc125NAzChnwG5-66OCWZX58v07SrCkfNu9EY8@z> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45902 --- Comment #8 from Ira Rosen 2010-10-10 12:47:47 UTC --- 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