tree-vect-stmts.c (vectorizable_store): Only chain one related statement per copy.
authorRichard Sandiford <richard.sandiford@linaro.org>
Wed, 20 Apr 2011 08:23:03 +0000 (08:23 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 20 Apr 2011 08:23:03 +0000 (08:23 +0000)
gcc/
* tree-vect-stmts.c (vectorizable_store): Only chain one related
statement per copy.

From-SVN: r172759

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

index e9b126bbd634d8018ea4c252e866ec3969158578..3474847c9d1ddab7cb8abdec5cab8ae166d228dd 100644 (file)
@@ -1,3 +1,8 @@
+2011-04-20  Richard Sandiford  <richard.sandiford@linaro.org>
+
+       * tree-vect-stmts.c (vectorizable_store): Only chain one related
+       statement per copy.
+
 2011-04-20  Richard Sandiford  <richard.sandiford@linaro.org>
 
        * Makefile.in (INTERNAL_FN_DEF, INTERNAL_FN_H): Define.
index 0c7ab5ada88290176a628be78e400caed8eef720..879153d8031bbf3e73aed9cdbe9a96e64f38b7d4 100644 (file)
@@ -3632,6 +3632,7 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
                bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt, NULL_TREE);
        }
 
+      new_stmt = NULL;
       if (strided_store)
        {
          result_chain = VEC_alloc (tree, heap, group_size);
@@ -3688,16 +3689,18 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
           if (slp)
             continue;
 
-          if (j == 0)
-            STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt =  new_stmt;
-         else
-           STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
-
-         prev_stmt_info = vinfo_for_stmt (new_stmt);
          next_stmt = DR_GROUP_NEXT_DR (vinfo_for_stmt (next_stmt));
          if (!next_stmt)
            break;
        }
+      if (!slp)
+       {
+         if (j == 0)
+           STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
+         else
+           STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
+         prev_stmt_info = vinfo_for_stmt (new_stmt);
+       }
     }
 
   VEC_free (tree, heap, dr_chain);