From 3a64c5b9773e3d9230fa3106f031baa27d00898f Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Mon, 20 Mar 2023 17:56:44 -0500 Subject: [PATCH] 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). --- Gen.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gen.pas b/Gen.pas index 83dbc24..2421cca 100644 --- a/Gen.pas +++ b/Gen.pas @@ -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);