Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

float exception problem on alpha/linux. #3024

Closed
vicuna opened this issue Nov 12, 2001 · 4 comments
Closed

float exception problem on alpha/linux. #3024

vicuna opened this issue Nov 12, 2001 · 4 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Nov 12, 2001

Original bug ID: 625
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Hello, ...

I got the following problem from an debian/alpha user :


% ocaml
Objective Caml version 3.02

1.0 /. 0.0;;

zsh: floating point exception (core dumped) ocaml

This is kind of obvious why.

% ocaml
Objective Caml version 3.02

1.0 +. sqrt(-1.0);;

zsh: floating point exception (core dumped) ocaml

Here sqrt works and gives "- : float = nan" and then the +. fails.

On i386 it just gives nan.

Most likely ocaml needs to be compiled with "-mieee".


A complete log of the bugs handling can be found at :
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=116289&repeatmerged=yes

I applied the attached patch, and the problem was gone with the new package,
but the user still reports the same problem happening for the native code
compiler.

So :

  1. please apply the attached patch, or something like it, to the ocaml cvs
    tree. (in case it is not already, i couldn't reach the CVS repository right
    now, but it is not in the 3.03-alpha tarball).

  2. I did not find an easy way to solve this problem for the native code
    compiler, but i think it is already solved for the other alpha OSes, since you
    seem to use the alpha arch a lot. Could you give me a hint as to how to solve
    this. (I could be looking at it more though, i don't ave a lot of time for it
    right now though.)

Friendly,

Sven Luther


--- ocaml-3.02.orig/configure
+++ ocaml-3.02/configure
@@ -199,6 +199,10 @@
bytecccompopts="-fno-defer-pop $gcc_warnings"
# No -lm library
mathlib="";;

  • gcc,alpha*--linux)
  • if cc="$bytecc" sh ./hasgot -mieee; then
  •  bytecccompopts="-mieee $bytecccompopts";
    
  • fi;;
    gcc,alpha*--osf)
    bytecccompopts="-fno-defer-pop $gcc_warnings"
    if cc="$bytecc" sh ./hasgot -mieee; then


@vicuna
Copy link
Author

vicuna commented Nov 23, 2001

Comment author: administrator

I got the following problem from an debian/alpha user :


% ocaml
Objective Caml version 3.02

1.0 /. 0.0;;

zsh: floating point exception (core dumped) ocaml
Most likely ocaml needs to be compiled with "-mieee".


Correct.

  1. please apply the attached patch, or something like it, to the ocaml cvs
    tree. (in case it is not already, i couldn't reach the CVS repository right
    now, but it is not in the 3.03-alpha tarball).

Will do.

  1. I did not find an easy way to solve this problem for the native
    code compiler, but i think it is already solved for the other alpha
    OSes, since you seem to use the alpha arch a lot.

Actually, we have the same problem under Digital Unix / Tru64.
Software IEEE emulation requires serious work on the native code
generator (and entails a large performance penalty); don't hold your
breath.

Note that this problem is documented in the manual (last section of
chapter "Native-code compiler"), and should go away with the next
generation of Alpha processors, which is rumored to implement correct
IEEE float behavior all in hardware, like everyone else.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Nov 23, 2001

Comment author: administrator

On Fri, Nov 23, 2001 at 01:49:09PM +0100, Xavier Leroy wrote:

I got the following problem from an debian/alpha user :


% ocaml
Objective Caml version 3.02

1.0 /. 0.0;;

zsh: floating point exception (core dumped) ocaml
Most likely ocaml needs to be compiled with "-mieee".


Correct.

  1. please apply the attached patch, or something like it, to the ocaml cvs
    tree. (in case it is not already, i couldn't reach the CVS repository right
    now, but it is not in the 3.03-alpha tarball).

Will do.

:)))

  1. I did not find an easy way to solve this problem for the native
    code compiler, but i think it is already solved for the other alpha
    OSes, since you seem to use the alpha arch a lot.

Actually, we have the same problem under Digital Unix / Tru64.
Software IEEE emulation requires serious work on the native code
generator (and entails a large performance penalty); don't hold your
breath.

:(((

Note that this problem is documented in the manual (last section of
chapter "Native-code compiler"), and should go away with the next
generation of Alpha processors, which is rumored to implement correct
IEEE float behavior all in hardware, like everyone else.

Huh, the one intel will produce ?

Friendly,

Sven Luther

@vicuna
Copy link
Author

vicuna commented Nov 23, 2001

Comment author: administrator

Patch to configure merged 2001-11-23 by XL.

@vicuna vicuna closed this as completed Nov 23, 2001
@vicuna
Copy link
Author

vicuna commented Nov 26, 2001

Comment author: administrator

Note that this problem is documented in the manual (last section of
chapter "Native-code compiler"), and should go away with the next
generation of Alpha processors, which is rumored to implement correct
IEEE float behavior all in hardware, like everyone else.

Huh, the one intel will produce ?

Yes. The last time I looked, the EV7 (next-generation alpha) was
still to be produced and sold by Intel, although they cancelled the EV8
(the one after). But, yes, the EV7 will be "le chant du cygne" for
the Alpha :-(

  • Xavier Leroy

@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant