[Bug tree-optimization/56695] [4.9 Regression] ICE in expand_vec_cond_expr, at optabs.c:6751
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Mar 27 10:08:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56695
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-27 10:08:02 UTC ---
(In reply to comment #9)
> That said, it should look like, unconditionally(!)
>
> unsigned int prec = GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (vectype)));
> tree cmp_type = build_nonstandard_integer_type (prec,
> TYPE_UNSIGNED (TREE_OPERAND (cond_expr, 0)));
> vec_cmp_type = get_same_sized_vectype (cmp_type, vectype);
> if (vec_cmp_type == NULL_TREE)
> return false;
>
> whether the result is integral or not doesn't matter. You can still have
>
> foo_signed = uns1 < uns2 ? bar_signed : bar2_signed;
Err, it's just the vector comparison result (boolean mask) type. So
if (!INTEGRAL_TYPE_P (TREE_TYPE (vectype))
|| !TYPE_UNSIGNED (TREE_TYPE (vectype)))
{
unsigned int prec = GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (vectype)));
tree cmp_type = build_nonstandard_integer_type (prec, 1);
vec_cmp_type = get_same_sized_vectype (cmp_type, vectype);
if (vec_cmp_type == NULL_TREE)
return false;
}
or simply unconditionally use an unsigned mask type:
unsigned int prec = GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (vectype)));
tree cmp_type = build_nonstandard_integer_type (prec, 1);
vec_cmp_type = get_same_sized_vectype (cmp_type, vectype);
if (vec_cmp_type == NULL_TREE)
return false;
and remove the initialization of vec_cmp_type earlier.
More information about the Gcc-bugs
mailing list