summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--src/stm8/peep.c2
-rw-r--r--src/z80/gen.c5
3 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 0a3c3d90c..f0b405ada 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,10 @@
support/regression/tests/bug-3355.c,
support/valdiag/tests/constantRange.c:
Fix bug #3355.
+ * src/z80/gen.c:
+ Fix another aspect of bug #3852.
+ * src/stm8/peep.c:
+ Fix bug #3278.
2025-08-08 Philipp Klaus Krause <philipp@colecovision.eu>
diff --git a/src/stm8/peep.c b/src/stm8/peep.c
index 0bc8debcf..9e69e907f 100644
--- a/src/stm8/peep.c
+++ b/src/stm8/peep.c
@@ -366,7 +366,7 @@ stm8instructionSize(lineNode *pl)
int i = 0;
wassert (op1start);
- if(!strcmp(op1start, "a") || !strcmp(op1start, "(x)"))
+ if(!STRCASECMP(op1start, "a") || !STRCASECMP(op1start, "(x)"))
return(1);
if(!strcmp(op1start, "(y)"))
return(2);
diff --git a/src/z80/gen.c b/src/z80/gen.c
index 188357e2c..36d63ab29 100644
--- a/src/z80/gen.c
+++ b/src/z80/gen.c
@@ -7938,7 +7938,8 @@ setupToPreserveCarry (asmop *result, asmop *left, asmop *right)
}
else if (couldDestroyCarry (result))
{
- shiftIntoPair (PAIR_HL, result);
+ if (!requiresHL (left))
+ shiftIntoPair (PAIR_HL, result);
}
}
}
@@ -8331,7 +8332,7 @@ genPlus (iCode * ic)
if (couldDestroyCarry (IC_RESULT (ic)->aop) &&
(IC_RESULT (ic)->aop == leftop || IC_RESULT (ic)->aop == rightop))
shiftIntoPair (PAIR_HL, IC_RESULT (ic)->aop);
- else if (couldDestroyCarry (rightop))
+ else if (couldDestroyCarry (rightop) && !requiresHL (leftop))
shiftIntoPair (PAIR_HL, rightop);
}