OSDN Git Service

PR tree-optimization/30843
authorirar <irar@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Feb 2007 12:30:12 +0000 (12:30 +0000)
committerirar <irar@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Feb 2007 12:30:12 +0000 (12:30 +0000)
* tree-vect-transform.c (vect_transform_loop): Remove strided scalar
stores only after all the group is vectorized.

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

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

index 829872f..29b23b7 100644 (file)
@@ -1,3 +1,9 @@
+2007-02-22  Ira Rosen  <irar@il.ibm.com>
+
+       PR tree-optimization/30843
+       * tree-vect-transform.c (vect_transform_loop): Remove strided scalar 
+       stores only after all the group is vectorized.
+
 2007-02-22  Dorit Nuzman  <dorit@il.ibm.com>
 
        PR tree-optimization/30858
index 8556c43..bc8535c 100644 (file)
@@ -1,4 +1,10 @@
 2007-02-22  Dorit Nuzman  <dorit@il.ibm.com>
+            Ira Rosen  <irar@il.ibm.com> 
+
+       PR tree-optimization/30843
+       * gcc.dg/vect/pr30843.c: New test.
+
+2007-02-22  Dorit Nuzman  <dorit@il.ibm.com>
 
         PR tree-optimization/30858
        * gcc.dg/vect/pr30858.c: New test.
diff --git a/gcc/testsuite/gcc.dg/vect/pr30843.c b/gcc/testsuite/gcc.dg/vect/pr30843.c
new file mode 100644 (file)
index 0000000..616b618
--- /dev/null
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_long } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+void dacP98FillRGBMap (unsigned char *pBuffer)
+{
+    unsigned long dw, dw1;
+    unsigned long *pdw = (unsigned long *)(pBuffer);
+
+    for( dw = 256, dw1 = 0; dw; dw--, dw1 += 0x01010101) 
+    {
+       *pdw++ = dw1;
+       *pdw++ = dw1;
+       *pdw++ = dw1;
+       *pdw++ = dw1;
+    }
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave } } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
index 109705d..09f1993 100644 (file)
@@ -5059,7 +5059,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
   struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
   basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo);
   int nbbs = loop->num_nodes;
-  block_stmt_iterator si;
+  block_stmt_iterator si, next_si;
   int i;
   tree ratio = NULL;
   int vectorization_factor = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
@@ -5212,12 +5212,14 @@ vect_transform_loop (loop_vec_info loop_vinfo)
 
                  while (next)
                    {
+                     next_si = bsi_for_stmt (next);
                      next_stmt_info = vinfo_for_stmt (next);
                      /* Free the attached stmt_vec_info and remove the stmt.  */
                      ann = stmt_ann (next);
                      tmp = DR_GROUP_NEXT_DR (next_stmt_info);
                      free (next_stmt_info);
                      set_stmt_info (ann, NULL);
+                     bsi_remove (&next_si, true);
                      next = tmp;
                    }
                  bsi_remove (&si, true);
@@ -5233,16 +5235,6 @@ vect_transform_loop (loop_vec_info loop_vinfo)
                  continue;
                }
            }
-         else
-           {
-             if (strided_store)
-               {
-                 /* This is case of skipped interleaved store. We don't free
-                    its stmt_vec_info.  */
-                 bsi_remove (&si, true);
-                 continue;
-               }
-            }
          bsi_next (&si);
        }                       /* stmts in BB */
     }                          /* BBs in loop */