Generate better code for stack array indexing in large memory model.

Any stack-allocated array must be < 32KB, so we can use the same approach as in the small memory model to compute indexes for it (which is considerably more efficient than the large-memory-model code).
This commit is contained in:
Stephen Heumann 2023-03-20 17:56:44 -05:00
parent be291b2423
commit 3a64c5b977
1 changed files with 2 additions and 2 deletions

View File

@ -3394,7 +3394,7 @@ var
begin {GenIxa}
if smallMemoryModel then begin
if smallMemoryModel or (op^.left^.opcode = pc_lda) then begin
lLong := gLong;
gLong.preference := inPointer+localAddress+globalLabel;
GenTree(op^.left);
@ -3599,7 +3599,7 @@ if smallMemoryModel then begin
otherwise:
Error(cge1);
end; {case}
end {if smallMemoryModel}
end {if smallMemoryModel or (op^.left^.opcode = pc_lda)}
else begin
gLong.preference := onStack;
GenTree(op^.left);