--- old/src/share/vm/opto/memnode.cpp 2015-09-16 10:30:34.456196540 +0200 +++ new/src/share/vm/opto/memnode.cpp 2015-09-16 10:30:34.158133719 +0200 @@ -2363,6 +2363,16 @@ return NO_HASH; } +#ifdef ASSERT +static bool maybe_unaligned_store(Node* n) { + StoreNode* st = n->as_Store(); + return st->Opcode() == Op_StoreL || + st->Opcode() == Op_StoreI || + st->Opcode() == Op_StoreB || + st->Opcode() == Op_StoreC; +} +#endif + //------------------------------Ideal------------------------------------------ // Change back-to-back Store(, p, x) -> Store(m, p, y) to Store(m, p, x). // When a store immediately follows a relevant allocation/initialization, @@ -2393,7 +2403,8 @@ st->Opcode() == Op_StoreVector || Opcode() == Op_StoreVector || phase->C->get_alias_index(adr_type()) == Compile::AliasIdxRaw || - (Opcode() == Op_StoreL && st->Opcode() == Op_StoreI), // expanded ClearArrayNode + (Opcode() == Op_StoreL && st->Opcode() == Op_StoreI) || // expanded ClearArrayNode + (UseUnalignedAccesses && (maybe_unaligned_store(st) || maybe_unaligned_store(this))), err_msg_res("no mismatched stores, except on raw memory: %s %s", NodeClassNames[Opcode()], NodeClassNames[st->Opcode()])); if (st->in(MemNode::Address)->eqv_uncast(address) &&