# HG changeset patch # User mdoerr # Date 1457969500 -3600 # Node ID ae668d937109d1a3b26041fe1196451e8af03fbb # Parent dc073ee24dc637c0333e45d50092c05818062169 8151818: C1: LIRGenerator::move_to_phi can't deal with illegal phi Reviewed-by: diff --git a/src/share/vm/c1/c1_LIRGenerator.cpp b/src/share/vm/c1/c1_LIRGenerator.cpp --- a/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/src/share/vm/c1/c1_LIRGenerator.cpp @@ -999,8 +999,16 @@ Phi* phi = sux_val->as_Phi(); // cur_val can be null without phi being null in conjunction with inlining if (phi != NULL && cur_val != NULL && cur_val != phi && !phi->is_illegal()) { + Phi* cur_phi = cur_val->as_Phi(); + if (cur_phi != NULL && cur_phi->is_illegal()) { + // Phi and local would need to get invalidated + // (which is unexpected for Linear Scan). + // But this case is very rare so we simply bail out. + bailout("propagation of illegal phi"); + return; + } LIR_Opr operand = cur_val->operand(); - if (cur_val->operand()->is_illegal()) { + if (operand->is_illegal()) { assert(cur_val->as_Constant() != NULL || cur_val->as_Local() != NULL, "these can be produced lazily"); operand = operand_for_instruction(cur_val); diff --git a/src/share/vm/c1/c1_ValueStack.hpp b/src/share/vm/c1/c1_ValueStack.hpp --- a/src/share/vm/c1/c1_ValueStack.hpp +++ b/src/share/vm/c1/c1_ValueStack.hpp @@ -99,14 +99,14 @@ void clear_locals(); // sets all locals to NULL; void invalidate_local(int i) { - assert(_locals.at(i)->type()->is_single_word() || + assert(!_locals.at(i)->type()->is_double_word() || _locals.at(i + 1) == NULL, "hi-word of doubleword value must be NULL"); _locals.at_put(i, NULL); } Value local_at(int i) const { Value x = _locals.at(i); - assert(x == NULL || x->type()->is_single_word() || + assert(x == NULL || !x->type()->is_double_word() || _locals.at(i + 1) == NULL, "hi-word of doubleword value must be NULL"); return x; } @@ -131,7 +131,7 @@ // stack access Value stack_at(int i) const { Value x = _stack.at(i); - assert(x->type()->is_single_word() || + assert(!x->type()->is_double_word() || _stack.at(i + 1) == NULL, "hi-word of doubleword value must be NULL"); return x; }