The following fixes an oversight with the last change. Tested on x86_64-unknown-linux-gnu, applied as obvious.
Richard. 2016-05-18 Richard Biener <rguent...@suse.de> PR tree-optimization/71168 * tree-loop-distribution.c (distribute_loop): Move *destroy_p initialization earlier. * gcc.dg/torture/pr71168.c: New testcase. Index: gcc/tree-loop-distribution.c =================================================================== *** gcc/tree-loop-distribution.c (revision 236358) --- gcc/tree-loop-distribution.c (working copy) *************** distribute_loop (struct loop *loop, vec< *** 1413,1418 **** --- 1426,1432 ---- graph *pg = NULL; int num_sccs = 1; + *destroy_p = false; *nb_calls = 0; auto_vec<loop_p, 3> loop_nest; if (!find_loop_nest (loop, &loop_nest)) *************** distribute_loop (struct loop *loop, vec< *** 1647,1653 **** 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)) --- 1661,1666 ---- Index: gcc/testsuite/gcc.dg/torture/pr71168.c =================================================================== *** gcc/testsuite/gcc.dg/torture/pr71168.c (revision 0) --- gcc/testsuite/gcc.dg/torture/pr71168.c (working copy) *************** *** 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(); + }