]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR tree-optimization/51485 (ICE in vectorizable_assignment)
authorJakub Jelinek <jakub@redhat.com>
Mon, 12 Dec 2011 19:43:06 +0000 (20:43 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 12 Dec 2011 19:43:06 +0000 (20:43 +0100)
Backported from mainline
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.

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

From-SVN: r182259

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

index 0c1f9975aea88ab8bc01250859c4e9d8967fcac6..b1b83aca5d25cb9f898eb33a5544641900bb5e25 100644 (file)
@@ -1,3 +1,12 @@
+2011-12-12  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       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-12  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR tree-optimization/50569
index bdca336eb47de8e5bd756a08f5ad572774e6360f..869c3cd31220b6f5a5c792fc07a4a652b68a41c2 100644 (file)
@@ -1,3 +1,11 @@
+2011-12-12  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       2011-12-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/51485
+       * g++.dg/vect/pr51485.cc: New test.
+
 2011-12-12  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc.c-torture/execute/20111212-1.c: New test.
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 a45ad40fe2a74c05e95a3c3aedf7f0e58f8c066f..d49393f1e435b2b82a1082776eec0e48c77b009f 100644 (file)
@@ -2631,6 +2631,16 @@ 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);
+           }
+         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