PR tree-optimization/40542
authorirar <irar@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Jun 2009 11:33:27 +0000 (11:33 +0000)
committerirar <irar@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Jun 2009 11:33:27 +0000 (11:33 +0000)
* tree-vect-stmts.c (vect_analyze_stmt): Don't vectorize volatile
types.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149090 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 79637f0..644ef85 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 49ca9c1..7ab502e 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 586e906..1c9415b 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