mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
avoid-store-forwarding: Fix sbitmap memory leak in process_store_forwarding
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 <konstantinos.eleftheriou@vrull.eu>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user