The forwarded_bytes sbitmap needs to be zeroed after allocation,
as sbitmaps are not implicitly initialized.  This caused valgrind
warnings about conditional jumps depending on uninitialised values.

gcc/ChangeLog:

        PR rtl-optimization/124351
        * avoid-store-forwarding.cc (process_store_forwarding): Add
        bitmap_clear after allocating forwarded_bytes.
---
 gcc/avoid-store-forwarding.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/avoid-store-forwarding.cc b/gcc/avoid-store-forwarding.cc
index f9c43a2ec460..75ba30a62eb5 100644
--- a/gcc/avoid-store-forwarding.cc
+++ b/gcc/avoid-store-forwarding.cc
@@ -177,6 +177,8 @@ process_store_forwarding (vec<store_fwd_info> &stores, 
rtx_insn *load_insn,
      by later stores.  */
 
   auto_sbitmap forwarded_bytes (load_size);
+  bitmap_clear (forwarded_bytes);
+
   unsigned int i;
   store_fwd_info* it;
   auto_vec<store_fwd_info> redundant_stores;
-- 
2.34.1

Reply via email to