Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8251271: C2: Compile::_for_igvn list is corrupted after RenumberLiveN…
…odes

Reviewed-by: vlivanov, thartmann
  • Loading branch information
nhat-nguyen authored and TobiHartmann committed Oct 20, 2020
1 parent 98ec4a6 commit 5fedfa7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/hotspot/share/opto/compile.cpp
Expand Up @@ -2120,9 +2120,11 @@ void Compile::Optimize() {
ResourceMark rm;
PhaseRenumberLive prl = PhaseRenumberLive(initial_gvn(), for_igvn(), &new_worklist);
}
Unique_Node_List* save_for_igvn = for_igvn();
set_for_igvn(&new_worklist);
igvn = PhaseIterGVN(initial_gvn());
igvn.optimize();
set_for_igvn(save_for_igvn);
}

// Perform escape analysis
Expand Down
6 changes: 5 additions & 1 deletion src/hotspot/share/opto/phaseX.cpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -439,6 +439,7 @@ PhaseRemoveUseless::PhaseRemoveUseless(PhaseGVN* gvn, Unique_Node_List* worklist
// The PhaseRenumberLive phase updates two data structures with the new node IDs.
// (1) The worklist is used by the PhaseIterGVN phase to identify nodes that must be
// processed. A new worklist (with the updated node IDs) is returned in 'new_worklist'.
// 'worklist' is cleared upon returning.
// (2) Type information (the field PhaseGVN::_types) maps type information to each
// node ID. The mapping is updated to use the new node IDs as well. Updated type
// information is returned in PhaseGVN::_types.
Expand Down Expand Up @@ -510,6 +511,9 @@ PhaseRenumberLive::PhaseRenumberLive(PhaseGVN* gvn,

// Set the dead node count to 0 and reset dead node list.
C->reset_dead_node_list();

// Clear the original worklist
worklist->clear();
}

int PhaseRenumberLive::new_index(int old_idx) {
Expand Down

1 comment on commit 5fedfa7

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 5fedfa7 Oct 20, 2020

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.