you might want to disable that exception in main() 
setfcr(getcfr() ~FPOVFL);

sometimes I had to go extreme and do:
setfcr(getfcr() &~ (FPINEX|FPOVFL|FPUNFL|FPZDIV|FPINVAL));
when porting some code that was supposed to run well on unixes.

see getfcr(2).

On Nov 22, 2013, at 2:42 PM, Fausto Saporito <[email protected]> wrote:

> Hi Erik,
> 
> yes, it's a FP stack overflow... :-)
> I also tried with 9front, and the error message is slightly different:
> 
> ./arithchk
> #define IEEE_8087
> #define Arith_Kind_ASL 1
> arithchk 8523: suicide: sys: fp: invalid operation fppc=0x12ee status=0xb8b3 
> pc=0x000012f2
> 
> further checks reveal that the problem is this function:
> 
>  void
> get_nanbits(unsigned int *b, int k)
> {
>       union { double d; unsigned int z[2]; } u, u1, u2;
> 
>       k = 2 - k;
>       u1.z[k] = u2.z[k] = 0x7ff00000;
>       u1.z[1-k] = u2.z[1-k] = 0;
>       u.d = u1.d - u2.d;      /* Infinity - Infinity */ <<<<<<<======  this 
> is the FATAL ERROR.
>       b[0] = u.z[0];
>       b[1] = u.z[1];
>       }
> 
> called as getnanbits(nanbits,1)
> 
> I'm sorry but I don't know how to generate the acid code.
> 
> regards,
> Fausto
> 
> 
> 
> 2013/11/22 erik quanstrom <[email protected]>
> > By the way I have always the same problem (suicide with stack overflow
> > running arithchk).
> 
> that's not a stack overflow, that's a x87 floating point stack overflow.
> if you would post the code around the program counter in your error
> message it would be helpful.  asm(*PC) with acid would be even better.
> 
> - erik
> 

—
Federico G. Benavento
[email protected]



Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to