From 9144002b3b59049f48f46c402302e719a640b39d Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sat, 28 Oct 2017 22:41:33 -0500 Subject: [PATCH] Don't remove bitfield stores during loop invariant removal. This could generate bad code (e.g. invalidly moving stores ahead of loads, as in #44). It would be possible to do this validly in some cases, but it would take more work to do the necessary checks. For now, we'll just block the optimization for bitfield stores. In combination with the previous commit, this fixes #44. --- DAG.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DAG.pas b/DAG.pas index 88777e0..8edb5fc 100644 --- a/DAG.pas +++ b/DAG.pas @@ -4044,7 +4044,7 @@ var pc_grt,pc_les,pc_geq,pc_leq,pc_inc,pc_ior,pc_lor, pc_ixa,pc_lad,pc_lao,pc_lca,pc_lda,pc_ldc,pc_mod,pc_uim, pc_mdl,pc_ulm,pc_mpi,pc_umi,pc_mpl,pc_uml,pc_mpr,pc_ngi, - pc_ngl,pc_ngr,pc_not,pc_pop,pc_sbf,pc_sbi,pc_sbl,pc_sbr, + pc_ngl,pc_ngr,pc_not,pc_pop,pc_sbi,pc_sbl,pc_sbr, pc_shl,pc_sll,pc_shr,pc_usr,pc_slr,pc_vsr,pc_tri] then begin op^.parents := icount; @@ -4064,7 +4064,7 @@ var end; {if} end {else if} else if opcode - in [pc_sro,pc_sto,pc_str,pc_cop,pc_cpo,pc_cpi,pc_cbf] + in [pc_sro,pc_sto,pc_str,pc_cop,pc_cpo,pc_cpi] then begin if not inhibit then if not IndirectInhibit(op) then