This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR27151, ICE on valid with -ftree-vectorize
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 27 Apr 2006 14:46:15 +0200 (CEST)
- Subject: [PATCH] Fix PR27151, ICE on valid with -ftree-vectorize
This fixes an ICE that happens as we create a vectorized statement
which would need two different vector types.
Bootstrapped and regtested on x86_64-unknown-linux-gnu (mainline and
branch).
Ok for mainline and 4.1?
Thanks,
Richard.
:ADDPATCH vectorizer:
2006-04-27 Richard Guenther <rguenther@suse.de>
PR tree-optimization/27151
* tree-vect-transform.c (vectorizable_condition): Punt on
values that have a different type than the condition.
* gcc.dg/vect/pr27151.c: New testcase.
Index: gcc/tree-vect-transform.c
===================================================================
*** gcc/tree-vect-transform.c (revision 113296)
--- gcc/tree-vect-transform.c (working copy)
*************** vectorizable_condition (tree stmt, block
*** 2115,2120 ****
--- 2115,2125 ----
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;
Index: gcc/testsuite/gcc.dg/vect/pr27151.c
===================================================================
*** gcc/testsuite/gcc.dg/vect/pr27151.c (revision 0)
--- gcc/testsuite/gcc.dg/vect/pr27151.c (revision 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);
+ }
+ }