diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e20201357fef..bae29826db9d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2006-05-06 Richard Guenther + + PR tree-optimization/27151 + * tree-vect-transform.c (vectorizable_condition): Punt on + values that have a different type than the condition. + 2006-05-03 Aldy Hernandez PR/21391 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d259e4035320..3e6e72511a16 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-05-06 Richard Guenther + + PR tree-optimization/27151 + * gcc.dg/vect/pr27151.c: New testcase. + 2006-05-06 Volker Reichelt PR c++/27430 diff --git a/gcc/testsuite/gcc.dg/vect/pr27151.c b/gcc/testsuite/gcc.dg/vect/pr27151.c new file mode 100644 index 000000000000..8b53b29b672b --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr27151.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ + +/* We were creating a float vector for the vis_type == 1 + test, which we ICEd on. Now we simply punt here. */ + +float vs_data[75]; +void vis_clear_data () +{ + int vis_type, i; + for (i = 0; i < 75; i++) + { + vs_data[i] = (vis_type == 1); + } +} diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c index b1a9b0a39454..8c65b8695347 100644 --- a/gcc/tree-vect-transform.c +++ b/gcc/tree-vect-transform.c @@ -2117,6 +2117,11 @@ vectorizable_condition (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt) then_clause = TREE_OPERAND (op, 1); else_clause = TREE_OPERAND (op, 2); + /* We do not handle two different vector types for the condition + and the values. */ + if (TREE_TYPE (TREE_OPERAND (cond_expr, 0)) != TREE_TYPE (vectype)) + return false; + if (!vect_is_simple_cond (cond_expr, loop_vinfo)) return false;