* src/SDCCcse.c (ReplaceOpWithCheaperOp): minor fix for debugging only
[fw/sdcc] / src / SDCCcse.c
index a2cc6ef0130079eafb106019b0a3caca65ba1ac0..e56c84a581551a5fe36ceee9f9654e18a225f3b7 100644 (file)
@@ -148,7 +148,7 @@ void ReplaceOpWithCheaperOp(operand **op, operand *cop) {
           IS_SYMOP((*op)) ? OP_SYMBOL((*op))->name : "!SYM",
           IS_SYMOP(cop) ? OP_SYMBOL(cop)->name : "!SYM");
   // if op is a register equivalent
-  if (IS_ITEMP(cop) && OP_SYMBOL((*op))->isreqv) {
+  if (IS_ITEMP(cop) && IS_SYMOP((*op)) && OP_SYMBOL((*op))->isreqv) {
     operand **rop = &OP_SYMBOL((*op))->usl.spillLoc->reqv;
     if (isOperandEqual(*rop, *op)) {
       printf ("true");