[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Infinite loop with GCC 4.3
From: |
Carl D. Sorensen |
Subject: |
RE: Infinite loop with GCC 4.3 |
Date: |
Mon, 26 May 2008 09:42:52 -0600 |
> -----Original Message-----
> From: Joe Neeman [mailto:address@hidden
> Sent: Monday, May 26, 2008 1:22 AM
> To: John Mandereau
> Cc: lily-devel
> Subject: Re: Infinite loop with GCC 4.3
>
> On Mon, 2008-05-26 at 07:53 +0200, John Mandereau wrote:
> > On 2008/05/26, Joe Neeman wrote:
> > > Attached is the smallest example that I could find that
> reproduces
> > > the problem. With g++ 4.3.0 on Fedora 9, I get an
> infinite loop with
> > > -O1 but immediate termination with -O0. With g++ 4.2.3 on
> Debian, I
> > > get termination regardless of the optimisation setting.
> > >
> > > I think it is also easy to argue that the program should
> terminate,
> > > regardless of rounding (the value of 'i' should be the same every
> > > time the loop executes. So on the second time through,
> 'x' should be
> > > at least as large as 'i').
> >
> > I agree.
>
> 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.
Have you experimented with the code on comment 60 of the gcc bug tracker? It
apparently sets the fpu internal precision to 64 bits. I can't test it on my
current machine, but it seemed like it might work for the current case.
Carl
- Re: Infinite loop with GCC 4.3, (continued)
- Re: Infinite loop with GCC 4.3, Karl Hammar, 2008/05/26
- Re: Infinite loop with GCC 4.3, Han-Wen Nienhuys, 2008/05/26
- Re: Infinite loop with GCC 4.3, David Kastrup, 2008/05/27
- Re: Infinite loop with GCC 4.3, Karl Hammar, 2008/05/27
- Re: Infinite loop with GCC 4.3, Trevor Daniels, 2008/05/26
- Re: Infinite loop with GCC 4.3, Han-Wen Nienhuys, 2008/05/26
- RE: Infinite loop with GCC 4.3,
Carl D. Sorensen <=
- Re: Infinite loop with GCC 4.3, Mats Bengtsson, 2008/05/26
- Re: Infinite loop with GCC 4.3, Joe Neeman, 2008/05/26
- Re: Infinite loop with GCC 4.3, Graham Percival, 2008/05/26
- Re: Infinite loop with GCC 4.3, Han-Wen Nienhuys, 2008/05/26
- Re: Infinite loop with GCC 4.3, Trevor Daniels, 2008/05/26