]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/113475 - fix memory leak in phi_analyzer
authorRichard Biener <rguenther@suse.de>
Thu, 18 Jan 2024 12:23:27 +0000 (13:23 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 18 Jan 2024 13:13:03 +0000 (14:13 +0100)
commit895a2138265fd9cace3588404523122f73626d2a
tree47e3097599c3ea22b85d94e8eb257ebbe5d9541a
parent5b421c2a5b429fcebd7ee6444a5677633df0f28a
tree-optimization/113475 - fix memory leak in phi_analyzer

phi_analyzer leaks all phi_group objects it allocates.  The following
fixes this by maintaining a vector of allocated objects and release
them when destroying the phi_analyzer object.

PR tree-optimization/113475
* gimple-range-phi.h (phi_analyzer::m_phi_groups): New.
* gimple-range-phi.cc (phi_analyzer::phi_analyzer): Initialize.
(phi_analyzer::~phi_analyzer): Deallocate and free collected
phi_grous.
(phi_analyzer::process_phi): Record allocated phi_groups.
gcc/gimple-range-phi.cc
gcc/gimple-range-phi.h