[comp.sys.amiga.tech] PDC bugs!

hamish@waikato.ac.nz (05/29/90)

Ok guys, Somebody wanted to know about bugs in release 3.33 of PDC a couple
of weeks ago. Heres a couple of "undocumented feature" types that I've found
so far.

   1. Library routine .fs2l is exported wrongly from math.lib. Exported as
      .fd2l, and must be changed & recompiled.

   2. The macro that came with Lattice C for determining the max of two
      numbers. ie #define max(a,b)  ((a)<(b)?(b):(a))
      If parameter (b) is a constant < 256, and the parameter (a) is a 
      variable of 16 or greater bits, then the code produced is this

      moveq #0,d0
      cmp.l d0,d3        ; (a) is in d3
      blt   _L1

      moveq #0,d0
      move.b d0,d3       ; assuming d3 holds variable in (a)
_L1
      ext.w  d3
      ext.l  d3

      This has the effect of sign extending the lower 8 bits of the WORD 
      variable onto the upper 8 bits, and then further turning it into a 
      LONGWORD value (see 3)

  3. If a structure is initialised twice with the same variable name,
     eg a gadget definition, the compiler doesn't pick it up. Instead 
     it gladly generates assembly code with duplicate labels in it, and
     then has the nerver to report no errors, and start the assembler.

  4. All maths is done with LONWORDS. Even if you explicitly declare a
     variable (or 2) as WORDS, then to add them they are sign extended 
     and then added. Same for parameter passing, they are pushed onto
     the stack as LONGWORDS

  5. Although the #pragma statement is compiled, all it does is ADD
     a few instructions. The parameters are still pushed onto the stack,
     and then are taken from the stack and put into the corresponding
     registers, before the routine is called. Then the wasted stack is
     regained AFTER the called routine returns.

I think thats all the problems I've had with it. Only the first 3 have
really been more than an annoyance. Good thing I can program in assembler
though, and that it doesn't produce object files, else I'd really be stuck.

Keep the asm files guys, its real handy not to have to take the compilers
word for it, when you think something is wrong. Also handy for hand optimising
all thos long operations on word sized values.

All in all its a good piece of software. Don't know if I'd keep it though if
I could afford a copy of Lattive 5.05, but since I can't so what right?

-- 
==============================================================================
|  Hamish Marson                        |  Internet  hamish@waikato.ac.nz    |
|  Computer Support Person              |  Phone  (071)562889 xt 8181        |
|  Computer Science Department          |  Amiga 3000 for ME!                |
|  University of Waikato                |                                    |
==============================================================================
|Disclaimer:  Anything said in this message is the personal opinion of the   |
|             finger hitting the keyboard & doesn't represent my employers   |
|             opinion in any way. (ie we probably don't agree)               |
==============================================================================