use -O1 optimization level for gcc 4.2
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 19 Feb 2010 08:26:19 +0000 (09:26 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 19 Feb 2010 08:26:19 +0000 (09:26 +0100)
gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu4) seems to miscopile isl with -O2

m4/ax_cc_maxopt.m4

index da415be..92d522d 100644 (file)
@@ -149,6 +149,16 @@ if test "$ac_test_CFLAGS" != "set"; then
      AX_CHECK_COMPILER_FLAGS(-ffast-math, CFLAGS="$CFLAGS -ffast-math")
 
      AX_GCC_ARCHFLAG($acx_maxopt_portable)
+
+     # drop to -O1 for gcc 4.2
+     $CC --version |
+       sed -e 's/.* \(@<:@0-9@:>@@<:@0-9@:>@*\)\.\(@<:@0-9@:>@@<:@0-9@:>@*\).*/\1 \2/' |
+       (read major minor
+           if test $major -eq 4 -a $minor -eq 2; then
+                               exit 0
+           fi
+           exit 1
+       ) && CFLAGS="-O1"
      ;;
   esac