From 2fe1a1b888e204fd0ccc4e9c96b7065344e879aa Mon Sep 17 00:00:00 2001 From: Bin Cheng Date: Tue, 10 Oct 2017 13:58:30 +0000 Subject: [PATCH] tree-vect-loop-manip.c (rename_variables_in_bb): Rename PHI nodes when copying loop nest with only one inner loop. * tree-vect-loop-manip.c (rename_variables_in_bb): Rename PHI nodes when copying loop nest with only one inner loop. gcc/testsuite * gcc.dg/tree-ssa/ldist-34.c: New test. From-SVN: r253586 --- gcc/ChangeLog | 5 +++++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/tree-ssa/ldist-34.c | 15 +++++++++++++++ gcc/tree-vect-loop-manip.c | 2 -- 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ldist-34.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f7f41ed3358..ed487273fb9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-10-10 Bin Cheng + + * tree-vect-loop-manip.c (rename_variables_in_bb): Rename PHI nodes + when copying loop nest with only one inner loop. + 2017-10-10 Richard Biener * tree-cfgcleanup.c (cleanup_tree_cfg_noloop): Avoid compacting diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ee9d34c7866..78a0cc40f9a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2017-10-10 Bin Cheng + + * gcc.dg/tree-ssa/ldist-34.c: New test. + 2017-10-10 Bin Cheng * gcc.dg/tree-ssa/ldist-27.c: New test. diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-34.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-34.c new file mode 100644 index 00000000000..3d68a851f57 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-34.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-loop-distribution" } */ + +#define X (3.0) +int b, c; +double a[30000]; +int foo () { + for (int i = 0; i < 100; ++i) { + for (int j = 0; j < c; ++j) + if (b) + a[0] = b; + a[i * 100] = a[1] = X; + } + return 0; +} diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index fb73a885b24..d6085337147 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -117,8 +117,6 @@ rename_variables_in_bb (basic_block bb, bool rename_from_outer_loop) || single_pred (e->src) != outer_loop->header) continue; } - else - continue; } } for (gphi_iterator gsi = gsi_start_phis (bb); !gsi_end_p (gsi); -- 2.30.2