re PR libgomp/84086 ([8 Regresssion] segfault in instantiate_scev_r for libgomp.fortr...
authorRichard Biener <rguenther@suse.de>
Mon, 29 Jan 2018 15:22:55 +0000 (15:22 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 29 Jan 2018 15:22:55 +0000 (15:22 +0000)
2018-01-29  Richard Biener  <rguenther@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.

From-SVN: r257152

gcc/ChangeLog
gcc/tree-ssanames.c

index ac75869a3e5d8b6085201406457f76f0556d1f46..e860055a445307c3057484b1842e55d5b4b0c75f 100644 (file)
@@ -1,3 +1,10 @@
+2018-01-29  Richard Biener  <rguenther@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.
+
 2018-01-29  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/84057
index dffaa17a2d2a62c62c54de9acc9edd1962a07245..6cce43be593fcb3b64a98a357eca36e0fbd2a614 100644 (file)
@@ -29,6 +29,8 @@ along with GCC; see the file COPYING3.  If not see
 #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 function *fun)
 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);
 }