X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCicode.c;h=2792ef48ee309608fca56056e07328998647937c;hb=4d406d0af5861a351d089724c5f3e6d1ee8f70d4;hp=3a24fbd4a6ab0a298f42f9a6c3401742f329514a;hpb=24b38610695ad1df39fb34e5e63be583035e2e21;p=fw%2Fsdcc diff --git a/src/SDCCicode.c b/src/SDCCicode.c index 3a24fbd4..2792ef48 100644 --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -500,7 +500,7 @@ printiCChain (iCode * icChain, FILE * of) { if ((icTab = getTableEntry (loop->op))) { - fprintf (of, "%s(%d:%d:%d:%d:%d)\t", + fprintf (of, "%s(l%d:s%d:k%d:d%d:s%d)\t", loop->filename, loop->lineno, loop->seq, loop->key, loop->depth, loop->supportRtn); @@ -846,13 +846,13 @@ isOperandVolatile (operand * op, bool chkTemp) return 0; opetype = getSpec (optype = operandType (op)); - - if (IS_PTR (optype) && DCL_PTR_VOLATILE (optype)) - return 1; - - if (IS_VOLATILE (opetype)) - return 1; - return 0; + + if (IS_PTR (optype) && DCL_PTR_VOLATILE (optype)) + return 1; + + if (IS_VOLATILE (opetype)) + return 1; + return 0; } /*-----------------------------------------------------------------*/ @@ -2125,10 +2125,11 @@ aggrToPtr (sym_link * type, bool force) return type; etype = getSpec (type); - ptype = newLink (); + ptype = newLink (DECLARATOR); ptype->next = type; - /* if the output class is generic */ + + /* if the output class is code */ if ((DCL_TYPE (ptype) = PTR_TYPE (SPEC_OCLS (etype))) == CPOINTER) DCL_PTR_CONST (ptype) = port->mem.code_ro; @@ -2140,6 +2141,7 @@ aggrToPtr (sym_link * type, bool force) /* the variable was volatile then pointer to volatile */ if (IS_VOLATILE (etype)) DCL_PTR_VOLATILE (ptype) = 1; + return ptype; } @@ -2156,7 +2158,6 @@ geniCodeArray2Ptr (operand * op) if ((DCL_TYPE (optype) = PTR_TYPE (SPEC_OCLS (opetype))) == CPOINTER) DCL_PTR_CONST (optype) = port->mem.code_ro; - /* if the variable was declared a constant */ /* then the pointer points to a constant */ if (IS_CONSTANT (opetype)) @@ -2165,6 +2166,7 @@ geniCodeArray2Ptr (operand * op) /* the variable was volatile then pointer to volatile */ if (IS_VOLATILE (opetype)) DCL_PTR_VOLATILE (optype) = 1; + op->isaddr = 0; return op; } @@ -2448,8 +2450,7 @@ geniCodeAddressOf (operand * op) /* return op; */ /* } */ - p = newLink (); - p->class = DECLARATOR; + p = newLink (DECLARATOR); /* set the pointer depending on the storage class */ if ((DCL_TYPE (p) = PTR_TYPE (SPEC_OCLS (opetype))) == CPOINTER) @@ -2558,11 +2559,6 @@ geniCodeDerefPtr (operand * op,int lvl) op->isGptr = IS_GENPTR (optype); - /* if the pointer was declared as a constant */ - /* then we cannot allow assignment to the derefed */ - if (IS_PTR_CONST (optype)) - SPEC_CONST (retype) = 1; - op->isaddr = (IS_PTR (rtype) || IS_STRUCT (rtype) || IS_INT (rtype) ||