Commit 74946978 by Marek Polacek Committed by Marek Polacek

re PR tree-optimization/56695 (ICE in expand_vec_cond_expr, at optabs.c:6751)

PR tree-optimization/56695
* tree-vect-stmts.c (vectorizable_condition): Unconditionally
build signed result of a vector comparison.
* tree-cfg.c (verify_gimple_comparison): Check that a result
of a vector comparison has signed type.

Co-Authored-By: Richard Biener <rguenther@suse.de>

From-SVN: r197192
parent 129677c1
2013-03-28 Marek Polacek <polacek@redhat.com>
Richard Biener <rguenther@suse.de>
PR tree-optimization/56695
* tree-vect-stmts.c (vectorizable_condition): Unconditionally
build signed result of a vector comparison.
* tree-cfg.c (verify_gimple_comparison): Check that a result
of a vector comparison has signed type.
2013-03-28 Richard Biener <rguenther@suse.de>
PR tree-optimization/37021
......
2013-03-28 Marek Polacek <polacek@redhat.com>
PR tree-optimization/56695
* gcc.dg/vect/pr56695.c: New test.
2013-03-28 Richard Biener <rguenther@suse.de>
PR tree-optimization/37021
......
/* PR tree-optimization/56695 */
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-vectorize" } */
int a, b, i;
void
f (void)
{
for (i = 0; i < 8; ++i)
a |= !(i |= b %= 1);
}
/* { dg-final { cleanup-tree-dump "vect" } } */
......@@ -3191,7 +3191,10 @@ verify_gimple_comparison (tree type, tree op0, tree op1)
if (TYPE_VECTOR_SUBPARTS (type) != TYPE_VECTOR_SUBPARTS (op0_type)
|| (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (type)))
!= GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op0_type)))))
!= GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (op0_type))))
/* The result of a vector comparison is of signed
integral type. */
|| TYPE_UNSIGNED (TREE_TYPE (type)))
{
error ("invalid vector comparison resulting type");
debug_generic_expr (type);
......
......@@ -5279,7 +5279,7 @@ vectorizable_condition (gimple stmt, gimple_stmt_iterator *gsi,
vec<tree> vec_oprnds1 = vNULL;
vec<tree> vec_oprnds2 = vNULL;
vec<tree> vec_oprnds3 = vNULL;
tree vec_cmp_type = vectype;
tree vec_cmp_type;
if (slp_node || PURE_SLP_STMT (stmt_info))
ncopies = 1;
......@@ -5352,14 +5352,12 @@ vectorizable_condition (gimple stmt, gimple_stmt_iterator *gsi,
&& TREE_CODE (else_clause) != FIXED_CST)
return false;
if (!INTEGRAL_TYPE_P (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;
}
unsigned int prec = GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (vectype)));
/* The result of a vector comparison should be signed type. */
tree cmp_type = build_nonstandard_integer_type (prec, 0);
vec_cmp_type = get_same_sized_vectype (cmp_type, vectype);
if (vec_cmp_type == NULL_TREE)
return false;
if (!vec_stmt)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment