X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCsymt.c;h=2721c1d8d9f3c00269ad959f24f960a65457469f;hb=c5fba2c56a20411a7705af8e430213fcdeb0d077;hp=9ef1a688e2ba48ffef29e3acfe35be3b7a155509;hpb=c3bf2d8fd69b69dcf7564d3e24cd045d2bcc385c;p=fw%2Fsdcc diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index 9ef1a688..2721c1d8 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -1031,24 +1031,25 @@ structElemType (sym_link * stype, value * id) sym_link *type, *etype; sym_link *petype = getSpec (stype); - if (!fields || !id) - return NULL; + if (fields && id) { + + /* look for the id */ + while (fields) + { + if (strcmp (fields->rname, id->name) == 0) + { + type = copyLinkChain (fields->type); + etype = getSpec (type); + SPEC_SCLS (etype) = (SPEC_SCLS (petype) == S_REGISTER ? + SPEC_SCLS (etype) : SPEC_SCLS (petype)); + return type; + } + fields = fields->next; + } + } - /* look for the id */ - while (fields) - { - if (strcmp (fields->rname, id->name) == 0) - { - type = copyLinkChain (fields->type); - etype = getSpec (type); - SPEC_SCLS (etype) = (SPEC_SCLS (petype) == S_REGISTER ? - SPEC_SCLS (etype) : SPEC_SCLS (petype)); - return type; - } - fields = fields->next; - } werror (E_NOT_MEMBER, id->name); - + // the show must go on return newIntLink(); } @@ -1172,10 +1173,17 @@ checkSClass (symbol * sym, int isProto) } /* if absolute address given then it mark it as - volatile */ - if (IS_ABSOLUTE (sym->etype)) - SPEC_VOLATILE (sym->etype) = 1; + volatile -- except in the PIC port */ + +#if !OPT_DISABLE_PIC + /* The PIC port uses a different peep hole optimizer based on "pCode" */ + if (!TARGET_IS_PIC) +#endif + + if (IS_ABSOLUTE (sym->etype)) + SPEC_VOLATILE (sym->etype) = 1; + /* global variables declared const put into code */ /* if no other storage class specified */ if (sym->level == 0 && @@ -2453,7 +2461,8 @@ sym_link *typeFromStr (char *s) s++; break; default: - werror(E_INTERNAL_ERROR,"typeFromStr"); + werror(E_INTERNAL_ERROR, __FILE__, __LINE__, + "typeFromStr: unknown type"); break; } if (IS_SPEC(r) && usign) { @@ -2539,12 +2548,12 @@ initCSupport () if (tofrom) { sprintf (buffer, "__fs2%s%s", ssu[su], sbwd[bwd]); - __conv[tofrom][bwd][su] = funcOfType (_mangleFunctionName(buffer), __multypes[bwd][su], floatType, 1, options.float_rent); + __conv[tofrom][bwd][su] = funcOfType (buffer, __multypes[bwd][su], floatType, 1, options.float_rent); } else { sprintf (buffer, "__%s%s2fs", ssu[su], sbwd[bwd]); - __conv[tofrom][bwd][su] = funcOfType (_mangleFunctionName(buffer), floatType, __multypes[bwd][su], 1, options.float_rent); + __conv[tofrom][bwd][su] = funcOfType (buffer, floatType, __multypes[bwd][su], 1, options.float_rent); } } }