From 7bfa8b37da8d22eb907994c08006e6aafd755e2e Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 13 Nov 2025 13:53:43 +0100 Subject: [PATCH] Fix memory leak in pass_x86_cse The following makes sure to delete the loads we previously allocated with new. gcc/ * config/i386/i386-features.cc (pass_x86_cse::x86_cse): Delete loads. --- gcc/config/i386/i386-features.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/config/i386/i386-features.cc b/gcc/config/i386/i386-features.cc index 8e277843f23..f1f118d5b75 100644 --- a/gcc/config/i386/i386-features.cc +++ b/gcc/config/i386/i386-features.cc @@ -4810,6 +4810,9 @@ pass_x86_cse::x86_cse (void) df_process_deferred_rescans (); } + FOR_EACH_VEC_ELT (loads, i, load) + delete load; + df_clear_flags (DF_DEFER_INSN_RESCAN); timevar_pop (TV_MACH_DEP); -- 2.47.3