https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103449

--- Comment #2 from Martin Jambor <jamborm at gcc dot gnu.org> ---
The second "Invalid read of size 8" can be avoided with the following
(untested but correct):

diff --git a/gcc/ipa-param-manipulation.c b/gcc/ipa-param-manipulation.c
index 479c20b3871..ff65dad0971 100644
--- a/gcc/ipa-param-manipulation.c
+++ b/gcc/ipa-param-manipulation.c
@@ -1280,8 +1280,9 @@ ipa_param_body_adjustments::prepare_debug_expressions
(tree dead_ssa)
          && TREE_CODE (gimple_assign_rhs1 (def)) == SSA_NAME)
        {
          tree *d = m_dead_ssa_debug_equiv.get (gimple_assign_rhs1 (def));
+         gcc_assert (*d);
          m_dead_ssa_debug_equiv.put (dead_ssa, *d);
-         return (*d != NULL_TREE);
+         return true;
        }

       tree val


But the first one, at least at this point, is somewhat a mystery to
me.  It happens within the m_dead_ssa_debug_equiv.put() just before
the return... and, if I understand the valgrind output well, it seems
that inside that hash_map<tree, tree> its m_table.find_slot_with_hash
returned a pointer to a memory the same m_table released before?

Reply via email to