re PR tree-optimization/51485 (ICE in vectorizable_assignment)
authorJakub Jelinek <jakub@redhat.com>
Sun, 11 Dec 2011 21:01:00 +0000 (22:01 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sun, 11 Dec 2011 21:01:00 +0000 (22:01 +0100)
PR tree-optimization/51485
* tree-vect-data-refs.c (vect_analyze_data_refs): Give up on
DRs in call stmts.

* g++.dg/vect/pr51485.cc: New test.

From-SVN: r182212

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/vect/pr51485.cc [new file with mode: 0644]
gcc/tree-vect-data-refs.c

index 26df9488ee547cf9d6c64cc9fb7a8f6e23c52c1c..7668767850dcd7fa8e17e3bb5b76dd1d38a5e9c7 100644 (file)
@@ -1,3 +1,9 @@
+2011-12-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/51485
+       * tree-vect-data-refs.c (vect_analyze_data_refs): Give up on
+       DRs in call stmts.
+
 2011-12-11  Patrick Marlier  <patrick.marlier@gmail.com>
 
        * trans-mem.c (ipa_tm_transform_calls_redirect): Do not remove
index 750983887a63421d130f4b565e92740fc8d1d348..6f2ce63f2070a9bff3302c4d8c0f23d87fad981f 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/51485
+       * g++.dg/vect/pr51485.cc: New test.
+
 2011-12-11  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/50923
diff --git a/gcc/testsuite/g++.dg/vect/pr51485.cc b/gcc/testsuite/g++.dg/vect/pr51485.cc
new file mode 100644 (file)
index 0000000..d57d759
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+
+struct A { A (); unsigned int a; };
+double bar (A a) throw () __attribute__((pure));
+
+void
+foo (unsigned int x, double *y, A *z)
+{
+  unsigned int i;
+  for (i = 0; i < x; i++)
+    y[i] = bar (z[i]);
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
index 8111bdc61ac5a700b6a456902cf012ff4fba39e2..6a85b7bf4aa35819a02075ebbfc4d2a0bca962e1 100644 (file)
@@ -2896,6 +2896,26 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo,
           return false;
         }
 
+      if (is_gimple_call (stmt))
+       {
+         if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
+           {
+             fprintf (vect_dump, "not vectorized: dr in a call ");
+             print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
+           }
+
+         if (bb_vinfo)
+           {
+             STMT_VINFO_VECTORIZABLE (stmt_info) = false;
+             stop_bb_analysis = true;
+             continue;
+           }
+
+         if (gather)
+           free_data_ref (dr);
+         return false;
+       }
+
       /* Update DR field in stmt_vec_info struct.  */
 
       /* If the dataref is in an inner-loop of the loop that is considered for