8245051: c1 is broken if it is compiled by gcc without -fno-lifetime-dse

Initialize BlockBegin block id in constructor rather than operator new

Reviewed-by: kbarrett, thartmann
This commit is contained in:
Xin Liu 2020-05-20 11:29:11 -07:00
parent 58adc04d69
commit 612c38cdc9
2 changed files with 3 additions and 5 deletions

View File

@ -303,7 +303,6 @@ class Instruction: public CompilationResourceObj {
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 @@ class Instruction: public CompilationResourceObj {
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,7 @@ class Instruction: public CompilationResourceObj {
// creation
Instruction(ValueType* type, ValueStack* state_before = NULL, bool type_is_constant = false)
:
: _id(Compilation::current()->get_next_id()),
#ifndef PRODUCT
_printable_bci(-99),
#endif
@ -1651,8 +1649,6 @@ LEAF(BlockBegin, StateSplit)
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;
}
@ -1664,6 +1660,7 @@ LEAF(BlockBegin, StateSplit)
// creation
BlockBegin(int bci)
: StateSplit(illegalType)
, _block_id(Compilation::current()->get_next_block_id())
, _bci(bci)
, _depth_first_number(-1)
, _linear_scan_number(-1)

View File

@ -488,6 +488,7 @@ GlobalValueNumbering::GlobalValueNumbering(IR* ir)
: _compilation(ir->compilation())
, _current_map(NULL)
, _value_maps(ir->linear_scan_order()->length(), ir->linear_scan_order()->length(), NULL)
, _has_substitutions(false)
{
TRACE_VALUE_NUMBERING(tty->print_cr("****** start of global value numbering"));