[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Infinite loop with GCC 4.3
From: |
John Mandereau |
Subject: |
Re: Infinite loop with GCC 4.3 |
Date: |
Mon, 26 May 2008 23:33:35 +0200 |
On 2008/05/26, Han-Wen Nienhuys wrote:
> 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.
I followed suggestion from this comment #60, including #include
<fpu_control.h> and adding the two lines
fpu_control_t fpu_control = 0x027f ;
_FPU_SETCW(fpu_control);
at the beginning of main(). This fixes the bug for me with GCC 4.3.0 on
Joe's example skyline2.cc (I didn't bother trying other GCC versions,
now I know this is not really a bug in GCC but a result of "strange"
behavior of 387 FPU). I'll test this for building Lily later.
This sounds the most reasonable alternative, as LilyPond may have to run
on "old" x86 CPUs without SSE2 instructions set, i.e. older than Pentium
4 or compatible.
For builders compiling for their own machine (like me), an alternative
to adding this specific code is suggested in comment #109: using
-mfpmath=sse *and* one of the following flags:
* -msse2
* -march=pentium4
* maybe athlon-4, athlon-xp and athlon-mp work for -march (I can test on
an Athlon XP, but not right now); I don't know if -m3dnow could also
replace -msse2 on Athlon CPUs.
These flags work well around the inaccurate rounding or truncating bug
with GCC 4.3.0, on both Joe's example and LilyPond from master branch.
Note that -msse or -march=pentium3 are not enough to avoid the bug.
Would it be possible to enable the fpu_control fix code by default
in ./configure script on x86, with a command-line option to disable this
for people who can use and prefer '-march=pentium4 -mfpmath=sse'[*]?
[*] these flags seem to speed up Lily running a little, I'll come with
precise statistics later.
Cheers,
John
- Infinite loop with GCC 4.3, John Mandereau, 2008/05/18
- Re: Infinite loop with GCC 4.3, Joe Neeman, 2008/05/25
- Re: Infinite loop with GCC 4.3, John Mandereau, 2008/05/25
- Re: Infinite loop with GCC 4.3, Joe Neeman, 2008/05/26
- Re: Infinite loop with GCC 4.3, John Mandereau, 2008/05/26
- Re: Infinite loop with GCC 4.3, Joe Neeman, 2008/05/26
- Re: Infinite loop with GCC 4.3, Werner LEMBERG, 2008/05/26
- Re: Infinite loop with GCC 4.3, Joe Neeman, 2008/05/26
- Re: Infinite loop with GCC 4.3, Han-Wen Nienhuys, 2008/05/26
- Re: Infinite loop with GCC 4.3,
John Mandereau <=
- Re: Infinite loop with GCC 4.3, John Mandereau, 2008/05/28
- Re: Infinite loop with GCC 4.3, Han-Wen Nienhuys, 2008/05/28
- Re: Infinite loop with GCC 4.3, Joe Neeman, 2008/05/28
- Re: Infinite loop with GCC 4.3, Patrick McCarty, 2008/05/31
- Re: Infinite loop with GCC 4.3, Joe Neeman, 2008/05/31
- 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