From 7cbab1f39636f3cf32f1276bc46feaa8107a14e6 Mon Sep 17 00:00:00 2001 From: Eric Nothum Date: Thu, 27 Jul 2023 07:29:23 +0000 Subject: [PATCH] 8312218: Print additional debug information when hitting assert(in_hash) Reviewed-by: chagedorn, thartmann --- src/hotspot/share/opto/compile.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index 218f7a91119..e2976f629c6 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -4889,7 +4889,16 @@ void Compile::remove_speculative_types(PhaseIterGVN &igvn) { const Type* t_no_spec = t->remove_speculative(); if (t_no_spec != t) { bool in_hash = igvn.hash_delete(n); - assert(in_hash, "node should be in igvn hash table"); +#ifdef ASSERT + if (!in_hash) { + tty->print_cr("current graph:"); + n->dump_bfs(MaxNodeLimit, nullptr, "S$"); + tty->cr(); + tty->print_cr("erroneous node:"); + n->dump(); + assert(false, "node should be in igvn hash table"); + } +#endif tn->set_type(t_no_spec); igvn.hash_insert(n); igvn._worklist.push(n); // give it a chance to go away