From 27d5f5c237910bc3d2df62367d2e0a83c1132885 Mon Sep 17 00:00:00 2001 From: Denghui Dong Date: Thu, 4 Jan 2024 13:11:47 +0000 Subject: [PATCH] 8322781: C1: Debug build crash in GraphBuilder::vmap() when print stats Reviewed-by: kvn, thartmann, shade --- src/hotspot/share/c1/c1_GraphBuilder.cpp | 4 +++- .../jtreg/compiler/arguments/TestC1Globals.java | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/c1/c1_GraphBuilder.cpp b/src/hotspot/share/c1/c1_GraphBuilder.cpp index edf6f29478c..fb2aa28ec86 100644 --- a/src/hotspot/share/c1/c1_GraphBuilder.cpp +++ b/src/hotspot/share/c1/c1_GraphBuilder.cpp @@ -4468,7 +4468,9 @@ void GraphBuilder::append_unsafe_get_and_set(ciMethod* callee, bool is_add) { #ifndef PRODUCT void GraphBuilder::print_stats() { - vmap()->print(); + if (UseLocalValueNumbering) { + vmap()->print(); + } } #endif // PRODUCT diff --git a/test/hotspot/jtreg/compiler/arguments/TestC1Globals.java b/test/hotspot/jtreg/compiler/arguments/TestC1Globals.java index ff639a69bd9..3944b78bc27 100644 --- a/test/hotspot/jtreg/compiler/arguments/TestC1Globals.java +++ b/test/hotspot/jtreg/compiler/arguments/TestC1Globals.java @@ -57,6 +57,17 @@ * */ +/** + * @test + * @bug 8322781 + * @requires vm.debug + * @summary Test flag with c1 value numbering + * + * @run main/othervm -XX:+PrintValueNumbering -XX:+Verbose -XX:-UseLocalValueNumbering + * -Xcomp -XX:TieredStopAtLevel=1 + * compiler.arguments.TestC1Globals + */ + package compiler.arguments; public class TestC1Globals {