From c9326aef96dd6628bf9b170a95e9a0ecadcb9263 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 18 May 2016 08:10:20 +0000 Subject: [PATCH] re PR tree-optimization/71168 (ICE in find_uses_to_rename_use (tree-ssa-loop-manip.c:379)) 2016-05-18 Richard Biener PR tree-optimization/71168 * tree-loop-distribution.c (distribute_loop): Move *destroy_p initialization earlier. * gcc.dg/torture/pr71168.c: New testcase. From-SVN: r236361 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/torture/pr71168.c | 20 ++++++++++++++++++++ gcc/tree-loop-distribution.c | 2 +- 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/torture/pr71168.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e71ce6d75b5..ba2ab087242 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-05-18 Richard Biener + + PR tree-optimization/71168 + * tree-loop-distribution.c (distribute_loop): Move *destroy_p + initialization earlier. + 2016-05-18 James Greenhalgh * config/aarch64/aarch64-simd.md diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 87fd63a1d77..88c616418c5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-05-18 Richard Biener + + PR tree-optimization/71168 + * gcc.dg/torture/pr71168.c: New testcase. + 2016-05-17 Kugan Vivekanandarajah PR middle-end/63586 diff --git a/gcc/testsuite/gcc.dg/torture/pr71168.c b/gcc/testsuite/gcc.dg/torture/pr71168.c new file mode 100644 index 00000000000..fdf4fffc875 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr71168.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ + +int a, b, c; +long *d; +void fn1() +{ + for (; 0 < a;) + a++; +} +void fn3() +{ + for (; c; c++) + d[c] = 0; +} +void fn2() +{ + if (b) + fn3(); + fn1(); +} diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index a801348453a..dbc8e3cdbdc 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -1413,6 +1413,7 @@ distribute_loop (struct loop *loop, vec stmts, graph *pg = NULL; int num_sccs = 1; + *destroy_p = false; *nb_calls = 0; auto_vec loop_nest; if (!find_loop_nest (loop, &loop_nest)) @@ -1647,7 +1648,6 @@ distribute_loop (struct loop *loop, vec stmts, if (dump_file && (dump_flags & TDF_DETAILS)) dump_rdg_partitions (dump_file, partitions); - *destroy_p = false; FOR_EACH_VEC_ELT (partitions, i, partition) { if (partition_builtin_p (partition)) -- 2.30.2