From: Richard Biener Date: Fri, 8 Jan 2021 13:37:09 +0000 (+0100) Subject: reset the SCEV htab after FRE in loop pipeline X-Git-Tag: basepoints/gcc-12~1706 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77a375a3ebf822914c19835ac690c67694c70bd0;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index 17016853a349..0ba846f0be2b 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)