diff --git a/src/mono/mono/mini/memory-access.c b/src/mono/mono/mini/memory-access.c index ceae7a3decf630..cf4f75fc8e506e 100644 --- a/src/mono/mono/mini/memory-access.c +++ b/src/mono/mono/mini/memory-access.c @@ -481,6 +481,7 @@ mini_emit_memory_load (MonoCompile *cfg, MonoType *type, MonoInst *src, int offs /* LLVM can handle unaligned loads and stores, so there's no reason to * manually decompose an unaligned load here into a memcpy if we're * using LLVM. */ +#ifdef NO_UNALIGNED_ACCESS if ((ins_flag & MONO_INST_UNALIGNED) && !COMPILE_LLVM (cfg)) { MonoInst *addr, *tmp_var; int align; @@ -498,9 +499,10 @@ mini_emit_memory_load (MonoCompile *cfg, MonoType *type, MonoInst *src, int offs mini_emit_memcpy_const_size (cfg, addr, src, size, 1); EMIT_NEW_TEMPLOAD (cfg, ins, tmp_var->inst_c0); - } else { + } else +#endif EMIT_NEW_LOAD_MEMBASE_TYPE (cfg, ins, type, src->dreg, offset); - } + ins->flags |= ins_flag; if (ins_flag & MONO_INST_VOLATILE) { @@ -524,6 +526,7 @@ mini_emit_memory_store (MonoCompile *cfg, MonoType *type, MonoInst *dest, MonoIn if (!(ins_flag & MONO_INST_NONULLCHECK)) MONO_EMIT_NULL_CHECK (cfg, dest->dreg, FALSE); +#ifdef NO_UNALIGNED_ACCESS if ((ins_flag & MONO_INST_UNALIGNED) && !COMPILE_LLVM (cfg)) { MonoInst *addr, *mov, *tmp_var; @@ -531,7 +534,9 @@ mini_emit_memory_store (MonoCompile *cfg, MonoType *type, MonoInst *dest, MonoIn EMIT_NEW_TEMPSTORE (cfg, mov, tmp_var->inst_c0, value); EMIT_NEW_VARLOADA (cfg, addr, tmp_var, tmp_var->inst_vtype); mini_emit_memory_copy_internal (cfg, dest, addr, mono_class_from_mono_type_internal (type), 1, FALSE, (ins_flag & MONO_INST_STACK_STORE) != 0); - } else { + } else +#endif + { MonoInst *ins; /* FIXME: should check item at sp [1] is compatible with the type of the store. */