--- old/src/hotspot/share/c1/c1_Instruction.cpp 2019-02-20 20:12:23.423538106 -0800 +++ new/src/hotspot/share/c1/c1_Instruction.cpp 2019-02-20 20:12:23.203530025 -0800 @@ -147,7 +147,7 @@ return false; } -bool Instruction::maybe_flattened_array() const { +bool Instruction::maybe_flattened_array() { if (ValueArrayFlatten) { ciType* type = declared_type(); if (type != NULL) { @@ -167,6 +167,10 @@ return true; } } + } else if (as_Phi() != NULL) { + // Type info gets lost during Phi merging, but we might be storing into a + // flattened array, so we should do a runtime check. + return true; } }