From 77a375a3ebf822914c19835ac690c67694c70bd0 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 8 Jan 2021 14:37:09 +0100 Subject: [PATCH] reset the SCEV htab after FRE in loop pipeline 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. 2021-01-08 Richard Biener * 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.30.2