mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-03-06 06:29:57 +00:00
Don't do common subexpression elimination for indirect accesses where there is an intervening operation that may write to the same location.
This fixes the bug in the compca05.c test case.
This commit is contained in:
parent
3225a54d76
commit
b9446a28a7
16
DAG.pas
16
DAG.pas
@ -2546,6 +2546,22 @@ var
|
||||
kill := false;
|
||||
stop := true;
|
||||
end {if}
|
||||
{kill indirect accesses on stores}
|
||||
{to indirectly-accessible locations}
|
||||
else if op1^.opcode in [pc_sto,pc_cpi,pc_iil,pc_ili,pc_idl,pc_ild,
|
||||
pc_cup,pc_cui,pc_tl1,pc_ind] then begin
|
||||
if list^.opcode in [pc_sto,pc_cpi,pc_iil,pc_ili,pc_idl,pc_ild,
|
||||
pc_cup,pc_cui,pc_tl1] then begin
|
||||
kill := true;
|
||||
stop := true;
|
||||
end {if}
|
||||
else if list^.opcode in [pc_str,pc_sro,pc_cop,pc_cpo,pc_lli,
|
||||
pc_lil,pc_lld,pc_ldl,pc_gli,pc_gil,pc_gld,pc_gdl] then
|
||||
if Member(list, c_ind) then begin
|
||||
kill := true;
|
||||
stop := true;
|
||||
end {if}
|
||||
end {else if}
|
||||
else if list^.opcode in [pc_str,pc_sro,pc_cop,pc_cpo,pc_lli,pc_lil,
|
||||
pc_lld,pc_ldl,pc_gli,pc_gil,pc_gld,pc_gdl] then begin
|
||||
if MatchLoc(list, op2) then begin
|
||||
|
Loading…
x
Reference in New Issue
Block a user