X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fpic%2Fpcoderegs.c;h=0c8f4bebed9c1dc485ee9726b5e23259cb100b97;hb=5db7b152dddfeac2395417a253993f63e21e0fe5;hp=fd37229cd35623cae10e2c0946d24a1347e02907;hpb=b21f90fcfcda291d97c4fda8295df83dcde6f730;p=fw%2Fsdcc diff --git a/src/pic/pcoderegs.c b/src/pic/pcoderegs.c index fd37229c..0c8f4beb 100644 --- a/src/pic/pcoderegs.c +++ b/src/pic/pcoderegs.c @@ -732,11 +732,23 @@ void OptimizeRegUsage(set *fregs, int optimize_multi_uses, int optimize_level) fprintf(stderr,"Reg: %s\n",reg->name); */ + /* Catch inconsistently set-up live ranges + * (see tracker items #1469504 + #1474602) + * FIXME: Actually we should rather fix the + * computation of the liveranges instead... + */ + if (!reg || !reg->reglives.usedpFlows + || !reg->reglives.assignedpFlows) + { + //fprintf( stderr, "skipping reg w/o liveranges: %s\n", reg ? reg->name : "(unknown)"); + continue; + } + if(reg->type == REG_SFR || reg->type == REG_STK || reg->isPublic || reg->isExtern|| reg->isFixed) { //fprintf(stderr,"skipping SFR: %s\n",reg->name); continue; } - + pcfl_used = setFirstItem(reg->reglives.usedpFlows); pcfl_assigned = setFirstItem(reg->reglives.assignedpFlows); @@ -1275,7 +1287,7 @@ static int pCodeRemove (pCode *pc, const char *comment) else { fprintf (stderr, "Cannot move a label...\n"); - exit(-1); + exit(EXIT_FAILURE); } if (comment) @@ -1672,7 +1684,7 @@ void pCodeRegOptimizeRegUsage(int level) #if 0 /* This is currently broken (need rewrite to correctly - * hamdle arbitrary pCodeOps instead of registers only). */ + * handle arbitrary pCodeOps instead of registers only). */ if (!pic14_options.disable_df) optimizeDataflow (); #endif