+ 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 not(tfloatdef(left.resultdef).floattype in [s64comp,s64currency]) then
begin begin
if cs_excessprecision in current_settings.localswitches then if cs_excessprecision in current_settings.localswitches then
resultrealdef:=pbestrealtype^ begin
resultrealdef:=pbestrealtype^;
inserttypeconv(right,resultrealdef);
inserttypeconv(left,resultrealdef);
end
else else
resultrealdef:=left.resultdef resultrealdef:=left.resultdef
end end

View File

@ -97,7 +97,7 @@ implementation
systems, systems,
verbose,globals,cutils,compinnr, verbose,globals,cutils,compinnr,
globtype,constexp, globtype,constexp,
symconst,symtype,symdef, symconst,symtype,symdef,symcpu,
defcmp,defutil, defcmp,defutil,
htypechk,pass_1, htypechk,pass_1,
cgbase, cgbase,
@ -966,10 +966,18 @@ implementation
exit; exit;
resultdef:=left.resultdef; resultdef:=left.resultdef;
if (left.resultdef.typ=floatdef) or if is_currency(left.resultdef) then
is_currency(left.resultdef) then
begin begin
end 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} {$ifdef SUPPORT_MMX}
else if (cs_mmx in current_settings.localswitches) and else if (cs_mmx in current_settings.localswitches) and
is_mmx_able_array(left.resultdef) then is_mmx_able_array(left.resultdef) then