From: Lauri Kasanen Date: Sun, 7 May 2017 17:31:41 +0000 (+0300) Subject: Update comments and location checks according to Greg X-Git-Tag: V2.17~147^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a2f61c667ab49cd99632cbd958ef79057d80ac77;p=cc65 Update comments and location checks according to Greg --- diff --git a/src/cc65/expr.c b/src/cc65/expr.c index e5c1a17b9..e87b02ffc 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -1534,8 +1534,8 @@ static void PostInc (ExprDesc* Expr) /* Get the data type */ Flags = TypeOf (Expr->Type); - /* Fast path: char */ - if ((Flags & CF_CHAR) == CF_CHAR && ED_GetLoc(Expr) & (E_LOC_GLOBAL | E_LOC_STATIC)) { + /* Emit smaller code if a char variable is at a constant location */ + if ((Flags & CF_CHAR) == CF_CHAR && ED_IsLocConst(Expr)) { LoadExpr (CF_NONE, Expr); AddCodeLine ("inc %s", ED_GetLabelName(Expr, 0)); @@ -1590,8 +1590,8 @@ static void PostDec (ExprDesc* Expr) /* Get the data type */ Flags = TypeOf (Expr->Type); - /* Fast path: char */ - if ((Flags & CF_CHAR) == CF_CHAR && ED_GetLoc(Expr) & (E_LOC_GLOBAL | E_LOC_STATIC)) { + /* Emit smaller code if a char variable is at a constant location */ + if ((Flags & CF_CHAR) == CF_CHAR && ED_IsLocConst(Expr)) { LoadExpr (CF_NONE, Expr); AddCodeLine ("dec %s", ED_GetLabelName(Expr, 0));