re PR tree-optimization/49318 (177.mesa in SPEC CPU 2000 failed to build)
authorIra Rosen <ira.rosen@linaro.org>
Fri, 10 Jun 2011 07:19:28 +0000 (07:19 +0000)
committerIra Rosen <irar@gcc.gnu.org>
Fri, 10 Jun 2011 07:19:28 +0000 (07:19 +0000)
        PR tree-optimization/49318
        * tree-vect-loop.c (vect_determine_vectorization_factor):
        Remove irrelevant pattern statements.

From-SVN: r174891

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

index ae04a76d60beeaaae06ee204cb13876fcd285f8e..d6a320b8a2f53d45afc6c92a949e197cba307f35 100644 (file)
@@ -1,3 +1,9 @@
+2011-06-10  Ira Rosen  <ira.rosen@linaro.org>
+
+       PR tree-optimization/49318
+       * tree-vect-loop.c (vect_determine_vectorization_factor): Remove
+       irrelevant pattern statements.
+
 2011-06-10  Hans-Peter Nilsson  <hp@axis.com>
 
        * system.h (SETJMP_VIA_SAVE_AREA): Poison.
index a1e9ae2dd74037b0cf28e96e99e50bfe7f7233f9..3ad4c213841c60b2c500815e45cf2311d136f4d9 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-10  Ira Rosen  <ira.rosen@linaro.org>
+
+       PR tree-optimization/49318
+       * gcc.dg/vect/pr49318.c: New test.
+
 2011-06-09  David Krauss  <potswa@mac.com>
 
        * g++.dg/template/arrow1.C: New.
diff --git a/gcc/testsuite/gcc.dg/vect/pr49318.c b/gcc/testsuite/gcc.dg/vect/pr49318.c
new file mode 100644 (file)
index 0000000..d1c270d
--- /dev/null
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_float } */
+
+typedef enum { GL_FALSE } GLenum;
+typedef unsigned char GLboolean;
+typedef int GLint;
+typedef unsigned int GLuint;
+typedef float GLfloat;
+typedef double GLdouble;
+typedef struct gl_context GLcontext;
+struct gl_context {
+  GLfloat TextureMatrix[16];
+  GLenum Primitive;
+};
+void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params ) {
+  GLuint i;
+  for (i=0; i<16; i++)
+    params[i] = (GLint) ctx->TextureMatrix[i];
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
index c9d0c460b624ea7d9c17898ed3818adda122222f..8ff5ad04b33a00fe3c2aad67debd002ddca8979e 100644 (file)
@@ -255,10 +255,20 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
 
          gcc_assert (stmt_info);
 
-         /* skip stmts which do not need to be vectorized.  */
+         /* Skip stmts which do not need to be vectorized.  */
          if (!STMT_VINFO_RELEVANT_P (stmt_info)
              && !STMT_VINFO_LIVE_P (stmt_info))
            {
+              if (is_pattern_stmt_p (stmt_info))
+                {
+                   /* We are not going to vectorize this pattern statement,
+                      therefore, remove it.  */
+                  gimple_stmt_iterator tmp_gsi = gsi_for_stmt (stmt);
+                  STMT_VINFO_RELATED_STMT (stmt_info) = NULL;
+                  gsi_remove (&tmp_gsi, true);
+                  free_stmt_vec_info (stmt);
+                }
+
              if (vect_print_dump_info (REPORT_DETAILS))
                fprintf (vect_dump, "skip.");
              continue;