tree-vect-transform.c (vectorizable_call): Fix tuplification.
authorRichard Guenther <rguenther@suse.de>
Mon, 4 Aug 2008 17:22:17 +0000 (17:22 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 4 Aug 2008 17:22:17 +0000 (17:22 +0000)
2008-08-04  Richard Guenther  <rguenther@suse.de>

* tree-vect-transform.c (vectorizable_call): Fix tuplification.

From-SVN: r138642

gcc/ChangeLog
gcc/tree-vect-transform.c

index 51138d6..80b26c5 100644 (file)
@@ -1,3 +1,7 @@
+2008-08-04  Richard Guenther  <rguenther@suse.de>
+
+       * tree-vect-transform.c (vectorizable_call): Fix tuplification.
+
 2008-08-04  Paul Brook  <paul@codesourcery.com>
 
        * cofig/arm/arm.c (thumb_core_reg_alloc_order): New.
index 362d37c..e466594 100644 (file)
@@ -3127,16 +3127,16 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt)
   rhs_type = NULL_TREE;
   nargs = gimple_call_num_args (stmt);
 
+  /* Bail out if the function has more than two arguments, we
+     do not have interesting builtin functions to vectorize with
+     more than two arguments.  No arguments is also not good.  */
+  if (nargs == 0 || nargs > 2)
+    return false;
+
   for (i = 0; i < nargs; i++)
     {
       op = gimple_call_arg (stmt, i);
 
-      /* Bail out if the function has more than two arguments, we
-        do not have interesting builtin functions to vectorize with
-        more than two arguments.  */
-      if (i >= 2)
-       return false;
-
       /* We can only handle calls with arguments of the same type.  */
       if (rhs_type
          && rhs_type != TREE_TYPE (op))
@@ -3147,7 +3147,7 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt)
        }
       rhs_type = TREE_TYPE (op);
 
-      if (!vect_is_simple_use (op, loop_vinfo, &def_stmt, &def, &dt[nargs]))
+      if (!vect_is_simple_use (op, loop_vinfo, &def_stmt, &def, &dt[i]))
        {
          if (vect_print_dump_info (REPORT_DETAILS))
            fprintf (vect_dump, "use not simple.");
@@ -3155,10 +3155,6 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt)
        }
     }
 
-  /* No arguments is also not good.  */
-  if (nargs == 0)
-    return false;
-
   vectype_in = get_vectype_for_scalar_type (rhs_type);
   if (!vectype_in)
     return false;