PR tree-optimization/98937 - pointer_query cache leaks
authorMartin Sebor <msebor@redhat.com>
Wed, 3 Feb 2021 17:23:06 +0000 (10:23 -0700)
committerMartin Sebor <msebor@redhat.com>
Wed, 3 Feb 2021 17:23:53 +0000 (10:23 -0700)
gcc/ChangeLog:

PR tree-optimization/98937
* tree-ssa-strlen.c (strlen_dom_walker::~strlen_dom_walker): Define.
Flush pointer_query cache.

gcc/tree-ssa-strlen.c

index c6f740516076582132e826f343f7904b919c3c94..8912a113de9d5e465805b2b5969851d1a43662e7 100644 (file)
@@ -5491,6 +5491,8 @@ public:
     m_cleanup_cfg (false)
   { }
 
+  ~strlen_dom_walker ();
+
   virtual edge before_dom_children (basic_block);
   virtual void after_dom_children (basic_block);
 
@@ -5508,6 +5510,13 @@ public:
   bool m_cleanup_cfg;
 };
 
+/* Release pointer_query cache.  */
+
+strlen_dom_walker::~strlen_dom_walker ()
+{
+  ptr_qry.flush_cache ();
+}
+
 /* Callback for walk_dominator_tree.  Attempt to optimize various
    string ops by remembering string lengths pointed by pointer SSA_NAMEs.  */