mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-12-22 07:30:54 +00:00
Fix bug where 32-bit addition and subtraction results are not saved in some cases.
This could happen in certain cases where the destination is not considered "simple" (e.g. because it is a local array location that does not fit in the direct page). The following program demonstrates the problem: #pragma optimize 1 int main(void) { long temp1 = 1, temp2 = 2, A[64]; long B[2] = {0}; B[1] = temp1 + temp2; return B[1]; /* should return 3 */ }
This commit is contained in:
parent
afe3e9586b
commit
ad31ecfcae
2
Gen.pas
2
Gen.pas
@ -609,7 +609,7 @@ else begin
|
|||||||
DoOp(0, m_sta_abs, m_sta_dir, save, 2);
|
DoOp(0, m_sta_abs, m_sta_dir, save, 2);
|
||||||
end; {else}
|
end; {else}
|
||||||
end {if}
|
end {if}
|
||||||
else if Simple(op^.right) then begin
|
else if (save = nil) and Simple(op^.right) then begin
|
||||||
gLong.preference := gLong.preference & A_X;
|
gLong.preference := gLong.preference & A_X;
|
||||||
GenTree(op^.left);
|
GenTree(op^.left);
|
||||||
GenImplied(clc);
|
GenImplied(clc);
|
||||||
|
Loading…
Reference in New Issue
Block a user