diff --git a/compiler/ncgld.pas b/compiler/ncgld.pas index f7d690ef4f..8b8fa8bf12 100644 --- a/compiler/ncgld.pas +++ b/compiler/ncgld.pas @@ -567,6 +567,7 @@ implementation otlabel,hlabel,oflabel : tasmlabel; href : treference; releaseright : boolean; + alignmentrequirement, len : aint; r : tregister; oldflowcontrol : tflowcontrol; @@ -777,13 +778,17 @@ implementation { TODO: HACK: unaligned test, maybe remove all unaligned locations (array of char) from the compiler} { Use unaligned copy when the offset is not aligned } len:=left.resultdef.size; - if (right.location.reference.offset mod sizeof(aint)<>0) or - (left.location.reference.offset mod sizeof(aint)<>0) or - (right.resultdef.alignment0) or + (left.location.reference.offset mod alignmentrequirement<>0) or + (right.resultdef.alignment0) and - (right.location.reference.alignment0) and - (left.location.reference.alignment