From: Richard Biener Date: Fri, 22 Feb 2019 10:52:49 +0000 (+0000) Subject: re PR tree-optimization/89440 (ICE in vect_create_epilog_for_reduction, at tree-vect... X-Git-Tag: basepoints/gcc-10~995 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f0ffb2bdfa04a617ca81e55ab686a80d6ad6c77;p=thirdparty%2Fgcc.git re PR tree-optimization/89440 (ICE in vect_create_epilog_for_reduction, at tree-vect-loop.c:5502) 2019-02-22 Richard Biener PR tree-optimization/89440 * tree-vect-loop.c (vect_create_epilog_for_reduction): Remove not necessary assert. * gcc.dg/vect/pr89440.c: New testcase. From-SVN: r269111 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f14cbbce4775..b2b413c75361 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-02-22 Richard Biener + + PR tree-optimization/89440 + * tree-vect-loop.c (vect_create_epilog_for_reduction): Remove + not necessary assert. + 2019-02-22 Thomas Schwinge PR fortran/72741 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 709e1b1ee04a..1dd1d4b065e9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-02-22 Richard Biener + + PR tree-optimization/89440 + * gcc.dg/vect/pr89440.c: New testcase. + 2019-02-22 Thomas Schwinge * lib/target-supports.exp (check_effective_target_offload_nvptx): diff --git a/gcc/testsuite/gcc.dg/vect/pr89440.c b/gcc/testsuite/gcc.dg/vect/pr89440.c new file mode 100644 index 000000000000..668f48ef2a1a --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr89440.c @@ -0,0 +1,32 @@ +/* { dg-do run } */ +/* { dg-additional-options "-ffast-math" } */ + +#include "tree-vect.h" + +float __attribute__((noinline,noclone)) +f (float x) +{ + int i; + float j; + float a = 0; + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + a += 1; + x += a; + } + } + return x; +} + +int +main() +{ + check_vect (); + if (f (1.0f) != 137.0f) + abort (); + return 0; +} + +/* { dg-final { scan-tree-dump "OUTER LOOP VECTORIZED" "vect" { target vect_float } } } */ diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index d63d3825f201..e088b6f79e8f 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -5494,13 +5494,6 @@ vect_finalize_reduction: = loop_vinfo->lookup_stmt (exit_phi); gphi *vect_phi; - /* FORNOW. Currently not supporting the case that an inner-loop - reduction is not used in the outer-loop (but only outside the - outer-loop), unless it is double reduction. */ - gcc_assert ((STMT_VINFO_RELEVANT_P (exit_phi_vinfo) - && !STMT_VINFO_LIVE_P (exit_phi_vinfo)) - || double_reduc); - if (double_reduc) STMT_VINFO_VEC_STMT (exit_phi_vinfo) = inner_phi; else