From: uz Date: Tue, 3 Jan 2012 19:40:00 +0000 (+0000) Subject: No need to simplify an expression in SegDone() if it is replaced by a constant X-Git-Tag: V2.13.3~93 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=be77192bcf1fde24525645b23ba4c15e6a44a117;p=cc65 No need to simplify an expression in SegDone() if it is replaced by a constant anyway. git-svn-id: svn://svn.cc65.org/cc65/trunk@5372 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ca65/segment.c b/src/ca65/segment.c index 00ac6234e..9bbccc024 100644 --- a/src/ca65/segment.c +++ b/src/ca65/segment.c @@ -295,7 +295,7 @@ void SegAlign (unsigned long Alignment, int FillVal) Error ("Combined alignment for active segment is %lu which exceeds %lu", CombinedAlignment, MAX_ALIGNMENT); - /* Avoid creating large fills for an object file that is thrown away + /* Avoid creating large fills for an object file that is thrown away * later. */ Count = 1; @@ -372,9 +372,6 @@ void SegDone (void) ED_Init (&ED); StudyExpr (F->V.Expr, &ED); - /* Try to simplify it before looking further */ - F->V.Expr = SimplifyExpr (F->V.Expr, &ED); - /* Check if the expression is constant */ if (ED_IsConst (&ED)) { @@ -408,7 +405,10 @@ void SegDone (void) } F->Type = FRAG_LITERAL; - } else if (ED.AddrSize != ADDR_SIZE_DEFAULT) { + } else { + + /* Simplify the expression */ + F->V.Expr = SimplifyExpr (F->V.Expr, &ED); /* We cannot evaluate the expression now, leave the job for * the linker. However, we can check if the address size