From f2164f876fb482f4971160cd900a63217bd07b87 Mon Sep 17 00:00:00 2001 From: Ira Rosen Date: Fri, 10 Jun 2011 07:19:28 +0000 Subject: [PATCH] re PR tree-optimization/49318 (177.mesa in SPEC CPU 2000 failed to build) PR tree-optimization/49318 * tree-vect-loop.c (vect_determine_vectorization_factor): Remove irrelevant pattern statements. From-SVN: r174891 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/vect/pr49318.c | 22 ++++++++++++++++++++++ gcc/tree-vect-loop.c | 12 +++++++++++- 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/vect/pr49318.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ae04a76d60b..d6a320b8a2f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-06-10 Ira Rosen + + PR tree-optimization/49318 + * tree-vect-loop.c (vect_determine_vectorization_factor): Remove + irrelevant pattern statements. + 2011-06-10 Hans-Peter Nilsson * system.h (SETJMP_VIA_SAVE_AREA): Poison. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a1e9ae2dd74..3ad4c213841 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-06-10 Ira Rosen + + PR tree-optimization/49318 + * gcc.dg/vect/pr49318.c: New test. + 2011-06-09 David Krauss * 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 index 00000000000..d1c270d6870 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr49318.c @@ -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" } } */ diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index c9d0c460b62..8ff5ad04b33 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -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; -- 2.30.2