mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-18 05:01:42 +02:00
* fixed calculation of fpu resources
git-svn-id: trunk@8779 -
This commit is contained in:
parent
96eaeeaf98
commit
f66916fc95
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8482,6 +8482,7 @@ tests/webtbs/tw9827.pp svneol=native#text/plain
|
||||
tests/webtbs/tw9894.pp svneol=native#text/plain
|
||||
tests/webtbs/tw9894a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw9897.pp svneol=native#text/plain
|
||||
tests/webtbs/tw9919.pp -text
|
||||
tests/webtbs/ub1873.pp svneol=native#text/plain
|
||||
tests/webtbs/ub1883.pp svneol=native#text/plain
|
||||
tests/webtbs/uw0555.pp svneol=native#text/plain
|
||||
|
@ -718,26 +718,23 @@ implementation
|
||||
res1:=0;
|
||||
res2:=0;
|
||||
res3:=0;
|
||||
if p.inheritsfrom(ttertiarynode) and assigned(ttertiarynode(p).third) then
|
||||
res3:=node_resources_fpu(ttertiarynode(p).third)
|
||||
else if p.inheritsfrom(tbinarynode) and assigned(tbinarynode(p).right) then
|
||||
res2:=node_resources_fpu(tbinarynode(p).right)
|
||||
else
|
||||
if p.inheritsfrom(tunarynode) and assigned(tunarynode(p).left) then
|
||||
res1:=node_resources_fpu(tunarynode(p).left);
|
||||
if p.inheritsfrom(tunarynode) then
|
||||
begin
|
||||
if assigned(tunarynode(p).left) then
|
||||
res1:=node_resources_fpu(tunarynode(p).left);
|
||||
if p.inheritsfrom(tbinarynode) then
|
||||
begin
|
||||
if assigned(tbinarynode(p).right) then
|
||||
res2:=node_resources_fpu(tbinarynode(p).right);
|
||||
if p.inheritsfrom(ttertiarynode) and assigned(ttertiarynode(p).third) then
|
||||
res3:=node_resources_fpu(ttertiarynode(p).third)
|
||||
end;
|
||||
end;
|
||||
result:=max(max(res1,res2),res3);
|
||||
case p.nodetype of
|
||||
calln:
|
||||
begin
|
||||
{$ifdef i386}
|
||||
if tcallnode(p).procdefinition.typ=procdef then
|
||||
result:=max(result,tprocdef(tcallnode(p).procdefinition).fpu_used)
|
||||
else
|
||||
result:=maxfpuregs;
|
||||
{$else i386}
|
||||
result:=maxfpuregs;
|
||||
{$endif i386}
|
||||
end;
|
||||
{ it could be a recursive call, so we never really know the number of used fpu registers }
|
||||
result:=maxfpuregs;
|
||||
realconstn,
|
||||
typeconvn,
|
||||
loadn :
|
||||
|
21
tests/webtbs/tw9919.pp
Normal file
21
tests/webtbs/tw9919.pp
Normal file
@ -0,0 +1,21 @@
|
||||
type
|
||||
TForm1 = class
|
||||
function crash(n:integer):real;
|
||||
end;
|
||||
|
||||
function TForm1.crash(n:integer):real;
|
||||
begin
|
||||
case n of
|
||||
0: Result:=0;
|
||||
1..100: Result:=crash(n-1)+crash(n-1);
|
||||
end;
|
||||
end;
|
||||
|
||||
var
|
||||
f : TForm1;
|
||||
|
||||
begin
|
||||
f:=TForm1.create;
|
||||
writeln(f.crash(15));
|
||||
f.Free;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user