Skip to content

Commit 7bc96db

Browse files
author
Nils Eliasson
committedJul 2, 2021
8269771: assert(tmp == _callprojs.fallthrough_catchproj) failed: allocation control projection
Reviewed-by: rbackman, kvn
1 parent 5644c4f commit 7bc96db

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed
 

‎src/hotspot/share/opto/macro.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -965,8 +965,9 @@ void PhaseMacroExpand::process_users_of_allocation(CallNode *alloc) {
965965
if (ctrl_proj != NULL) {
966966
_igvn.replace_node(ctrl_proj, init->in(TypeFunc::Control));
967967
#ifdef ASSERT
968+
// If the InitializeNode has no memory out, it will die, and tmp will become NULL
968969
Node* tmp = init->in(TypeFunc::Control);
969-
assert(tmp == _callprojs.fallthrough_catchproj, "allocation control projection");
970+
assert(tmp == NULL || tmp == _callprojs.fallthrough_catchproj, "allocation control projection");
970971
#endif
971972
}
972973
Node *mem_proj = init->proj_out_or_null(TypeFunc::Memory);

‎src/hotspot/share/opto/memnode.cpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -3313,7 +3313,8 @@ MemBarNode* MemBarNode::make(Compile* C, int opcode, int atp, Node* pn) {
33133313

33143314
void MemBarNode::remove(PhaseIterGVN *igvn) {
33153315
if (outcnt() != 2) {
3316-
return;
3316+
assert(Opcode() == Op_Initialize, "Only seen when there are no use of init memory");
3317+
assert(outcnt() == 1, "Only control then");
33173318
}
33183319
if (trailing_store() || trailing_load_store()) {
33193320
MemBarNode* leading = leading_membar();
@@ -3322,8 +3323,12 @@ void MemBarNode::remove(PhaseIterGVN *igvn) {
33223323
leading->remove(igvn);
33233324
}
33243325
}
3325-
igvn->replace_node(proj_out(TypeFunc::Memory), in(TypeFunc::Memory));
3326-
igvn->replace_node(proj_out(TypeFunc::Control), in(TypeFunc::Control));
3326+
if (proj_out_or_null(TypeFunc::Memory) != NULL) {
3327+
igvn->replace_node(proj_out(TypeFunc::Memory), in(TypeFunc::Memory));
3328+
}
3329+
if (proj_out_or_null(TypeFunc::Control) != NULL) {
3330+
igvn->replace_node(proj_out(TypeFunc::Control), in(TypeFunc::Control));
3331+
}
33273332
}
33283333

33293334
//------------------------------Ideal------------------------------------------

0 commit comments

Comments
 (0)
Please sign in to comment.