1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-09 16:29:09 +00:00

Fixed a bug

git-svn-id: svn://svn.cc65.org/cc65/trunk@1010 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2001-10-04 21:15:43 +00:00
parent 0c09cc7242
commit 9c4b9f19dc

View File

@ -909,12 +909,15 @@ unsigned OptStoreLoad (CodeSeg* S)
/* Check if it is a store instruction followed by a load from the
* same address which is itself not followed by a conditional branch.
*/
if ((E->Info & OF_STORE) != 0 &&
(N = CS_GetNextEntry (S, I)) != 0 &&
!CE_HasLabel (N) &&
(N->Info & OF_LOAD) != 0 &&
strcmp (E->Arg, N->Arg) == 0 &&
(X = CS_GetNextEntry (S, I+1)) != 0 &&
if ((E->Info & OF_STORE) != 0 &&
(N = CS_GetNextEntry (S, I)) != 0 &&
!CE_HasLabel (N) &&
(N->Info & OF_LOAD) != 0 &&
((E->OPC == OP65_STA && N->OPC == OP65_LDA) ||
(E->OPC == OP65_STX && N->OPC == OP65_LDX) ||
(E->OPC == OP65_STY && N->OPC == OP65_LDY)) &&
strcmp (E->Arg, N->Arg) == 0 &&
(X = CS_GetNextEntry (S, I+1)) != 0 &&
(X->Info & OF_FBRA) == 0) {
/* Register value is not used, remove the load */