]> 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:33:27 +0000 (11:33 +0000)
committerIra Rosen <irar@gcc.gnu.org>
Tue, 30 Jun 2009 11:33:27 +0000 (11:33 +0000)
PR tree-optimization/40542
* tree-vect-stmts.c (vect_analyze_stmt): Don't vectorize volatile
types.

From-SVN: r149090

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

index 79637f070fdd3a0f661a6f153e5c1cdfff7fcdfb..644ef85c09b0bce1ba55033a9a99ffcf63162760 100644 (file)
@@ -1,3 +1,9 @@
+2009-06-30  Ira Rosen  <irar@il.ibm.com>
+
+       PR tree-optimization/40542
+       * tree-vect-stmts.c (vect_analyze_stmt): Don't vectorize volatile 
+       types.
+
 2009-06-30  Martin Jambor  <mjambor@suse.cz>
 
        PR tree-optimization/40582
index 49ca9c1ba60e5dddd2b174be15f4eeb9feafc403..7ab502e744040fdee8c29374873ad944e6a903c7 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-30  Martin Jambor  <mjambor@suse.cz>
 
        PR tree-optimization/40582
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 586e906b1dea36339b4299bed3231c135b6a00f2..1c9415b70315902f36712effb5c3023d41cac5a3 100644 (file)
@@ -3910,6 +3910,14 @@ vect_analyze_stmt (gimple stmt, bool *need_to_vectorize, slp_tree node)
       print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
     }
 
+  if (gimple_has_volatile_ops (stmt))
+    {    
+      if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
+        fprintf (vect_dump, "not vectorized: stmt has volatile operands");
+
+      return false;
+    }
   /* Skip stmts that do not need to be vectorized. In loops this is expected 
      to include:
      - the COND_EXPR which is the loop exit condition