Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
/ jdk17 Public archive

Commit

Permalink
8269771: assert(tmp == _callprojs.fallthrough_catchproj) failed: allo…
Browse files Browse the repository at this point in the history
…cation control projection

Reviewed-by: rbackman, kvn
  • Loading branch information
Nils Eliasson committed Jul 2, 2021
1 parent 5644c4f commit 7bc96db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/hotspot/share/opto/macro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,9 @@ void PhaseMacroExpand::process_users_of_allocation(CallNode *alloc) {
if (ctrl_proj != NULL) {
_igvn.replace_node(ctrl_proj, init->in(TypeFunc::Control));
#ifdef ASSERT
// If the InitializeNode has no memory out, it will die, and tmp will become NULL
Node* tmp = init->in(TypeFunc::Control);
assert(tmp == _callprojs.fallthrough_catchproj, "allocation control projection");
assert(tmp == NULL || tmp == _callprojs.fallthrough_catchproj, "allocation control projection");
#endif
}
Node *mem_proj = init->proj_out_or_null(TypeFunc::Memory);
Expand Down
11 changes: 8 additions & 3 deletions src/hotspot/share/opto/memnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3313,7 +3313,8 @@ MemBarNode* MemBarNode::make(Compile* C, int opcode, int atp, Node* pn) {

void MemBarNode::remove(PhaseIterGVN *igvn) {
if (outcnt() != 2) {
return;
assert(Opcode() == Op_Initialize, "Only seen when there are no use of init memory");
assert(outcnt() == 1, "Only control then");
}
if (trailing_store() || trailing_load_store()) {
MemBarNode* leading = leading_membar();
Expand All @@ -3322,8 +3323,12 @@ void MemBarNode::remove(PhaseIterGVN *igvn) {
leading->remove(igvn);
}
}
igvn->replace_node(proj_out(TypeFunc::Memory), in(TypeFunc::Memory));
igvn->replace_node(proj_out(TypeFunc::Control), in(TypeFunc::Control));
if (proj_out_or_null(TypeFunc::Memory) != NULL) {
igvn->replace_node(proj_out(TypeFunc::Memory), in(TypeFunc::Memory));
}
if (proj_out_or_null(TypeFunc::Control) != NULL) {
igvn->replace_node(proj_out(TypeFunc::Control), in(TypeFunc::Control));
}
}

//------------------------------Ideal------------------------------------------
Expand Down

1 comment on commit 7bc96db

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.