+ apply excess precision also to unary minus nodes

* made excess precision really working

git-svn-id: trunk@48840 -
This commit is contained in:
florian 2021-02-28 10:52:11 +00:00
parent 8602a29383
commit 272a0e3e26
2 changed files with 16 additions and 4 deletions

View File

@ -1939,7 +1939,11 @@ implementation
not(tfloatdef(left.resultdef).floattype in [s64comp,s64currency]) then
begin
if cs_excessprecision in current_settings.localswitches then
resultrealdef:=pbestrealtype^
begin
resultrealdef:=pbestrealtype^;
inserttypeconv(right,resultrealdef);
inserttypeconv(left,resultrealdef);
end
else
resultrealdef:=left.resultdef
end

View File

@ -97,7 +97,7 @@ implementation
systems,
verbose,globals,cutils,compinnr,
globtype,constexp,
symconst,symtype,symdef,
symconst,symtype,symdef,symcpu,
defcmp,defutil,
htypechk,pass_1,
cgbase,
@ -966,10 +966,18 @@ implementation
exit;
resultdef:=left.resultdef;
if (left.resultdef.typ=floatdef) or
is_currency(left.resultdef) then
if is_currency(left.resultdef) then
begin
end
else if left.resultdef.typ=floatdef then
begin
if not(tfloatdef(left.resultdef).floattype in [s64comp,s64currency]) and
(cs_excessprecision in current_settings.localswitches) then
begin
inserttypeconv(left,pbestrealtype^);
resultdef:=left.resultdef
end;
end
{$ifdef SUPPORT_MMX}
else if (cs_mmx in current_settings.localswitches) and
is_mmx_able_array(left.resultdef) then