Commit 158beb4a by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/71259 (GCC trunk emits wrong code)

	PR tree-optimization/71259
	* tree-vect-slp.c (vect_get_constant_vectors): For
	VECTOR_BOOLEAN_TYPE_P, return all ones constant instead of
	one for constant op, and use COND_EXPR for non-constant.

	* gcc.dg/vect/pr71259.c: New test.

From-SVN: r237147
parent 8af83210
2016-06-06 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/71259
* tree-vect-slp.c (vect_get_constant_vectors): For
VECTOR_BOOLEAN_TYPE_P, return all ones constant instead of
one for constant op, and use COND_EXPR for non-constant.
2016-06-06 David Malcolm <dmalcolm@redhat.com>
* Makefile.in (OBJS): Add function-tests.o,
......
2016-06-06 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/71259
* gcc.dg/vect/pr71259.c: New test.
2016-06-06 David Malcolm <dmalcolm@redhat.com>
* gcc.dg/plugin/levenshtein-test-1.c: Delete.
......
/* PR tree-optimization/71259 */
/* { dg-do run } */
/* { dg-options "-O3" } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
#include "tree-vect.h"
long a, b[1][44][2];
long long c[44][17][2];
int
main ()
{
int i, j, k;
check_vect ();
asm volatile ("" : : : "memory");
for (i = 0; i < 44; i++)
for (j = 0; j < 17; j++)
for (k = 0; k < 2; k++)
c[i][j][k] = (30995740 >= *(k + *(j + *b)) != (a != 8)) - 5105075050047261684;
asm volatile ("" : : : "memory");
for (i = 0; i < 44; i++)
for (j = 0; j < 17; j++)
for (k = 0; k < 2; k++)
if (c[i][j][k] != -5105075050047261684)
__builtin_abort ();
return 0;
}
......@@ -3056,7 +3056,7 @@ vect_get_constant_vectors (tree op, slp_tree slp_node,
if (integer_zerop (op))
op = build_int_cst (TREE_TYPE (vector_type), 0);
else if (integer_onep (op))
op = build_int_cst (TREE_TYPE (vector_type), 1);
op = build_all_ones_cst (TREE_TYPE (vector_type));
else
gcc_unreachable ();
}
......@@ -3071,8 +3071,14 @@ vect_get_constant_vectors (tree op, slp_tree slp_node,
gimple *init_stmt;
if (VECTOR_BOOLEAN_TYPE_P (vector_type))
{
tree true_val
= build_all_ones_cst (TREE_TYPE (vector_type));
tree false_val
= build_zero_cst (TREE_TYPE (vector_type));
gcc_assert (INTEGRAL_TYPE_P (TREE_TYPE (op)));
init_stmt = gimple_build_assign (new_temp, NOP_EXPR, op);
init_stmt = gimple_build_assign (new_temp, COND_EXPR,
op, true_val,
false_val);
}
else
{
......
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