Igor Schein on Thu, 21 Dec 2006 00:13:54 +0100


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

Re: Lowering compiler optimisation with Apple gcc


On 12/15/06, Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr> wrote:
Hello PARI-dev,

we regurlarly get bug reports about random problems on Apple platform,
see #504, #523,
<http://pari.math.u-bordeaux.fr/archives/pari-dev-0603/msg00003.html >
<http://pari.math.u-bordeaux.fr/archives/pari-dev-0606/msg00004.html>
and others.

Unfortunately we never have been able to reproduce any of them and
they looks like compilers bugs in various Apple gcc build.

Maybe we should lower the default optimisation level to reduce breakage.
Advanced users could still pick higher optimisation level.

We could check the gcc version for the string 'Apple'.

What do you think ?


I think _lowering_ should be quantified.  For example, I found out that adding
-fno-delete-null-pointer-checks eliminates bench failures for my build (64bit using gcc-4.0.1 ).
That flag is turned on at -O2, so we don't want lowering default optimization all the way to -O1.  So I suggest
that people who submitted mac bugs try CFLAGS=-fno-delete-null-pointer-checks and see if it fixes those bugs.
If it indeed does, then we check for MacOS gcc-4.0.1 during Configure and then add -fno-delete-null-pointer-checks flag.

I also built my own gcc-4.1.1 and all benches run fine with default optimization.

Igor