From: Richard Biener Date: Wed, 14 Jan 2015 08:32:18 +0000 (+0000) Subject: re PR tree-optimization/64493 (ICE at -O3 on x86_64-linux-gnu) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=46b622cc2466685c60ef40256e49ad1fd8844cf7;p=gcc.git re PR tree-optimization/64493 (ICE at -O3 on x86_64-linux-gnu) 2015-01-14 Richard Biener PR tree-optimization/64493 PR tree-optimization/64495 * tree-vect-loop.c (vect_finalize_reduction): For double-reductions assign the proper vectorized PHI to the inner loop exit PHIs. * gcc.dg/vect/pr64493.c: New testcase. * gcc.dg/vect/pr64495.c: Likewise. From-SVN: r219579 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7a0a9a3b096..853353878e2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-01-14 Richard Biener + + PR tree-optimization/64493 + PR tree-optimization/64495 + * tree-vect-loop.c (vect_finalize_reduction): For double-reductions + assign the proper vectorized PHI to the inner loop exit PHIs. + 2015-01-14 Joey Ye * config/arm/arm.c (arm_compute_save_reg_mask): diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c07074bae8a..00dc23f89d7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2015-01-14 Richard Biener + + PR tree-optimization/64493 + PR tree-optimization/64495 + * gcc.dg/vect/pr64493.c: New testcase. + * gcc.dg/vect/pr64495.c: Likewise. + 2015-01-13 Martin Uecker * gcc.dg/Warray-bounds-11.c: New test-case. diff --git a/gcc/testsuite/gcc.dg/vect/pr64493.c b/gcc/testsuite/gcc.dg/vect/pr64493.c new file mode 100644 index 00000000000..a7dee4d66eb --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr64493.c @@ -0,0 +1,31 @@ +/* { dg-do run } */ + +#include "tree-vect.h" + +int a, b, c, d, e, f, g, h; + +int +main () +{ + check_vect (); + + for (; a; a--) + for (d = 1; d <= 0; d++) + for (; d;) + if (h) + { + if (!g) __builtin_abort (); + if (!0) __builtin_abort (); + } + + for (f = 4; f; f--) + { + for (b = 0; b < 2; b++) + c |= 1; + e |= c; + } + + return 0; +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr64495.c b/gcc/testsuite/gcc.dg/vect/pr64495.c new file mode 100644 index 00000000000..aad87526ee5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr64495.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ + +#include +#include "tree-vect.h" + +int a, b, c, d, e, f, g, i, j; +static int *h = &e; + +int +main () +{ + check_vect (); + + for (; a;) + for (; g; g++) + for (; f; f++) + if (j) + { + assert(b); + assert(0); + } + for (i = 24; i; i--) + { + for (c = 0; c < 6; c++) + d |= 1; + *h |= d; + } + + if (e != 1) + __builtin_abort (); + + return 0; +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 670fe9dacfd..fff55dffad0 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -4580,7 +4580,10 @@ vect_finalize_reduction: && !STMT_VINFO_LIVE_P (exit_phi_vinfo)) || double_reduc); - STMT_VINFO_VEC_STMT (exit_phi_vinfo) = epilog_stmt; + if (double_reduc) + STMT_VINFO_VEC_STMT (exit_phi_vinfo) = inner_phi; + else + STMT_VINFO_VEC_STMT (exit_phi_vinfo) = epilog_stmt; if (!double_reduc || STMT_VINFO_DEF_TYPE (exit_phi_vinfo) != vect_double_reduction_def)