* Xtensa: reduce stack usage

git-svn-id: trunk@44492 -
This commit is contained in:
florian 2020-04-01 20:08:20 +00:00
parent a630f93c7b
commit b41c8342c8
2 changed files with 10 additions and 16 deletions

View File

@ -633,8 +633,11 @@ implementation
end
else
begin
{ spill area }
inc(localsize,max(txtensaprocinfo(current_procinfo).maxcall,4)*4);
{ default spill area }
inc(localsize,4*4);
{ additional spill area? }
if pi_do_call in current_procinfo.flags then
inc(localsize,txtensaprocinfo(current_procinfo).maxcall*4);
localsize:=align(localsize,current_settings.alignment.localalignmax);
end;

View File

@ -65,7 +65,7 @@ unit cpupi;
constructor txtensaprocinfo.create(aparent: tprocinfo);
begin
inherited create(aparent);
maxpushedparasize := 0;
maxpushedparasize:=0;
if target_info.abi=abi_xtensa_windowed then
begin
callins:=A_CALL8;
@ -92,23 +92,15 @@ unit cpupi;
localsize : aint;
i : longint;
begin
if (po_nostackframe in procdef.procoptions) then
begin
{ maxpushedparasize sghould be zero,
if not we will get an error later. }
tg.setfirsttemp(maxpushedparasize);
exit;
end;
tg.setfirsttemp(maxpushedparasize);
if tg.direction = -1 then
tg.setfirsttemp(-(1+12)*4)
else
tg.setfirsttemp(maxpushedparasize);
if po_nostackframe in procdef.procoptions then
exit;
{ estimate stack frame size }
if pi_estimatestacksize in flags then
begin
stackframesize:=maxpushedparasize+32;
stackframesize:=maxpushedparasize;
localsize:=0;
for i:=0 to procdef.localst.SymList.Count-1 do
if tsym(procdef.localst.SymList[i]).typ=localvarsym then
@ -126,7 +118,6 @@ unit cpupi;
else
inc(localsize,tabstractnormalvarsym(procdef.parast.SymList[i]).getsize);
end;
inc(stackframesize,localsize);
if pi_needs_implicit_finally in flags then