Fixed a bug

git-svn-id: svn://svn.cc65.org/cc65/trunk@1350 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2002-07-12 08:45:42 +00:00
parent 8c7f650621
commit 7c9bf720d8
2 changed files with 8 additions and 12 deletions

View File

@@ -875,7 +875,7 @@ unsigned OptDupLoads (CodeSeg* S)
*/ */
if (In->RegY >= 0 && /* Value of Y is known */ if (In->RegY >= 0 && /* Value of Y is known */
E->AM == AM65_ZP && /* Store into zp */ E->AM == AM65_ZP && /* Store into zp */
In->RegX == RegVal (E->Chg, In)) { /* Value identical */ In->RegY == RegVal (E->Chg, In)) { /* Value identical */
Delete = 1; Delete = 1;

View File

@@ -223,14 +223,12 @@ unsigned assignadjust (type* lhst, ExprDesc* rhs)
} else if (!IsClassInt (rhst)) { } else if (!IsClassInt (rhst)) {
Error ("Incompatible types"); Error ("Incompatible types");
} else { } else {
/* Adjust the int types. To avoid manipulation of TOS mark lhs /* Convert the rhs to the type of the lhs. */
* as const.
*/
unsigned flags = TypeOf (rhst); unsigned flags = TypeOf (rhst);
if (rhs->Flags == E_MCONST) { if (rhs->Flags == E_MCONST) {
flags |= CF_CONST; flags |= CF_CONST;
} }
return g_typeadjust (TypeOf (lhst) | CF_CONST, flags); return g_typecast (TypeOf (lhst), flags);
} }
} else if (IsClassPtr (lhst)) { } else if (IsClassPtr (lhst)) {
if (IsClassPtr (rhst)) { if (IsClassPtr (rhst)) {
@@ -2947,10 +2945,8 @@ static void addsubeq (const GenDesc* Gen, ExprDesc *lval, int k)
lflags |= TypeOf (lval->Type) | CF_FORCECHAR; lflags |= TypeOf (lval->Type) | CF_FORCECHAR;
rflags |= TypeOf (lval2.Type); rflags |= TypeOf (lval2.Type);
/* Adjust the rhs to the lhs. To avoid manipulation of the TOS, mark /* Cast the rhs to the type of the lhs */
* the lhs as const. g_typecast (lflags, rflags);
*/
g_typeadjust (lflags | CF_CONST, rflags);
/* Output apropriate code */ /* Output apropriate code */
if (lval->Flags & E_MGLOBAL) { if (lval->Flags & E_MGLOBAL) {