http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45902

Ira Rosen <irar at il dot ibm.com> 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 <irar at il dot ibm.com> 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

Reply via email to