From cedde45f9cca66f2cb4fbc15d270e5f862b4e81d Mon Sep 17 00:00:00 2001 From: gaoxiang90 Date: Tue, 29 Oct 2024 15:18:52 +0800 Subject: [PATCH] Backport JDK-8327963: incorrect result of C2 compiled code --- ...3-incorrect-result-of-C2-compiled-code.patch | 17 +++++++++++++++++ openjdk-21.spec | 7 ++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 Backport-JDK-8327963-incorrect-result-of-C2-compiled-code.patch diff --git a/Backport-JDK-8327963-incorrect-result-of-C2-compiled-code.patch b/Backport-JDK-8327963-incorrect-result-of-C2-compiled-code.patch new file mode 100644 index 0000000..be41fbe --- /dev/null +++ b/Backport-JDK-8327963-incorrect-result-of-C2-compiled-code.patch @@ -0,0 +1,17 @@ +diff --git a/src/hotspot/share/opto/macro.cpp b/src/hotspot/share/opto/macro.cpp +index f6d9fcc6b..6a4e5ab0f 100644 +--- a/src/hotspot/share/opto/macro.cpp ++++ b/src/hotspot/share/opto/macro.cpp +@@ -1234,7 +1234,11 @@ void PhaseMacroExpand::expand_allocate_common( + if (!allocation_has_use) { + InitializeNode* init = alloc->initialization(); + if (init != nullptr) { +- init->remove(&_igvn); ++ MemBarCPUOrderNode* membar = new MemBarCPUOrderNode(C, C->get_alias_index(init->adr_type()), nullptr); ++ membar->init_req(TypeFunc::Control, init->in(TypeFunc::Control)); ++ membar->init_req(TypeFunc::Memory, init->in(TypeFunc::Memory)); ++ transform_later(membar); ++ _igvn.replace_node(init, membar); + } + if (expand_fast_path && (initial_slow_test == nullptr)) { + // Remove allocation node and return. diff --git a/openjdk-21.spec b/openjdk-21.spec index e757922..da259de 100644 --- a/openjdk-21.spec +++ b/openjdk-21.spec @@ -897,7 +897,7 @@ Name: java-21-%{origin} Version: %{newjavaver}.%{buildver} # This package needs `.rolling` as part of Release so as to not conflict on install with # java-X-openjdk. I.e. when latest rolling release is also an LTS release packaged as -Release: 0 +Release: 1 # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons # and this change was brought into RHEL-4. java-1.5.0-ibm packages @@ -1025,6 +1025,7 @@ Patch73: Backport-JDK-8325730-StringBuilder.toString-allocati.patch Patch74: Backport-JDK-8337679-Memset-warning-in-src-hotspot-s.patch Patch75: Backport-JDK-8326957-Implement-JEP-474-ZGC-Generatio.patch Patch76: Backport-JDK-8320308-C2-compilation-crashes-in-Libra.patch +Patch77: Backport-JDK-8327963-incorrect-result-of-C2-compiled-code.patch ############################################ # # LoongArch64 specific patches @@ -1312,6 +1313,7 @@ pushd %{top_level_dir_name} %patch74 -p1 %patch75 -p1 %patch76 -p1 +%patch77 -p1 popd # openjdk %endif @@ -1872,6 +1874,9 @@ cjc.mainProgram(args) -- the returns from copy_jdk_configs.lua should not affect %changelog +* Tue Oct 29 2024 gaoxiang - 1:21.0.5.11-1 +- add Backport-JDK-8327963-incorrect-result-of-C2-compiled-code.patch + * Wed Oct 16 2024 huangjie - 1:21.0.5.11-0 - update to jdk21.0.5-ga - delete Backport-JDK-8333462-Performance-regression-of-new-D.patch -- Gitee