@@ -4306,6 +4306,67 @@ if test x"$pgac_cv_prog_cc_cflags__fwrapv" = x"yes"; then
43064306 CFLAGS="$CFLAGS -fwrapv"
43074307fi
43084308
4309+ # Disable FP optimizations that cause various errors on gcc 4.5+ or maybe 4.6+
4310+ { $as_echo "$as_me:$LINENO: checking whether $CC supports -fexcess-precision=standard" >&5
4311+ $as_echo_n "checking whether $CC supports -fexcess-precision=standard... " >&6; }
4312+ if test "${pgac_cv_prog_cc_cflags__fexcess_precision_standard+set}" = set; then
4313+ $as_echo_n "(cached) " >&6
4314+ else
4315+ pgac_save_CFLAGS=$CFLAGS
4316+ CFLAGS="$pgac_save_CFLAGS -fexcess-precision=standard"
4317+ ac_save_c_werror_flag=$ac_c_werror_flag
4318+ ac_c_werror_flag=yes
4319+ cat >conftest.$ac_ext <<_ACEOF
4320+ /* confdefs.h. */
4321+ _ACEOF
4322+ cat confdefs.h >>conftest.$ac_ext
4323+ cat >>conftest.$ac_ext <<_ACEOF
4324+ /* end confdefs.h. */
4325+
4326+ int
4327+ main ()
4328+ {
4329+
4330+ ;
4331+ return 0;
4332+ }
4333+ _ACEOF
4334+ rm -f conftest.$ac_objext
4335+ if { (ac_try="$ac_compile"
4336+ case "(($ac_try" in
4337+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4338+ *) ac_try_echo=$ac_try;;
4339+ esac
4340+ eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4341+ $as_echo "$ac_try_echo") >&5
4342+ (eval "$ac_compile") 2>conftest.er1
4343+ ac_status=$?
4344+ grep -v '^ *+' conftest.er1 >conftest.err
4345+ rm -f conftest.er1
4346+ cat conftest.err >&5
4347+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4348+ (exit $ac_status); } && {
4349+ test -z "$ac_c_werror_flag" ||
4350+ test ! -s conftest.err
4351+ } && test -s conftest.$ac_objext; then
4352+ pgac_cv_prog_cc_cflags__fexcess_precision_standard=yes
4353+ else
4354+ $as_echo "$as_me: failed program was:" >&5
4355+ sed 's/^/| /' conftest.$ac_ext >&5
4356+
4357+ pgac_cv_prog_cc_cflags__fexcess_precision_standard=no
4358+ fi
4359+
4360+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4361+ ac_c_werror_flag=$ac_save_c_werror_flag
4362+ CFLAGS="$pgac_save_CFLAGS"
4363+ fi
4364+ { $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__fexcess_precision_standard" >&5
4365+ $as_echo "$pgac_cv_prog_cc_cflags__fexcess_precision_standard" >&6; }
4366+ if test x"$pgac_cv_prog_cc_cflags__fexcess_precision_standard" = x"yes"; then
4367+ CFLAGS="$CFLAGS -fexcess-precision=standard"
4368+ fi
4369+
43094370elif test "$ICC" = yes; then
43104371 # Intel's compiler has a bug/misoptimization in checking for
43114372 # division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS.