From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19749 invoked by alias); 7 Oct 2010 13:08:23 -0000 Received: (qmail 18868 invoked by uid 22791); 7 Oct 2010 13:08:20 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,MISSING_MID,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; Thu, 07 Oct 2010 13:08:14 +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: Status Last reconfirmed AssignedTo Ever Confirmed 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: Thu, 07 Oct 2010 13:08: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/msg00653.txt.bz2 Message-ID: <20101007130800.5IS4Jvvu35OM7fgvV6iczcXBjmiiVe6Xy7nGXMqXiys@z> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45902 Ira Rosen changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2010.10.07 13:07:52 AssignedTo|unassigned at gcc dot |irar at gcc dot gnu.org |gnu.org | Ever Confirmed|0 |1 --- Comment #4 from Ira Rosen 2010-10-07 13:07:52 UTC --- It is caused by combining different type conversions into one vector stmt (lm.c:928/1147): D.8017_68 = (s3lmwid_t) D.8016_67; D.8025_86 = (uint16) D.8024_85; The types are compatible, but not the same. In revision 157833 all the type checks were changed from simple comparison to calls to types_compatible_p (). The following patch adds an exact type comparison for LHS of type conversions: Index: tree-vect-slp.c =================================================================== --- tree-vect-slp.c (revision 164987) +++ tree-vect-slp.c (working copy) @@ -335,6 +335,7 @@ vect_build_slp_tree (loop_vec_info loop_ bool permutation = false; unsigned int load_place; gimple first_load, prev_first_load = NULL; + tree first_stmt_lhs = NULL_TREE; /* For every stmt in NODE find its def stmt/s. */ FOR_EACH_VEC_ELT (gimple, stmts, i, stmt) @@ -371,6 +372,9 @@ vect_build_slp_tree (loop_vec_info loop_ return false; } + if (!first_stmt_lhs) + first_stmt_lhs = lhs; + scalar_type = vect_get_smallest_scalar_type (stmt, &dummy, &dummy); vectype = get_vectype_for_scalar_type (scalar_type); if (!vectype) @@ -473,6 +477,19 @@ vect_build_slp_tree (loop_vec_info loop_ return false; } + if (CONVERT_EXPR_CODE_P (rhs_code) + && TREE_TYPE (lhs) != TREE_TYPE (first_stmt_lhs)) + { + if (vect_print_dump_info (REPORT_SLP)) + { + fprintf (vect_dump, "Build SLP failed: different type " + "conversion in stmt "); + print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM); + } + + return false; + } + if (need_same_oprnds && !operand_equal_p (first_op1, gimple_assign_rhs2 (stmt), 0)) { I'll test the patch on Sunday. Ira