From a98b9e7cfa433d4bf2acbf59a1c9d3714c3c065d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Maillard?= Date: Tue, 4 Nov 2025 09:42:18 +0000 Subject: [PATCH] 8362832: compiler/macronodes/TestTopInMacroElimination.java hits assert(false) failed: unexpected node Reviewed-by: dlunden, epeter, kvn --- src/hotspot/share/opto/macro.cpp | 5 +++++ test/hotspot/jtreg/ProblemList-jvmti-stress-agent.txt | 3 --- .../jtreg/compiler/macronodes/TestTopInMacroElimination.java | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/opto/macro.cpp b/src/hotspot/share/opto/macro.cpp index ce33f0bec82..702aca592f3 100644 --- a/src/hotspot/share/opto/macro.cpp +++ b/src/hotspot/share/opto/macro.cpp @@ -501,6 +501,11 @@ Node *PhaseMacroExpand::value_from_mem(Node *sfpt_mem, Node *sfpt_ctl, BasicType } } else if (mem->is_ArrayCopy()) { done = true; + } else if (mem->is_top()) { + // The slice is on a dead path. Returning nullptr would lead to elimination + // bailout, but we want to prevent that. Just forwarding the top is also legal, + // and IGVN can just clean things up, and remove whatever receives top. + return mem; } else { DEBUG_ONLY( mem->dump(); ) assert(false, "unexpected node"); diff --git a/test/hotspot/jtreg/ProblemList-jvmti-stress-agent.txt b/test/hotspot/jtreg/ProblemList-jvmti-stress-agent.txt index 636d02cb8b0..1e6c0c735a9 100644 --- a/test/hotspot/jtreg/ProblemList-jvmti-stress-agent.txt +++ b/test/hotspot/jtreg/ProblemList-jvmti-stress-agent.txt @@ -27,9 +27,6 @@ # ############################################################################# - -compiler/macronodes/TestTopInMacroElimination.java 8362832 generic-all - gc/stringdedup/TestStringDeduplicationAgeThreshold.java 8362562 generic-all gc/stringdedup/TestStringDeduplicationInterned.java 8362562 generic-all gc/stringdedup/TestStringDeduplicationPrintOptions.java 8362562 generic-all diff --git a/test/hotspot/jtreg/compiler/macronodes/TestTopInMacroElimination.java b/test/hotspot/jtreg/compiler/macronodes/TestTopInMacroElimination.java index 86ff4e9b874..c57eb78c6a1 100644 --- a/test/hotspot/jtreg/compiler/macronodes/TestTopInMacroElimination.java +++ b/test/hotspot/jtreg/compiler/macronodes/TestTopInMacroElimination.java @@ -23,7 +23,7 @@ /* * @test - * @bug 8325030 + * @bug 8325030 8362832 * @summary Regression test for an assert triggered during allocation elimination because top is found during * constructing new phis. * @run main/othervm -XX:-ProfileExceptionHandlers compiler.macronodes.TestTopInMacroElimination