tree-vect-stmts.c (vectorizable_load): Set new vinfo only if it was not yet set.
authorRichard Biener <rguenther@suse.de>
Wed, 9 Dec 2015 08:23:37 +0000 (08:23 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 9 Dec 2015 08:23:37 +0000 (08:23 +0000)
2015-12-09  Richard Biener  <rguenther@suse.de>

* tree-vect-stmts.c (vectorizable_load): Set new vinfo only
if it was not yet set.
* tree-vectorizer.h (set_vinfo_for_stmt): Assert we don't
overwrite an existing entry.

From-SVN: r231443

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

index 1a4c3e651f39967b7880ab51d14a6582424479f8..7fcec750d072e3c7c6f4f743cfcadb82829d6319 100644 (file)
@@ -1,3 +1,10 @@
+2015-12-09  Richard Biener  <rguenther@suse.de>
+
+       * tree-vect-stmts.c (vectorizable_load): Set new vinfo only
+       if it was not yet set.
+       * tree-vectorizer.h (set_vinfo_for_stmt): Assert we don't
+       overwrite an existing entry.
+
 2015-12-09  Chung-Lin Tang  <cltang@codesourcery.com>
 
        * c-family/c-omp.c (c_finish_oacc_wait): Remove add_stmt() call.
index 9f116528b47edccf4a4b676681eb797ba312e6e5..1a65c03753d4977ceea6b0077b2ef78da9454e99 100644 (file)
@@ -7276,6 +7276,9 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
                                              unshare_expr
                                                (gimple_assign_rhs1 (stmt))));
                      new_temp = vect_init_vector (stmt, tem, vectype, NULL);
+                     new_stmt = SSA_NAME_DEF_STMT (new_temp);
+                     set_vinfo_for_stmt (new_stmt,
+                                         new_stmt_vec_info (new_stmt, vinfo));
                    }
                  else
                    {
@@ -7283,10 +7286,8 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
                      gsi_next (&gsi2);
                      new_temp = vect_init_vector (stmt, scalar_dest,
                                                   vectype, &gsi2);
+                     new_stmt = SSA_NAME_DEF_STMT (new_temp);
                    }
-                 new_stmt = SSA_NAME_DEF_STMT (new_temp);
-                 set_vinfo_for_stmt (new_stmt,
-                                     new_stmt_vec_info (new_stmt, vinfo));
                }
 
              if (negative)
index 327f08d79ed55c6394a57a4d6258c5c5a01c1fac..b07f27000985b83002ae950088e41304d249401f 100644 (file)
@@ -715,7 +715,10 @@ set_vinfo_for_stmt (gimple *stmt, stmt_vec_info info)
       stmt_vec_info_vec.safe_push (info);
     }
   else
-    stmt_vec_info_vec[uid - 1] = info;
+    {
+      gcc_checking_assert (info == NULL);
+      stmt_vec_info_vec[uid - 1] = info;
+    }
 }
 
 /* Return the earlier statement between STMT1 and STMT2.  */