From f6c589bf8e7f4d56f6566ea57f92945b4d10c19f Mon Sep 17 00:00:00 2001 From: uz Date: Fri, 4 Sep 2009 15:44:48 +0000 Subject: [PATCH] Fixed problems with OptPrecalc. It removed insns because it results were known - but the insns generate a carry which may be needed later. git-svn-id: svn://svn.cc65.org/cc65/trunk@4115 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/coptind.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/cc65/coptind.c b/src/cc65/coptind.c index 63351677a..076e8fb73 100644 --- a/src/cc65/coptind.c +++ b/src/cc65/coptind.c @@ -1059,7 +1059,7 @@ unsigned OptDupLoads (CodeSeg* S) In->RegX == In->RegA && E->AM != AM65_ABSY && E->AM != AM65_ZPY) { - /* Use the A register instead */ + /* Use the A register instead */ CE_ReplaceOPC (E, OP65_STA); } break; @@ -1112,7 +1112,7 @@ unsigned OptDupLoads (CodeSeg* S) !CE_UseLoadFlags (N)) { /* Value is identical and not followed by a branch */ Delete = 1; - } + } break; case OP65_TAY: @@ -1880,9 +1880,7 @@ unsigned OptPrecalc (CodeSeg* S) } break; - case OP65_ASL: case OP65_EOR: - case OP65_LSR: if (RegValIsKnown (Out->RegA)) { /* Accu op zp with known contents */ Arg = MakeHexArg (Out->RegA); @@ -1901,9 +1899,6 @@ unsigned OptPrecalc (CodeSeg* S) /* 0-0 or 0+0 -> remove */ CS_DelEntry (S, I); ++Changes; - } else if (RegValIsKnown (Out->RegA)) { - /* Accu op zp with known contents */ - Arg = MakeHexArg (Out->RegA); } break; -- 2.39.5