mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 13:49:39 +02:00
* Patch by J. Gareth "Kit" Moreton (issue #39343). Added missing allocation
of flags in tx86typeconvnode.second_int_to_bool and in generic
tcgtypeconvnode.second_int_to_bool. This fixes random failures of the
tcnvint1 test and some other tests when compiled with -O2.
(cherry picked from commit 940ac567a5
)
This commit is contained in:
parent
9433467ec8
commit
0b5951cf22
@ -234,11 +234,13 @@ interface
|
|||||||
cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_32,OS_32,left.location.reference,hregister);
|
cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_32,OS_32,left.location.reference,hregister);
|
||||||
href:=left.location.reference;
|
href:=left.location.reference;
|
||||||
inc(href.offset,4);
|
inc(href.offset,4);
|
||||||
|
cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
|
||||||
cg.a_op_ref_reg(current_asmdata.CurrAsmList,OP_OR,OS_32,href,hregister);
|
cg.a_op_ref_reg(current_asmdata.CurrAsmList,OP_OR,OS_32,href,hregister);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true);
|
hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true);
|
||||||
|
cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
|
||||||
cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_OR,left.location.size,left.location.register,left.location.register);
|
cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_OR,left.location.size,left.location.register,left.location.register);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -253,11 +255,13 @@ interface
|
|||||||
begin
|
begin
|
||||||
hregister:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);
|
hregister:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);
|
||||||
cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_32,OS_32,left.location.register64.reglo,hregister);
|
cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_32,OS_32,left.location.register64.reglo,hregister);
|
||||||
|
cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
|
||||||
cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_OR,OS_32,left.location.register64.reghi,hregister);
|
cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_OR,OS_32,left.location.register64.reghi,hregister);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
{$endif cpu64bitalu}
|
{$endif cpu64bitalu}
|
||||||
begin
|
begin
|
||||||
|
cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
|
||||||
cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_OR,left.location.size,left.location.register,left.location.register);
|
cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_OR,left.location.size,left.location.register,left.location.register);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -271,6 +275,7 @@ interface
|
|||||||
cg.a_label(current_asmdata.CurrAsmList,left.location.falselabel);
|
cg.a_label(current_asmdata.CurrAsmList,left.location.falselabel);
|
||||||
cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_INT,0,hregister);
|
cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_INT,0,hregister);
|
||||||
cg.a_label(current_asmdata.CurrAsmList,hlabel);
|
cg.a_label(current_asmdata.CurrAsmList,hlabel);
|
||||||
|
cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
|
||||||
cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_OR,OS_INT,hregister,hregister);
|
cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_OR,OS_INT,hregister,hregister);
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
|
@ -125,6 +125,7 @@ implementation
|
|||||||
LOC_CREFERENCE,
|
LOC_CREFERENCE,
|
||||||
LOC_REFERENCE :
|
LOC_REFERENCE :
|
||||||
begin
|
begin
|
||||||
|
cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
|
||||||
{$ifndef cpu64bitalu}
|
{$ifndef cpu64bitalu}
|
||||||
if left.location.size in [OS_64,OS_S64{$ifdef cpu16bitalu},OS_32,OS_S32{$endif}] then
|
if left.location.size in [OS_64,OS_S64{$ifdef cpu16bitalu},OS_32,OS_S32{$endif}] then
|
||||||
begin
|
begin
|
||||||
@ -150,6 +151,7 @@ implementation
|
|||||||
end;
|
end;
|
||||||
LOC_REGISTER,LOC_CREGISTER :
|
LOC_REGISTER,LOC_CREGISTER :
|
||||||
begin
|
begin
|
||||||
|
cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
|
||||||
{$if defined(cpu32bitalu)}
|
{$if defined(cpu32bitalu)}
|
||||||
if left.location.size in [OS_64,OS_S64] then
|
if left.location.size in [OS_64,OS_S64] then
|
||||||
begin
|
begin
|
||||||
@ -201,6 +203,7 @@ implementation
|
|||||||
begin
|
begin
|
||||||
hreg2:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);
|
hreg2:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);
|
||||||
cg.g_flags2reg(current_asmdata.CurrAsmList,OS_32,resflags,hreg2);
|
cg.g_flags2reg(current_asmdata.CurrAsmList,OS_32,resflags,hreg2);
|
||||||
|
cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
|
||||||
if (is_cbool(resultdef)) then
|
if (is_cbool(resultdef)) then
|
||||||
cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,OS_32,hreg2,hreg2);
|
cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,OS_32,hreg2,hreg2);
|
||||||
location.register64.reglo:=hreg2;
|
location.register64.reglo:=hreg2;
|
||||||
@ -217,6 +220,7 @@ implementation
|
|||||||
begin
|
begin
|
||||||
location.register:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
|
location.register:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
|
||||||
cg.g_flags2reg(current_asmdata.CurrAsmList,location.size,resflags,location.register);
|
cg.g_flags2reg(current_asmdata.CurrAsmList,location.size,resflags,location.register);
|
||||||
|
cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS);
|
||||||
if (is_cbool(resultdef)) then
|
if (is_cbool(resultdef)) then
|
||||||
cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,location.size,location.register,location.register);
|
cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NEG,location.size,location.register,location.register);
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user