From a989bcc3f56ee3b90a9c8d78c94d424d1629f2ec Mon Sep 17 00:00:00 2001 From: Ilya Enkovich Date: Thu, 12 Nov 2015 12:59:05 +0000 Subject: [PATCH] =?utf8?q?re=20PR=20tree-optimization/68305=20(ICE=20on=20?= =?utf8?q?valid=20code=20at=20-O3=20on=20x86=5F64-linux-gnu:=20tree=20chec?= =?utf8?q?k:=20expected=20class=20=E2=80=98expression=E2=80=99,=20have=20?= =?utf8?q?=E2=80=98exceptional=E2=80=99=20(ssa=5Fname)=20in=20tree=5Fopera?= =?utf8?q?nd=5Fcheck,=20at=20tree.h:3436)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit gcc/ PR tree-optimization/68305 * tree-vect-slp.c (vect_get_constant_vectors): Support COND_EXPR with SSA_NAME as a condition. gcc/testsuite/ PR tree-optimization/68305 * gcc.dg/vect/pr68305.c: New test. From-SVN: r230252 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/vect/pr68305.c | 13 +++++++++++++ gcc/tree-vect-slp.c | 24 +++++++++++++----------- 4 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/vect/pr68305.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d43e6cff916..b7c3df7830c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-11-12 Ilya Enkovich + + PR tree-optimization/68305 + * tree-vect-slp.c (vect_get_constant_vectors): Support + COND_EXPR with SSA_NAME as a condition. + 2015-11-12 Eric Botcazou * config/visium/visium-protos.h (notice_update_cc): Delete. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d3259b6fa38..c71b979c4c1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-11-12 Ilya Enkovich + + PR tree-optimization/68305 + * gcc.dg/vect/pr68305.c: New test. + 2015-11-12 Eric Botcazou * gcc.target/i386/pr67265-2.c: New test. diff --git a/gcc/testsuite/gcc.dg/vect/pr68305.c b/gcc/testsuite/gcc.dg/vect/pr68305.c new file mode 100644 index 00000000000..fde3db723cc --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr68305.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-O3" } */ +/* { dg-additional-options "-mavx2" { target avx_runtime } } */ + +int a, b; + +void +fn1 () +{ + int c, d; + for (; b; b++) + a = a ^ !c ^ !d; +} diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 75875f333ad..ab1d40eb575 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -2740,18 +2740,20 @@ vect_get_constant_vectors (tree op, slp_tree slp_node, switch (code) { case COND_EXPR: - if (op_num == 0 || op_num == 1) - { - tree cond = gimple_assign_rhs1 (stmt); + { + tree cond = gimple_assign_rhs1 (stmt); + if (TREE_CODE (cond) == SSA_NAME) + op = gimple_op (stmt, op_num + 1); + else if (op_num == 0 || op_num == 1) op = TREE_OPERAND (cond, op_num); - } - else - { - if (op_num == 2) - op = gimple_assign_rhs2 (stmt); - else - op = gimple_assign_rhs3 (stmt); - } + else + { + if (op_num == 2) + op = gimple_assign_rhs2 (stmt); + else + op = gimple_assign_rhs3 (stmt); + } + } break; case CALL_EXPR: -- 2.30.2