From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Fix PR71168
Date: Wed, 18 May 2016 08:09:00 -0000 [thread overview]
Message-ID: <alpine.LSU.2.11.1605181008080.18037@t29.fhfr.qr> (raw)
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();
+ }
reply other threads:[~2016-05-18 8:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LSU.2.11.1605181008080.18037@t29.fhfr.qr \
--to=rguenther@suse.de \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).