From 3df88dc22cf28c4022776bcccaa57bd65e84450c Mon Sep 17 00:00:00 2001 From: Xin Liu Date: Wed, 20 May 2020 11:29:11 -0700 Subject: [PATCH] 8245051: c1 is broken if it is compiled by gcc without -fno-lifetime-dse Origin: https://github.com/openjdk/jdk11u/commit/3df88dc22cf28c4022776bcccaa57bd65e84450c Modified: File to patch has another location in JDK9 Initialize BlockBegin block id in constructor rather than operator new Reviewed-by: kbarrett, thartmann --- src/hotspot/share/c1/c1_Instruction.hpp | 8 +++----- src/hotspot/share/c1/c1_ValueMap.cpp | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/hotspot/share/c1/c1_Instruction.hpp b/src/hotspot/share/c1/c1_Instruction.hpp index 8b8f397995..a94a21e423 100644 --- a/src/hotspot/share/c1/c1_Instruction.hpp +++ b/src/hotspot/share/c1/c1_Instruction.hpp @@ -303,7 +303,6 @@ XHandlers* _exception_handlers; // Flat list of exception handlers covering this instruction friend class UseCountComputer; - friend class BlockBegin; void update_exception_state(ValueStack* state); @@ -349,7 +348,6 @@ void* operator new(size_t size) throw() { Compilation* c = Compilation::current(); void* res = c->arena()->Amalloc(size); - ((Instruction*)res)->_id = c->get_next_id(); return res; } @@ -410,7 +408,8 @@ // creation Instruction(ValueType* type, ValueStack* state_before = NULL, bool type_is_constant = false) - : _use_count(0) + : _id(Compilation::current()->get_next_id()) + , _use_count(0) #ifndef PRODUCT , _printable_bci(-99) #endif @@ -1648,8 +1647,6 @@ void* operator new(size_t size) throw() { Compilation* c = Compilation::current(); void* res = c->arena()->Amalloc(size); - ((BlockBegin*)res)->_id = c->get_next_id(); - ((BlockBegin*)res)->_block_id = c->get_next_block_id(); return res; } @@ -1661,6 +1658,7 @@ // creation BlockBegin(int bci) : StateSplit(illegalType) + , _block_id(Compilation::current()->get_next_block_id()) , _bci(bci) , _depth_first_number(-1) , _linear_scan_number(-1) diff --git a/src/hotspot/share/c1/c1_ValueMap.cpp b/src/hotspot/share/c1/c1_ValueMap.cpp index fd45abda2f..e7cafeb252 100644 --- a/src/hotspot/share/c1/c1_ValueMap.cpp +++ b/src/hotspot/share/c1/c1_ValueMap.cpp @@ -488,6 +488,7 @@ : _current_map(NULL) , _value_maps(ir->linear_scan_order()->length(), ir->linear_scan_order()->length(), NULL) , _compilation(ir->compilation()) + , _has_substitutions(false) { TRACE_VALUE_NUMBERING(tty->print_cr("****** start of global value numbering"));