From be77192bcf1fde24525645b23ba4c15e6a44a117 Mon Sep 17 00:00:00 2001 From: uz Date: Tue, 3 Jan 2012 19:40:00 +0000 Subject: [PATCH] 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 --- src/ca65/segment.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 -- 2.39.5