From d0e0b98b4372e80c37005199c23d8b425bf763d7 Mon Sep 17 00:00:00 2001
From: Oliver Schmidt
Date: Sat, 27 Jun 2015 01:09:20 +0200
Subject: [PATCH] Revert "Equality problem (Ullrich von Bassewitz)".
Uz classifies his own fix as broken:
http://www.cc65.org/mailarchive/2015-01/11721.html
Although the original issue fixed seemed rather significant looking
back now the regression caused by the (broken) fix seems even more
significant :-(
(reverted from commit 55815ea10cfa3a779b44399f99dd0cf1cb4956f2)
======================================================================
Equality problem (Ullrich von Bassewitz)
Neil Stockbridge reported a problem with equality comparisons on
cc65.org's mailing list:
http://www.cc65.org/mailarchive/2014-10/11680.html
Uz provided a fix for it:
http://www.cc65.org/mailarchive/2014-10/11683.html
This pull request ask to add the fix to cc65 on github.
---
src/cc65/coptstop.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/src/cc65/coptstop.c b/src/cc65/coptstop.c
index 427d0bd13..cf6392bd3 100644
--- a/src/cc65/coptstop.c
+++ b/src/cc65/coptstop.c
@@ -766,12 +766,8 @@ static unsigned Opt_toseqax_tosneax (StackOpData* D, const char* BoolTransformer
InsertEntry (D, X, D->IP++);
/* Lhs load entries can be removed */
- if (LoadX->AM != AM65_IMM) {
- D->Lhs.X.Flags |= LI_REMOVE;
- }
- if (LoadA->AM != AM65_IMM) {
- D->Lhs.A.Flags |= LI_REMOVE;
- }
+ D->Lhs.X.Flags |= LI_REMOVE;
+ D->Lhs.A.Flags |= LI_REMOVE;
} else if ((D->Rhs.A.Flags & (LI_DIRECT | LI_RELOAD_Y)) == LI_DIRECT &&
(D->Rhs.X.Flags & (LI_DIRECT | LI_RELOAD_Y)) == LI_DIRECT) {
@@ -794,12 +790,8 @@ static unsigned Opt_toseqax_tosneax (StackOpData* D, const char* BoolTransformer
InsertEntry (D, X, D->IP++);
/* Rhs load entries can be removed */
- if (LoadX->AM != AM65_IMM) {
- D->Rhs.X.Flags |= LI_REMOVE;
- }
- if (LoadA->AM != AM65_IMM) {
- D->Rhs.A.Flags |= LI_REMOVE;
- }
+ D->Rhs.X.Flags |= LI_REMOVE;
+ D->Rhs.A.Flags |= LI_REMOVE;
} else if ((D->Rhs.A.Flags & LI_DIRECT) != 0 &&
(D->Rhs.X.Flags & LI_DIRECT) != 0) {
--
2.39.5