From: Richard Biener Date: Wed, 2 May 2018 14:19:51 +0000 (+0000) Subject: re PR tree-optimization/85597 (internal compiler error: in compute_live_loop_exits... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d6476f90da4bfcb8644da32d3b4c4685a72bc84e;p=gcc.git re PR tree-optimization/85597 (internal compiler error: in compute_live_loop_exits, at tree-ssa-loop-manip.c:229) 2018-05-02 Richard Biener PR tree-optimization/85597 * tree-vect-stmts.c (vectorizable_operation): For ternary SLP do not use split vect_get_vec_defs call but call vect_get_slp_defs directly. * gcc.dg/vect/pr85597.c: New testcase. From-SVN: r259840 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1c50825790b..1c2a8283ed6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-05-02 Richard Biener + + PR tree-optimization/85597 + * tree-vect-stmts.c (vectorizable_operation): For ternary SLP + do not use split vect_get_vec_defs call but call vect_get_slp_defs + directly. + 2018-05-02 Tom de Vries PR testsuite/85106 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e6ee793567a..ecd2de3bc27 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-05-02 Richard Biener + + PR tree-optimization/85597 + * gcc.dg/vect/pr85597.c: New testcase. + 2018-05-02 Tom de Vries PR testsuite/85106 diff --git a/gcc/testsuite/gcc.dg/vect/pr85597.c b/gcc/testsuite/gcc.dg/vect/pr85597.c new file mode 100644 index 00000000000..cf615f9c464 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr85597.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ +/* { dg-additional-options "-mfma" { target { x86_64-*-* i?86-*-* } } } */ + +extern double fma (double, double, double); + +static inline void +bar (int i, double *D, double *S) +{ + while (i-- > 0) + { + D[0] = fma (1, S[0], D[0]); + D[1] = fma (1, S[1], D[1]); + D[2] = fma (1, S[2], D[2]); + D[3] = fma (1, S[3], D[3]); + D += 4; + S += 4; + } +} + +void +foo (double *d, double *s) +{ + bar (10, d, s); +} + diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 3e73118d991..7ebc426bd3e 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -5923,15 +5923,34 @@ vectorizable_operation (gimple *stmt, gimple_stmt_iterator *gsi, /* Handle uses. */ if (j == 0) { - if (op_type == binary_op || op_type == ternary_op) + if (op_type == binary_op) vect_get_vec_defs (op0, op1, stmt, &vec_oprnds0, &vec_oprnds1, slp_node); + else if (op_type == ternary_op) + { + if (slp_node) + { + auto_vec ops(3); + ops.quick_push (op0); + ops.quick_push (op1); + ops.quick_push (op2); + auto_vec > vec_defs(3); + vect_get_slp_defs (ops, slp_node, &vec_defs); + vec_oprnds0 = vec_defs[0]; + vec_oprnds1 = vec_defs[1]; + vec_oprnds2 = vec_defs[2]; + } + else + { + vect_get_vec_defs (op0, op1, stmt, &vec_oprnds0, &vec_oprnds1, + NULL); + vect_get_vec_defs (op2, NULL_TREE, stmt, &vec_oprnds2, NULL, + NULL); + } + } else vect_get_vec_defs (op0, NULL_TREE, stmt, &vec_oprnds0, NULL, slp_node); - if (op_type == ternary_op) - vect_get_vec_defs (op2, NULL_TREE, stmt, &vec_oprnds2, NULL, - slp_node); } else {