Ticket #308: imcc-floatsize.patch

File imcc-floatsize.patch, 1.2 KB (added by doughera, 5 years ago)
  • compilers/imcc/optimizer.c

    old new  
    910910    const char *debug_fmt = NULL;   /* gcc -O uninit warn */ 
    911911    int found, branched; 
    912912 
    913     /* construct a FLOATVAL_FMT with needed precision */ 
     913    /* construct a FLOATVAL_FMT with needed precision. 
     914      TT #308  XXX Should use Configure.pl to figure these out, 
     915      but it's not clear just what is needed. 
     916      The value of '16' for NUMVAL_SIZE == 8 was one larger than the 
     917      default FLOATVAL_FMT of '15' determined by Configure.pl.  The 
     918      reason for this difference, if there is one, should be documented. 
     919      The values of.18Lg and .31Lg are guesses. 
     920    */ 
    914921#if NUMVAL_SIZE == 8 
    915922    fmt = "%0.16g"; 
    916923#elif NUMVAL_SIZE == 12 
    917924    fmt = "%0.18Lg"; 
     925#elif NUMVAL_SIZE == 16 
     926    fmt = "%0.31Lg"; 
    918927#else 
    919928    fmt = FLOATVAL_FMT; 
    920     IMCC_warning(interp, "subs_constants", "used default FLOATVAL_FMT\n"); 
     929    /* Since it's not clear why this is needed, it's not clear what to 
     930       do if it's an unknown case. 
     931    */ 
     932    IMCC_fatal(interp, 0, 
     933       "IMCC_subst_constants:  unexpected NUMVAL_SIZE = %d\n", 
     934       NUMVAL_SIZE); 
    921935#endif 
    922936 
    923937    tmp = NULL;