Skip to content
Permalink
Browse files
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 5fedfa707e8d48ff8c18e68b3ab1538838f64bdf
Showing with 7 additions and 1 deletion.
  1. +2 −0 src/hotspot/share/opto/compile.cpp
  2. +5 −1 src/hotspot/share/opto/phaseX.cpp
@@ -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
@@ -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
@@ -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.
@@ -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) {

1 comment on commit 5fedfa7

@bridgekeeper

This comment has been minimized.

Copy link

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

Please sign in to comment.