* fixed sign extension for unaligned loads (mantis #29891, although that

code shouldn't use unaligned loads in the first place)

git-svn-id: trunk@33382 -
This commit is contained in:
Jonas Maebe 2016-03-29 14:52:27 +00:00
parent 322493c195
commit a5dba44fd3
3 changed files with 36 additions and 3 deletions

1
.gitattributes vendored
View File

@ -14994,6 +14994,7 @@ tests/webtbs/tw2983.pp svneol=native#text/plain
tests/webtbs/tw2984.pp svneol=native#text/plain
tests/webtbs/tw29893.pp svneol=native#text/pascal
tests/webtbs/tw29912.pp svneol=native#text/plain
tests/webtbs/tw29923.pp svneol=native#text/plain
tests/webtbs/tw2998.pp svneol=native#text/plain
tests/webtbs/tw2999.pp svneol=native#text/plain
tests/webtbs/tw3004.pp svneol=native#text/plain

View File

@ -1323,7 +1323,7 @@ implementation
tmpreg2:=makeregsize(list,register,OS_16);
a_load_ref_reg(list,OS_8,OS_16,tmpref,tmpreg2);
a_op_reg_reg(list,OP_OR,OS_16,tmpreg,tmpreg2);
a_load_reg_reg(list,OS_16,tosize,tmpreg2,register);
a_load_reg_reg(list,fromsize,tosize,tmpreg2,register);
end;
OS_32,OS_S32:
if ref.alignment=2 then
@ -1340,7 +1340,7 @@ implementation
tmpreg2:=makeregsize(list,register,OS_32);
a_load_ref_reg(list,OS_16,OS_32,tmpref,tmpreg2);
a_op_reg_reg(list,OP_OR,OS_32,tmpreg,tmpreg2);
a_load_reg_reg(list,OS_32,tosize,tmpreg2,register);
a_load_reg_reg(list,fromsize,tosize,tmpreg2,register);
end
else
begin
@ -1359,7 +1359,7 @@ implementation
a_load_ref_reg(list,OS_8,OS_32,tmpref,tmpreg2);
a_op_reg_reg(list,OP_OR,OS_32,tmpreg2,tmpreg);
end;
a_load_reg_reg(list,OS_32,tosize,tmpreg,register);
a_load_reg_reg(list,fromsize,tosize,tmpreg,register);
end
else
a_load_ref_reg(list,fromsize,tosize,tmpref,register);

32
tests/webtbs/tw29923.pp Normal file
View File

@ -0,0 +1,32 @@
{$mode objfpc}
{$r+}
type
tc = class
f: longint;
procedure test;
end;
procedure tc.test;
procedure nest;
var
l1: longint;
begin
f:=-1;
l1:=-1;
dec(f,l1*120);
end;
begin
nest;
end;
var
c: tc;
begin
c:=tc.create;
c.test;
c.free;
end.