This fixes another case of the SCEV cache containing references to released SSA names. This time it is the vectorizer releasing defs of OMP_SIMD uses. Instead of pluggin this hole like the others, sprinkling scev_reset[_htab] calls throughout passes, it plugs the holes in flush_ssaname_freelist which is called after each pass TODO and is used to flip the two SSA name freelists we have now.
I'm not sure maintaining SCEV info across passes is worth the trouble we're seeing, also given its implementation makes flushing info for a particular SSA name / loop expensive (and thus not implemented). But it's not the time to change this... Now, would you rather prefer sticking a scev_reset[_htab] into the vectorizer? Bootstrap / regtest running on x86_64-unknown-linux-gnu, ok? This fixes the reported FAIL: libgomp.fortran/examples-4/simd-2.f90 -O1 (internal compiler error) Thanks, Richard. 2018-01-29 Richard Biener <rguent...@suse.de> PR tree-optimization/84086 * tree-ssanames.c: Include cfgloop.h and tree-scalar-evolution.h. (flush_ssaname_freelist): When SSA names were released reset the SCEV hash table. Index: gcc/tree-ssanames.c =================================================================== --- gcc/tree-ssanames.c (revision 257139) +++ gcc/tree-ssanames.c (working copy) @@ -29,6 +29,8 @@ along with GCC; see the file COPYING3. #include "stor-layout.h" #include "tree-into-ssa.h" #include "tree-ssa.h" +#include "cfgloop.h" +#include "tree-scalar-evolution.h" /* Rewriting a function into SSA form can create a huge number of SSA_NAMEs, many of which may be thrown away shortly after their creation if jumps @@ -241,6 +243,9 @@ verify_ssaname_freelists (struct functio void flush_ssaname_freelist (void) { + /* If there were any SSA names released reset the SCEV cache. */ + if (! vec_safe_is_empty (FREE_SSANAMES_QUEUE (cfun))) + scev_reset_htab (); vec_safe_splice (FREE_SSANAMES (cfun), FREE_SSANAMES_QUEUE (cfun)); vec_safe_truncate (FREE_SSANAMES_QUEUE (cfun), 0); }