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
This commit is contained in:
uz 2012-01-03 19:40:00 +00:00
parent b16a12d260
commit be77192bcf

View file

@ -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