public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] reset the SCEV htab after FRE in loop pipeline
Date: Fri, 8 Jan 2021 14:40:10 +0100 (CET)	[thread overview]
Message-ID: <nycvar.YFH.7.76.2101081439590.25438@elmra.sevgm.obk> (raw)

When running FRE in the loop pipeline (as part of the conditionally
scheduled scalar cleanups) we have to reset the SCEV hashtable as
otherwise we can end up with stale entries and all sorts of problems.

Catched by my out-of-tree verifier for this problem.

Bootstrap & regtest pending on x86_64-unknown-linux-gnu.

2021-01-08  Richard Biener  <rguenther@suse.de>

	* tree-ssa-sccvn.c (pass_fre::execute): Reset the SCEV hash table.
---
 gcc/tree-ssa-sccvn.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 17016853a34..0ba846f0be2 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -7883,6 +7883,9 @@ pass_fre::execute (function *fun)
   if (iterate_p)
     loop_optimizer_finalize ();
 
+  if (scev_initialized_p ())
+    scev_reset_htab ();
+
   /* For late FRE after IVOPTs and unrolling, see if we can
      remove some TREE_ADDRESSABLE and rewrite stuff into SSA.  */
   if (!may_iterate)
-- 
2.26.2

                 reply	other threads:[~2021-01-08 13:40 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=nycvar.YFH.7.76.2101081439590.25438@elmra.sevgm.obk \
    --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).