diff --git a/README.compilation b/README.compilation
index 12e6507ea49c71474000e92613b6fda027666902..92300fd3370ff6d2267847eec92a1003b998087e 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 443e5bb808ebeaa96bc1adb3d0e720aaca0c83b4..1f65d086bca55959a817d8733a3058c567b1254a 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"