diff options
author | Alan Hayward <alan.hayward@arm.com> | 2016-06-15 10:53:01 +0000 |
---|---|---|
committer | Alan Hayward <alahay01@gcc.gnu.org> | 2016-06-15 10:53:01 +0000 |
commit | 8f482165c975f0a8410e3c8ecb0c011d409062d9 (patch) | |
tree | eba3649ce4a6b1b60e6d44d00572986dae6a68f2 /gcc | |
parent | 3256673f86cb878b41da25db3d4785418d6cf2c9 (diff) | |
download | gcc-8f482165c975f0a8410e3c8ecb0c011d409062d9.zip gcc-8f482165c975f0a8410e3c8ecb0c011d409062d9.tar.gz gcc-8f482165c975f0a8410e3c8ecb0c011d409062d9.tar.bz2 |
re PR tree-optimization/71439 (wrong code at -O3 in 32-bit and 64-bit mode on x86_64-linux-gnu)
2016-06-15 Alan Hayward <alan.hayward@arm.com>
gcc/
PR tree-optimization/71439
* tree-vect-loop.c (vect_analyze_loop_operations): Additional check for
live PHIs.
testsuite/
PR tree-optimization/71439
* gcc.dg/vect/pr71439.c: New
From-SVN: r237476
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/pr71439.c | 17 | ||||
-rw-r--r-- | gcc/tree-vect-loop.c | 6 |
4 files changed, 33 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6eb52a9..568d385 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-06-15 Alan Hayward <alan.hayward@arm.com> + + PR tree-optimization/71439 + * tree-vect-loop.c (vect_analyze_loop_operations): Additional check for + live PHIs. + 2016-06-15 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * ifcvt.c (bb_ok_for_noce_multiple_sets): Allow simple lowpart diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e5100ab..9e332a2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-06-15 Alan Hayward <alan.hayward@arm.com> + + PR tree-optimization/71439 + * gcc.dg/vect/pr71439.c: New + 2016-06-15 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * gcc.target/aarch64/ifcvt_multiple_sets_subreg_1.c: New test. diff --git a/gcc/testsuite/gcc.dg/vect/pr71439.c b/gcc/testsuite/gcc.dg/vect/pr71439.c new file mode 100644 index 0000000..95e4763 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr71439.c @@ -0,0 +1,17 @@ +#include "tree-vect.h" + +int a, b, c; +short fn1(int p1, int p2) { return p1 + p2; } + +int main() { + a = 0; + for (; a < 30; a = fn1(a, 4)) { + c = b; + b = 6; + } + + if (c != 6) + abort (); + + return 0; +} diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 91d0608..4c86785 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -1669,7 +1669,8 @@ vect_analyze_loop_operations (loop_vec_info loop_vinfo) gcc_assert (stmt_info); - if (STMT_VINFO_RELEVANT (stmt_info) == vect_used_in_scope + if ((STMT_VINFO_RELEVANT (stmt_info) == vect_used_in_scope + || STMT_VINFO_LIVE_P (stmt_info)) && STMT_VINFO_DEF_TYPE (stmt_info) != vect_induction_def) { /* A scalar-dependence cycle that we don't support. */ @@ -1686,6 +1687,9 @@ vect_analyze_loop_operations (loop_vec_info loop_vinfo) ok = vectorizable_induction (phi, NULL, NULL); } + if (ok && STMT_VINFO_LIVE_P (stmt_info)) + ok = vectorizable_live_operation (phi, NULL, NULL, -1, NULL); + if (!ok) { if (dump_enabled_p ()) |