From: Yuri Rumyantsev Date: Thu, 23 Jul 2015 11:13:00 +0000 (+0000) Subject: PR tree-optimization/66926,66951 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b5fd0440dc8b97f416e8d39d0a1af77124a23cfe;p=gcc.git PR tree-optimization/66926,66951 gcc/ PR tree-optimization/66926,66951 * tree-vect-loop-manip.c (slpeel_tree_peel_loop_to_edge): Delete INNER_LOOP and fix up condition for renaming virtual operands. gcc/testsuite/ PR tree-optimization/66926,66951 * gcc.dg/vect/pr66951.c: New test. From-SVN: r226103 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 28538ab3085..6e1b53e988c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-07-23 Yuri Rumyantsev + + PR tree-optimization/66926,66951 + * tree-vect-loop-manip.c (slpeel_tree_peel_loop_to_edge): Delete + INNER_LOOP and fix up condition for renaming virtual operands. + 2015-07-23 Kyrylo Tkachov * combine.c (try_combine): Use std::swap instead of manually diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fe273a8d861..6f3310361c8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-07-23 Yuri Rumyantsev + + PR tree-optimization/66926,66951 + * gcc.dg/vect/pr66951.c: New test. + 2015-07-23 Paolo Carlini PR c++/52987 diff --git a/gcc/testsuite/gcc.dg/vect/pr66951.c b/gcc/testsuite/gcc.dg/vect/pr66951.c new file mode 100644 index 00000000000..628e1ee77b2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr66951.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ + +int a, b[16], c, d; + +void +fn1 () +{ + for (; d; d++) + { + for (a = 0; a < 2; a++) + ; + c ^= b[d]; + } +} diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index bafd1297488..efcc4bb0336 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -1178,7 +1178,6 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, struct loop *scalar_loop, int bound1, int bound2) { struct loop *new_loop = NULL, *first_loop, *second_loop; - struct loop *inner_loop = NULL; edge skip_e; tree pre_condition = NULL_TREE; basic_block bb_before_second_loop, bb_after_second_loop; @@ -1199,9 +1198,6 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, struct loop *scalar_loop, if (!slpeel_can_duplicate_loop_p (loop, e)) return NULL; - if (loop->inner) - inner_loop = loop->inner; - /* We might have a queued need to update virtual SSA form. As we delete the update SSA machinery below after doing a regular incremental SSA update during loop copying make sure we don't @@ -1237,9 +1233,8 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, struct loop *scalar_loop, add_phi_arg (new_phi, vop, exit_e, UNKNOWN_LOCATION); gimple_phi_set_result (new_phi, new_vop); FOR_EACH_IMM_USE_STMT (stmt, imm_iter, vop) - if (stmt != new_phi && gimple_bb (stmt) != loop->header - /* Do not rename PHI arguments in inner-loop. */ - && (!inner_loop || gimple_bb (stmt) != inner_loop->header)) + if (stmt != new_phi + && !flow_bb_inside_loop_p (loop, gimple_bb (stmt))) FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter) SET_USE (use_p, new_vop); }