From 5c3d388aee5609d32bd8e3ba1add776b1a6f0d1f Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Wed, 3 Feb 2021 10:23:06 -0700 Subject: [PATCH] PR tree-optimization/98937 - pointer_query cache leaks 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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c index c6f74051607..8912a113de9 100644 --- a/gcc/tree-ssa-strlen.c +++ b/gcc/tree-ssa-strlen.c @@ -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. */ -- 2.30.2