From 40ca46800e3bfb7b6fe1be3beb68b9b0dee3d840 Mon Sep 17 00:00:00 2001 From: Martin Reinecke Date: Mon, 15 Apr 2013 08:56:20 +0200 Subject: [PATCH] work around ICE in gcc 4.4.x --- README.compilation | 12 ++++++++---- configure.ac | 13 +++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/README.compilation b/README.compilation index 12e6507..92300fd 100644 --- a/README.compilation +++ b/README.compilation @@ -1,10 +1,7 @@ GNU make is required for compilation. Libsharp compilation has been successfully tested with GNU and Intel compilers. -When using gcc, version 4.x is required. -NOTE: Some versions of the gcc 4.4.x release series contain a bug which causes -the compiler to crash during libsharp compilation. This appears to be fixed -in the gcc 4.4.7 release. +When using gcc, version 4.x is required [1]. Since libsharp was written in standard C99, other compilers should work fine, but SSE2/AVX support will most likely be deactivated. @@ -24,3 +21,10 @@ Documentation can be created by the command "(g)make doc". However this requires the doxygen application to be installed on your system. The documentation will be created in the subdirectory doc/. + + +[1] Some versions of the gcc 4.4.x release series contain a bug which causes +the compiler to crash during libsharp compilation. This appears to be fixed +in the gcc 4.4.7 release. It is possible to work around this problem by adding +the compiler flag "-fno-tree-fre" after the other optimization flags - the +configure script should do this automatically. diff --git a/configure.ac b/configure.ac index 443e5bb..1f65d08 100644 --- a/configure.ac +++ b/configure.ac @@ -53,19 +53,16 @@ case $CCTYPE in GCCVERSION="`$CC -dumpversion 2>&1`" echo "Using gcc version $GCCVERSION" AC_SUBST(GCCVERSION) - case $system in - Darwin-*) - ;; - *) - CCFLAGS="$CCFLAGS -ffunction-sections -fdata-sections" - ;; - esac changequote(,) - gcc43=`echo $GCCVERSION | grep -c '4\.[3456789]'` + gcc43=`echo $GCCVERSION | grep -c '^4\.[3456789]'` + gcc44=`echo $GCCVERSION | grep -c '^4\.4'` changequote([,]) if test $gcc43 -gt 0; then CCFLAGS="$CCFLAGS -march=native" fi + if test $gcc44 -gt 0; then + CCFLAGS="$CCFLAGS -fno-tree-fre" + fi ;; icc) CCFLAGS="-O3 -xHOST -std=c99 -ip -Wbrief -Wall -vec-report0 -openmp-report0 -wd383,981,1419,1572"