forwarded_bytes was allocated with sbitmap_alloc but never freed on any
of the function's return paths. Use auto_sbitmap instead, which calls
sbitmap_free in its destructor.
gcc/ChangeLog:
* avoid-store-forwarding.cc
(store_forwarding_analyzer::process_store_forwarding): Use
auto_sbitmap for forwarded_bytes to ensure it is freed on all
return paths.
Reviewed-By: Konstantinos Eleftheriou <[email protected]>
---
gcc/avoid-store-forwarding.cc | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/gcc/avoid-store-forwarding.cc b/gcc/avoid-store-forwarding.cc
index 33446beb0091..f9c43a2ec460 100644
--- a/gcc/avoid-store-forwarding.cc
+++ b/gcc/avoid-store-forwarding.cc
@@ -176,9 +176,7 @@ process_store_forwarding (vec<store_fwd_info> &stores,
rtx_insn *load_insn,
We can also eliminate stores on addresses that are overwritten
by later stores. */
- sbitmap forwarded_bytes = sbitmap_alloc (load_size);
- bitmap_clear (forwarded_bytes);
-
+ auto_sbitmap forwarded_bytes (load_size);
unsigned int i;
store_fwd_info* it;
auto_vec<store_fwd_info> redundant_stores;
--
2.34.1