This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR27151, ICE on valid with -ftree-vectorize


On Thu, 27 Apr 2006, Richard Guenther wrote:
> 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.

Hmmm.  I agree that this patch disables the problematic vectorizations,
and may be the most suitable fix for the 4.1 branch, but I believe the
intention is to be able to optimize codes such as those in this test
case.  The VEC_COND_EXPR tree code isn't documented in c-tree.texi,
but I think a reasonable set of constraints is for it to behave much
like a regular COND_EXPR, where the type of the condition needs not
match the types of the other two operands.  Though for vectors they
clearly need to have the same length.


I believe that one source of these problems may be the line:

  /* Arguments are ready. create the new vector stmt.  */
  vec_compare = build2 (TREE_CODE (cond_expr), vectype,
                        vec_cond_lhs, vec_cond_rhs);

where perhaps this should build a node of type TREE_TYPE (vec_cond_lhs),
instead of vectype.  In this case, vectype is V4SF, whilst hopefully
vec_cond_lhs is V4SI or V4QI (though I've not investigated myself)?


Perhaps we should see whether we can recover/salvage this class of
transformation, before commiting to disabling the problematic cases?
It may turn out to be the case that there's also missing infrastructure
in RTL expansion, and elsewhere downstream, in which your patch might
be a less-intrusive fix.

Roger
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]