From: Jakub Jelinek Date: Fri, 8 Jan 2016 08:37:17 +0000 (+0100) Subject: re PR tree-optimization/69083 (ICE at -O3 in 64-bit mode on x86_64-linux-gnu (verify_... X-Git-Tag: upstream/12.2.0~49648 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=262a363ff9f03262fe5a8420fa53bd10cb4306d6;p=platform%2Fupstream%2Fgcc.git re PR tree-optimization/69083 (ICE at -O3 in 64-bit mode on x86_64-linux-gnu (verify_gimple failed)) PR tree-optimization/69083 * tree-vect-slp.c (vect_get_constant_vectors): For VECTOR_BOOLEAN_TYPE_P assert op is fold_convertible_p to vector_type's element type. If op is fold_convertible_p to vector_type's element type, use NOP_EXPR instead of VCE. * gcc.dg/vect/pr69083.c: New test. From-SVN: r232153 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 44a2e01..5402c36 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2016-01-08 Jakub Jelinek + + PR tree-optimization/69083 + * tree-vect-slp.c (vect_get_constant_vectors): For + VECTOR_BOOLEAN_TYPE_P assert op is fold_convertible_p to vector_type's + element type. If op is fold_convertible_p to vector_type's element + type, use NOP_EXPR instead of VCE. + 2016-01-08 Segher Boessenkool PR rtl-optimization/67778 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 589576e..63a6e88 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-01-08 Jakub Jelinek + + PR tree-optimization/69083 + * gcc.dg/vect/pr69083.c: New test. + 2016-01-08 Sujoy Saraswati PR tree-optimization/61441 diff --git a/gcc/testsuite/gcc.dg/vect/pr69083.c b/gcc/testsuite/gcc.dg/vect/pr69083.c new file mode 100644 index 0000000..dd8b347 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr69083.c @@ -0,0 +1,20 @@ +/* PR tree-optimization/69083 */ +/* { dg-do compile } */ +/* { dg-additional-options "-O3" } */ + +int d; +short f; + +void +foo (int a, int b, int e, short c) +{ + for (; e; e++) + { + int j; + for (j = 0; j < 3; j++) + { + f = 7 >> b ? a : b; + d |= c == 1 ^ 1 == f; + } + } +} diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index cb61d14..b029f61 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -2967,9 +2967,22 @@ vect_get_constant_vectors (tree op, slp_tree slp_node, { tree new_temp = make_ssa_name (TREE_TYPE (vector_type)); gimple *init_stmt; - op = build1 (VIEW_CONVERT_EXPR, TREE_TYPE (vector_type), op); - init_stmt - = gimple_build_assign (new_temp, VIEW_CONVERT_EXPR, op); + if (VECTOR_BOOLEAN_TYPE_P (vector_type)) + { + gcc_assert (fold_convertible_p (TREE_TYPE (vector_type), + op)); + init_stmt = gimple_build_assign (new_temp, NOP_EXPR, op); + } + else if (fold_convertible_p (TREE_TYPE (vector_type), op)) + init_stmt = gimple_build_assign (new_temp, NOP_EXPR, op); + else + { + op = build1 (VIEW_CONVERT_EXPR, TREE_TYPE (vector_type), + op); + init_stmt + = gimple_build_assign (new_temp, VIEW_CONVERT_EXPR, + op); + } gimple_seq_add_stmt (&ctor_seq, init_stmt); op = new_temp; }