Skip to content

Commit 8277649

Browse files
eme64pull[bot]
authored andcommitted
8318889: C2: add bailout after assert Bad graph detected in build_loop_late
Reviewed-by: shade, thartmann
1 parent 5fc7329 commit 8277649

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/hotspot/share/opto/loopnode.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4459,6 +4459,7 @@ void PhaseIdealLoop::build_and_optimize() {
44594459
NOT_PRODUCT( C->verify_graph_edges(); )
44604460
worklist.push(C->top());
44614461
build_loop_late( visited, worklist, nstack );
4462+
if (C->failing()) { return; }
44624463

44634464
if (_verify_only) {
44644465
C->restore_major_progress(old_progress);
@@ -5991,6 +5992,7 @@ void PhaseIdealLoop::build_loop_late( VectorSet &visited, Node_List &worklist, N
59915992
} else {
59925993
// All of n's children have been processed, complete post-processing.
59935994
build_loop_late_post(n);
5995+
if (C->failing()) { return; }
59945996
if (nstack.is_empty()) {
59955997
// Finished all nodes on stack.
59965998
// Process next node on the worklist.
@@ -6137,13 +6139,15 @@ void PhaseIdealLoop::build_loop_late_post_work(Node *n, bool pinned) {
61376139
Node *legal = LCA; // Walk 'legal' up the IDOM chain
61386140
Node *least = legal; // Best legal position so far
61396141
while( early != legal ) { // While not at earliest legal
6140-
#ifdef ASSERT
61416142
if (legal->is_Start() && !early->is_Root()) {
6143+
#ifdef ASSERT
61426144
// Bad graph. Print idom path and fail.
61436145
dump_bad_graph("Bad graph detected in build_loop_late", n, early, LCA);
61446146
assert(false, "Bad graph detected in build_loop_late");
6145-
}
61466147
#endif
6148+
C->record_method_not_compilable("Bad graph detected in build_loop_late");
6149+
return;
6150+
}
61476151
// Find least loop nesting depth
61486152
legal = idom(legal); // Bump up the IDOM tree
61496153
// Check for lower nesting depth

0 commit comments

Comments
 (0)