home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / langs / sozobon2.zoo / hcc / patch < prev    next >
Encoding:
Text File  |  1990-12-16  |  1.3 KB  |  46 lines

  1. :::::::  bug fix #3 ::::::::::::
  2.  
  3. The first bug is in 'hcc'.  It involves passing arguments of type
  4. char or unsigned char.  This may fail if the arg is an expression
  5. (and is inefficient for register variables).
  6.  
  7. First, add the following line near the top of file 'g2.c':
  8.  
  9.   #define isdreg(np)    ((np)->g_token == REGVAR && (np)->g_rno < AREG)
  10.  
  11. Second, in the function 'onearg()' in g2.c, change the following case:
  12.  
  13.     case 1:
  14.         addcode(np, (np->g_ty == ET_U) ?
  15.            "\tclr.w\td0\n\tmove.b\tA,d0\n\tmove.w\td0,-(sp)\n" :
  16.            "\tmove.b\tA,d0\n\text.w\td0\n\tmove.w\td0,-(sp)\n" );
  17.         return 2;
  18.  
  19. to this:
  20.  
  21.     case 1:
  22.         if (isdreg(np))
  23.         addcode(np, (np->g_ty == ET_U) ?
  24.            "\tand.w\t#255,A\n\tmove.w\tA,-(sp)\n" :
  25.            "\text.w\tA\n\tmove.w\tA,-(sp)\n" );
  26.         else
  27.         addcode(np, (np->g_ty == ET_U) ?
  28.            "\tclr.w\td0\n\tmove.b\tA,d0\n\tmove.w\td0,-(sp)\n" :
  29.            "\tmove.b\tA,d0\n\text.w\td0\n\tmove.w\td0,-(sp)\n" );
  30.         return 2;
  31.  
  32.  
  33. There is a bug in all versions of 'hcc' that can occur when register
  34. variables are declared in nested blocks.  Because of it, 'jas' cannot
  35. be re-compiled with the 1.2 release with the optimizer (-O) turned on.
  36.  
  37. In the file "fun.c", in the function "block()", change these 2 lines:
  38.  
  39.         if (blktab->b_regs > maxregs)
  40.             maxregs = blktab->b_regs;
  41.  
  42. to this 1 line:
  43.  
  44.         maxregs |= blktab->b_regs;
  45.  
  46.