diff --git a/compiler/cgutils.pas b/compiler/cgutils.pas index 85bc188b33..99b931fa3d 100644 --- a/compiler/cgutils.pas +++ b/compiler/cgutils.pas @@ -139,6 +139,9 @@ unit cgutils; { allocate room for parameters on the stack in the entry code? } function use_fixed_stack: boolean; + { returns r with the given alignment } + function setalignment(const r : treference;b : byte) : treference; + implementation uses @@ -179,6 +182,13 @@ uses end; + { returns r with the given alignment } + function setalignment(const r : treference;b : byte) : treference; + begin + result:=r; + result.alignment:=b; + end; + {**************************************************************************** TLocation ****************************************************************************} diff --git a/compiler/ncgld.pas b/compiler/ncgld.pas index 687e4a8696..2f6b846a31 100644 --- a/compiler/ncgld.pas +++ b/compiler/ncgld.pas @@ -613,10 +613,10 @@ implementation begin if (target_info.endian = endian_little) then cg.a_load_const_ref(current_asmdata.CurrAsmList,OS_16,(tordconstnode(right).value.svalue shl 8) or 1, - left.location.reference) + setalignment(left.location.reference,1)) else cg.a_load_const_ref(current_asmdata.CurrAsmList,OS_16,tordconstnode(right).value.svalue or (1 shl 8), - left.location.reference); + setalignment(left.location.reference,1)); end else begin