Skip to content

Commit 5fedfa7

Browse files
nhat-nguyenTobiHartmann
authored andcommitted
8251271: C2: Compile::_for_igvn list is corrupted after RenumberLiveNodes
Reviewed-by: vlivanov, thartmann
1 parent 98ec4a6 commit 5fedfa7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/hotspot/share/opto/compile.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -2120,9 +2120,11 @@ void Compile::Optimize() {
21202120
ResourceMark rm;
21212121
PhaseRenumberLive prl = PhaseRenumberLive(initial_gvn(), for_igvn(), &new_worklist);
21222122
}
2123+
Unique_Node_List* save_for_igvn = for_igvn();
21232124
set_for_igvn(&new_worklist);
21242125
igvn = PhaseIterGVN(initial_gvn());
21252126
igvn.optimize();
2127+
set_for_igvn(save_for_igvn);
21262128
}
21272129

21282130
// Perform escape analysis

src/hotspot/share/opto/phaseX.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* 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
439439
// The PhaseRenumberLive phase updates two data structures with the new node IDs.
440440
// (1) The worklist is used by the PhaseIterGVN phase to identify nodes that must be
441441
// processed. A new worklist (with the updated node IDs) is returned in 'new_worklist'.
442+
// 'worklist' is cleared upon returning.
442443
// (2) Type information (the field PhaseGVN::_types) maps type information to each
443444
// node ID. The mapping is updated to use the new node IDs as well. Updated type
444445
// information is returned in PhaseGVN::_types.
@@ -510,6 +511,9 @@ PhaseRenumberLive::PhaseRenumberLive(PhaseGVN* gvn,
510511

511512
// Set the dead node count to 0 and reset dead node list.
512513
C->reset_dead_node_list();
514+
515+
// Clear the original worklist
516+
worklist->clear();
513517
}
514518

515519
int PhaseRenumberLive::new_index(int old_idx) {

0 commit comments

Comments
 (0)