public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR71168
@ 2016-05-18  8:09 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2016-05-18  8:09 UTC (permalink / raw)
  To: gcc-patches


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  <rguenther@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();
+ }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-05-18  8:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-18  8:09 [PATCH] Fix PR71168 Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).