From 59ae850db7c23477f259ec1bb4a66de62d0b1266 Mon Sep 17 00:00:00 2001 From: uz Date: Sun, 8 Jul 2012 13:05:57 +0000 Subject: [PATCH] Replacement in OptShift3 is even possible, when X is used later. git-svn-id: svn://svn.cc65.org/cc65/trunk@5773 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/coptshift.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cc65/coptshift.c b/src/cc65/coptshift.c index 4205783f9..7ec8155ea 100644 --- a/src/cc65/coptshift.c +++ b/src/cc65/coptshift.c @@ -381,7 +381,7 @@ unsigned OptShift3 (CodeSeg* S) * * ror a * - * if X is zero on entry and unused later. For shift counts > 1, more + * if X is zero on entry. For shift counts > 1, more * * shr a * @@ -413,9 +413,8 @@ unsigned OptShift3 (CodeSeg* S) L[2]->OPC == OP65_JSR && (Shift = GetShift (L[2]->Arg)) != SHIFT_NONE && SHIFT_DIR (Shift) == SHIFT_DIR_RIGHT && - (Count = SHIFT_COUNT (Shift)) > 0 && - !RegXUsed (S, I+3)) { - + (Count = SHIFT_COUNT (Shift)) > 0) { + /* Add the replacement insn instead */ CodeEntry* X = NewCodeEntry (OP65_ROR, AM65_ACC, "a", 0, L[2]->LI); CS_InsertEntry (S, X, I+3); -- 2.39.5