* CallRet2* optimization may not misalign the stack, reported by C Western on fpc-devel

git-svn-id: trunk@44253 -
This commit is contained in:
florian 2020-03-01 09:37:09 +00:00
parent ac974c9ab7
commit 34be9e4643

View File

@ -176,6 +176,7 @@ unit aoptx86;
uses uses
cutils,verbose, cutils,verbose,
systems,
globals, globals,
cpuinfo, cpuinfo,
procinfo, procinfo,
@ -5902,7 +5903,9 @@ unit aoptx86;
MatchInstruction(hp1,A_RET,[S_NO]) and MatchInstruction(hp1,A_RET,[S_NO]) and
(taicpu(hp1).ops=0) then (taicpu(hp1).ops=0) then
begin begin
if cs_opt_level4 in current_settings.optimizerswitches then if (cs_opt_level4 in current_settings.optimizerswitches) and
{ we might destroy stack alignment here if we do not do a call }
(target_info.stackalign<=sizeof(SizeUInt)) then
begin begin
taicpu(p).opcode := A_JMP; taicpu(p).opcode := A_JMP;
taicpu(p).is_jmp := true; taicpu(p).is_jmp := true;