mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-06-07 03:29:29 +00:00
Fix optimizer bug that could limit certain address calculations to a 32k or 64k range even when using the large memory model.
This optimization could apply when indexing into an array whose elements are a power-of-2 size using a 16-bit index value. It is now only used when addressing arrays on the stack (which are necessarily smaller than 64k). The following program demonstrates the problem: #pragma optimize 1 #pragma memorymodel 1 long c[40000]; int main(void) { int i = 30000; c[30000] = 3; return c[i]; /* should return 3 */ }
This commit is contained in:
parent
e780043007
commit
730544a6ce
1
DAG.pas
1
DAG.pas
|
@ -806,6 +806,7 @@ case op^.opcode of {check for optimizations of this node}
|
|||
if op^.right^.left^.opcode = pc_cnv then begin
|
||||
fromtype.i := (op^.right^.left^.q & $00F0) >> 4;
|
||||
if fromType.optype in [cgByte,cgUByte,cgWord,cgUWord] then
|
||||
if op^.left^.opcode = pc_lda then
|
||||
begin
|
||||
if fromType.optype = cgByte then
|
||||
op^.right^.left^.q := $02
|
||||
|
|
Loading…
Reference in New Issue
Block a user