mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-04-14 04:37:06 +00:00
Generate better code when accessing structs and unions within other structures.
This cuts a few instructions from code like what is shown in commit affbe9. (It also works around the bug with that example, although that patch addresses the root cause of the problem.)
This commit is contained in:
parent
efb23003f7
commit
88279484af
9
DAG.pas
9
DAG.pas
@ -1431,6 +1431,15 @@ case op^.opcode of {check for optimizations of this node}
|
||||
op^.left^.optype := op^.optype;
|
||||
op^.left^.q := op^.left^.q + op^.q;
|
||||
opv := op^.left;
|
||||
end {else if}
|
||||
else if opcode = pc_inc then begin
|
||||
if op^.left^.optype = cgULong then begin
|
||||
if ord4(op^.left^.q) + ord4(op^.q) < ord4(maxint - 1) then begin
|
||||
op^.q := op^.q + op^.left^.q;
|
||||
op^.left := op^.left^.left;
|
||||
PeepHoleOptimization(opv);
|
||||
end; {if}
|
||||
end; {if}
|
||||
end; {else if}
|
||||
end; {case pc_ind}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user