From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Fix PR83089
Date: Wed, 22 Nov 2017 08:54:00 -0000 [thread overview]
Message-ID: <alpine.LSU.2.20.1711220943240.12252@zhemvz.fhfr.qr> (raw)
The following fixes if-conversion to free SCEV/niter estimates because
it DCEs stmts.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2017-11-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/83089
* tree-if-conv.c (pass_if_conversion::execute): If anything
changed reset SCEV and free the number of iteration estimates.
* gcc.dg/pr83089.c: New testcase.
Index: gcc/tree-if-conv.c
===================================================================
--- gcc/tree-if-conv.c (revision 254990)
+++ gcc/tree-if-conv.c (working copy)
@@ -2959,6 +2959,12 @@ pass_if_conversion::execute (function *f
&& !loop->dont_vectorize))
todo |= tree_if_conversion (loop);
+ if (todo)
+ {
+ free_numbers_of_iterations_estimates (fun);
+ scev_reset ();
+ }
+
if (flag_checking)
{
basic_block bb;
Index: gcc/testsuite/gcc.dg/pr83089.c
===================================================================
--- gcc/testsuite/gcc.dg/pr83089.c (nonexistent)
+++ gcc/testsuite/gcc.dg/pr83089.c (working copy)
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-if-convert -ftree-parallelize-loops=2" } */
+
+int rl, s8;
+
+void
+it (int zy, short int el)
+{
+ int hb;
+
+ while (el != 0)
+ {
+ hb = el;
+ for (rl = 0; rl < 200; ++rl)
+ {
+ for (s8 = 0; s8 < 2; ++s8)
+ {
+ }
+ if (s8 < 3)
+ zy = hb;
+ if (hb == 0)
+ ++s8;
+ zy += (s8 != -1);
+ }
+ el = zy;
+ }
+}
next reply other threads:[~2017-11-22 8:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-22 8:54 Richard Biener [this message]
2017-11-22 20:38 ` Christophe Lyon
2017-11-23 8:50 ` Richard Biener
2017-11-23 22:45 ` Christophe Lyon
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.20.1711220943240.12252@zhemvz.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).