Floating Point Errors with Linaro GCC 4.7.3

Bug #1299354 reported by Somnath Mitra
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GCC
Won't Fix
Undecided
Michael Collison

Bug Description

Greetings,

We have several ARM platforms that run with the Freescale i.MX6 CPU with NEON. We have encountered some floating point errors with the Linaro 4.7.3 compiler. The values computed are incorrect. However, when running individual tests, the errors don’t happen. They manifest in some strange, and often unpredictable, sequences of individual tests. The tests are written in Java and they run on Oracle CVM. CVM source code is compiled with Linaro GCC. These errors did not happen with the Linaro 4.5.4 compiler.

We use –O4 optimization. With the 4.7.3 compiler the tests pass when we change optimization to –O1. They fail with –O4. To reiterate, 4.5.4 with -O4 passes the tests.

Our attempts at creating smaller test cases have not been successful so far.

Several floating point changes went in between 4.5.4 and 4.7.3 releases. Can you provide a list of changes that might be related to this issue? Any suggestions to avoid the error? The -O1 is unacceptable for performance reasons.

Thanks,
Somnath.

PS:

Compiler that successfully passes the tests:

COLLECT_GCC=linaro-4.5.4-arm/arm-linux-gnueabi/bin/gcc
Target: arm-linux-gnueabi
Configured with: ../../src/gcc-linaro-4.5-2011.05-0/configure --enable-languages=c,c++ --prefix=/home/ubuntu/opt/cross-gcc-linaro/4.5.4 --target=arm-linux-gnueabi --with-sysroot=/home/ubuntu/opt/cross-gcc-linaro/4.5.4/arm-linux-gnueabi --with-build-sysroot=/home/ubuntu/work-454/build/sysroot/home/ubuntu/opt/cross-gcc-linaro/4.5.4/arm-linux-gnueabi --with-arch=armv7-a --with-tune=cortex-a8 --with-float=softfp --with-fpu=neon --enable-threads=posix --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-languages=c,c++ --enable-shared --enable-multiarch --with-system-zlib --disable-nls --without-included-gettext --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-symvers=gnu --enable-__cxa_atexit --disable-libgomp --enable-linker-build-id
Thread model: posix
gcc version 4.5.4 20110505 (prerelease) (Linaro GCC 4.5-2011.05-0)

Compiler that fails:

COLLECT_GCC=linaro-4.7.3-arm/arm-linux-gnueabi/bin/gcc
Target: arm-linux-gnueabi
Configured with: ../../src/gcc-linaro-4.7-2013.03/configure --enable-languages=c,c++ --prefix=/scratchbox/compilers/linaro-4.7.3-arm --target=arm-linux-gnueabi --with-sysroot=/scratchbox/compilers/linaro-4.7.3-arm/arm-linux-gnueabi --with-build-sysroot=/home/ubuntu/lab473/build/sysroot/scratchbox/compilers/linaro-4.7.3-arm/arm-linux-gnueabi --with-arch=armv7-a --with-tune=cortex-a9 --with-float=softfp --with-fpu=neon --enable-threads=posix --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-languages=c,c++ --enable-shared --enable-multiarch --with-system-zlib --disable-nls --without-included-gettext --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-symvers=gnu --enable-__cxa_atexit --disable-libgomp
Thread model: posix
gcc version 4.7.3 20130226 (prerelease) (Linaro GCC 4.7-2013.03)

Somnath Mitra (somnathm)
description: updated
Somnath Mitra (somnathm)
information type: Public → Private
Somnath Mitra (somnathm)
description: updated
Revision history for this message
Somnath Mitra (somnathm) wrote :

This issue was resolved by using -mfpu=vfpv3.

tags: added: vfpv3
Revision history for this message
Somnath Mitra (somnathm) wrote :

Please add a list of changes between 4.5.4 and 4.7.3 that are related to floating point code generation differences between NEON and VFPv3.

Somnath Mitra (somnathm)
information type: Private → Public
Revision history for this message
Michael Collison (michael-collison) wrote :

More specific case needs to be provided. Not within scope to provide list of floating point changes between 4.5 and 4.7 compilers.

Changed in gcc-linaro:
status: New → Won't Fix
assignee: nobody → Michael Collison (michael-collison)
Revision history for this message
Somnath Mitra (somnathm) wrote :

We did not see this problem with this version:

gcc version 4.8.3 20140401 (prerelease) (Linaro GCC 4.8-2014.04)

We found some APCS violations during entry to/exit from JIT code within the CVM. Floating point register allocation changed between 4.5.4, 4.7.3 and 4.8.3 which made the bug manifest with 4.7.3 and then not manifest with 4.8.3. Those who encounter this issue can move to the above compiler version.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.