@@ -481,6 +481,7 @@ mini_emit_memory_load (MonoCompile *cfg, MonoType *type, MonoInst *src, int offs
481481/* LLVM can handle unaligned loads and stores, so there's no reason to
482482 * manually decompose an unaligned load here into a memcpy if we're
483483 * using LLVM. */
484+ #ifdef NO_UNALIGNED_ACCESS
484485if ((ins_flag & MONO_INST_UNALIGNED )&& !COMPILE_LLVM (cfg )) {
485486MonoInst * addr ,* tmp_var ;
486487int align ;
@@ -498,9 +499,10 @@ mini_emit_memory_load (MonoCompile *cfg, MonoType *type, MonoInst *src, int offs
498499
499500mini_emit_memcpy_const_size (cfg ,addr ,src ,size ,1 );
500501EMIT_NEW_TEMPLOAD (cfg ,ins ,tmp_var -> inst_c0 );
501- }else {
502+ }else
503+ #endif
502504EMIT_NEW_LOAD_MEMBASE_TYPE (cfg ,ins ,type ,src -> dreg ,offset );
503- }
505+
504506ins -> flags |=ins_flag ;
505507
506508if (ins_flag & MONO_INST_VOLATILE ) {
@@ -524,14 +526,17 @@ mini_emit_memory_store (MonoCompile *cfg, MonoType *type, MonoInst *dest, MonoIn
524526if (!(ins_flag & MONO_INST_NONULLCHECK ))
525527MONO_EMIT_NULL_CHECK (cfg ,dest -> dreg , FALSE);
526528
529+ #ifdef NO_UNALIGNED_ACCESS
527530if ((ins_flag & MONO_INST_UNALIGNED )&& !COMPILE_LLVM (cfg )) {
528531MonoInst * addr ,* mov ,* tmp_var ;
529532
530533tmp_var = mono_compile_create_var (cfg ,type ,OP_LOCAL );
531534EMIT_NEW_TEMPSTORE (cfg ,mov ,tmp_var -> inst_c0 ,value );
532535EMIT_NEW_VARLOADA (cfg ,addr ,tmp_var ,tmp_var -> inst_vtype );
533536mini_emit_memory_copy_internal (cfg ,dest ,addr ,mono_class_from_mono_type_internal (type ),1 , FALSE, (ins_flag & MONO_INST_STACK_STORE )!= 0 );
534- }else {
537+ }else
538+ #endif
539+ {
535540MonoInst * ins ;
536541
537542/* FIXME: should check item at sp [1] is compatible with the type of the store. */