Quoted from JohnCampbell
...
certainly P and Q are not defined for goto 1400 from 1200 ( which my use of SDBG and /full_debug did not report ?)
John, /full_debug (and /debug) do not insert code to check for subscript errors and undefined variables. In the debugger, I see the undefined variables showing value = 6.013470016999068e-154, or, in hexadecimal integer notation, Z'2020202020202020'.
I've always found it worrying that floating point stack overflow was not overcome by breaking up the expression and using fewer registers.
I share the sentiment. The compiler writers, on the other hand, have to make a compromise between running out of registers, keeping temporary results in FPU registers as much as possible, and making as few accesses to memory as possible.
Does /64 have this same problem ?
The problem is slightly different. Take the expression in Line 124:
(1.0D0/(2.0D0*B))*DLOG((S+FF*R+G*DSIN(U/D))/(S-FF*R - G*DSIN(U/D)))-C/B
The sub-expression FFR+GDSIN(U/D) appears twice. Will the compiler recognise this fact, and avoid calculating the sub-expression twice? I translated the full expression to X87 instructions by hand, ordering the operations as I would on an RPN calculator, proceeding from left to right. I found that I used six FPU registers, but I also observed that it took extra book-keeping to note the number of registers that were occupied. Next, I redid the calculation, trying to use fewer registers. I found that I could do the calculation using only three registers. The 8.10 compiler put out code that used four FPU registers.
The same compiler, with /64, used only three XMM registers, but did a lot more memory ↔ XMM transfers than necessary. The 64-bit code must, of necessity, keep track of XMM register usage and use no more than the eight available (ignoring conventions regarding XMM register usage). With the X87 instructions, the stack-oriented instructions encourage one to assume that one has as many registers as needed. Most of the time, we are working with just ST0 and ST1 and, most of the time, we get away with not keeping track of register occupancy!