lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Infinite loop with GCC 4.3


From: Karl Hammar
Subject: Re: Infinite loop with GCC 4.3
Date: Mon, 26 May 2008 23:35:15 +0200 (CEST)

Han-Wen:
> 2008/5/26 Joe Neeman <address@hidden>:
...
> > Well, it seems that I should have started by reading the gcc bug
> > tracker. This is a very popular bug:
> > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323
> >
> > The summary is that you cannot expect sane behaviour with the double
> > data type using gcc (and apparently most other C compilers) on x86. In
> > particular, doubles may be truncated from 80 bits to 64 bits at any
> > time. Therefore, you can compare two (80-bit) doubles and find that they
> > are not equal only for them to become equal on the very next line.
> >
> > The position of the gcc folks is that this is Intel's fault and so they
> > will not fix it. This leaves us with a few options:
> > 1) Change Real to be a long double instead of a double (on x86 only?)
> > 2) Compile with -msse on x86
> > 3) Find some way of forcing a truncation (as suggested in comment #88 of
> > the above link)
> > 4) Anything else?
> 
> comment #60 sounds promising too. We'd have to have a small bit of
> system dependent code, but it is localized, so I can live with it.

David Monniaux discusses this problem on page 15-17 of [1].

His recommondation is to skip using the x87 fpu and use the sse fpu 
instead. For this you don't need to add any code to the progran, but you 
have the problem of not supporting x86 cpus without sse fpu, and you 
have to specify target architecture.

(As hinted to by #96)
[1] 
http://hal.archives-ouvertes.fr/docs/00/28/14/29/PDF/floating-point-article.pdf

Regards,
/Karl






reply via email to

[Prev in Thread] Current Thread [Next in Thread]