]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/40542 (vectorizes access to volatile array)
authorIra Rosen <irar@il.ibm.com>
Tue, 30 Jun 2009 11:48:51 +0000 (11:48 +0000)
committerIra Rosen <irar@gcc.gnu.org>
Tue, 30 Jun 2009 11:48:51 +0000 (11:48 +0000)
PR tree-optimization/40542
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't
vectorize volatile types.

From-SVN: r149091

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr40542.c [new file with mode: 0644]
gcc/tree-vect-analyze.c

index 63ca404ef9ce2e26d32b4710b8872dfc05cfc744..4a2bdff05b0313b58c36957d6f5999b93f6cf88f 100644 (file)
@@ -1,3 +1,9 @@
+2009-06-30  Ira Rosen  <irar@il.ibm.com>
+
+       PR tree-optimization/40542
+       * tree-vect-analyze.c (vect_determine_vectorization_factor): Don't 
+       vectorize volatile types.
+
 2009-06-29  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/40579
index d3ec476880583a08ecaede07b53bfffe3d6e69dc..b4326871563ef942749b88bf9a50b49f5b76e82f 100644 (file)
@@ -1,3 +1,8 @@
+2009-06-30  Ira Rosen  <irar@il.ibm.com>
+
+       PR tree-optimization/40542
+       * gcc.dg/vect/pr40542.c: New test.
+
 2009-06-29  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/40579
diff --git a/gcc/testsuite/gcc.dg/vect/pr40542.c b/gcc/testsuite/gcc.dg/vect/pr40542.c
new file mode 100644 (file)
index 0000000..0a82772
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+
+void
+volarr_cpy(char *d, volatile char *s)
+{
+  int i;
+  
+  for (i = 0; i < 16; i++)
+    d[i] = s[i];
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
index c7f6d05aa2a9f75dfd605378c74e71104647c90e..62371cc1b952edf4bb1b133d2b0a899386928ef9 100644 (file)
@@ -173,6 +173,15 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
              print_generic_expr (vect_dump, stmt, TDF_SLIM);
            }
 
+          if (stmt_ann (stmt)->has_volatile_ops)
+            {
+              if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS))
+                fprintf (vect_dump, "not vectorized: stmt has volatile"
+                                    " operands");
+
+              return false;
+            }
+
          gcc_assert (stmt_info);
 
          /* skip stmts which do not need to be vectorized.  */