Skip to content

Commit 91a1e14

Browse files
committed
Disable excessive FP optimization by recent versions of gcc.
Suggested solution from Tom Lane. Problem discovered, probably not for the first time, while testing the mingw-w64 32 bit compiler. Backpatched to all live branches.
1 parent fa1369a commit 91a1e14

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

configure

+54
Original file line numberDiff line numberDiff line change
@@ -3134,6 +3134,60 @@ else
31343134
echo "$as_me: failed program was:" >&5
31353135
sed 's/^/| /' conftest.$ac_ext >&5
31363136

3137+
CFLAGS="$pgac_save_CFLAGS"
3138+
echo "$as_me:$LINENO: result: no" >&5
3139+
echo "${ECHO_T}no" >&6
3140+
fi
3141+
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
3142+
3143+
# Disable FP optimizations that cause various errors on gcc 4.5+ or maybe 4.6+
3144+
echo "$as_me:$LINENO: checking if $CC supports -fexcess-precision=standard" >&5
3145+
echo $ECHO_N "checking if $CC supports -fexcess-precision=standard... $ECHO_C" >&6
3146+
pgac_save_CFLAGS=$CFLAGS
3147+
CFLAGS="$pgac_save_CFLAGS -fexcess-precision=standard"
3148+
cat >conftest.$ac_ext <<_ACEOF
3149+
/* confdefs.h. */
3150+
_ACEOF
3151+
cat confdefs.h >>conftest.$ac_ext
3152+
cat >>conftest.$ac_ext <<_ACEOF
3153+
/* end confdefs.h. */
3154+
3155+
int
3156+
main ()
3157+
{
3158+
3159+
;
3160+
return 0;
3161+
}
3162+
_ACEOF
3163+
rm -f conftest.$ac_objext
3164+
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
3165+
(eval $ac_compile) 2>conftest.er1
3166+
ac_status=$?
3167+
grep -v '^ *+' conftest.er1 >conftest.err
3168+
rm -f conftest.er1
3169+
cat conftest.err >&5
3170+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
3171+
(exit $ac_status); } &&
3172+
{ ac_try='test -z "$ac_c_werror_flag"
3173+
|| test ! -s conftest.err'
3174+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3175+
(eval $ac_try) 2>&5
3176+
ac_status=$?
3177+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
3178+
(exit $ac_status); }; } &&
3179+
{ ac_try='test -s conftest.$ac_objext'
3180+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
3181+
(eval $ac_try) 2>&5
3182+
ac_status=$?
3183+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
3184+
(exit $ac_status); }; }; then
3185+
echo "$as_me:$LINENO: result: yes" >&5
3186+
echo "${ECHO_T}yes" >&6
3187+
else
3188+
echo "$as_me: failed program was:" >&5
3189+
sed 's/^/| /' conftest.$ac_ext >&5
3190+
31373191
CFLAGS="$pgac_save_CFLAGS"
31383192
echo "$as_me:$LINENO: result: no" >&5
31393193
echo "${ECHO_T}no" >&6

configure.in

+2
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@ choke me
292292
PGAC_PROG_CC_CFLAGS_OPT([-fno-strict-aliasing])
293293
# Disable optimizations that assume no overflow; needed for gcc 4.3+
294294
PGAC_PROG_CC_CFLAGS_OPT([-fwrapv])
295+
# Disable FP optimizations that cause various errors on gcc 4.5+ or maybe 4.6+
296+
PGAC_PROG_CC_CFLAGS_OPT([-fexcess-precision=standard])
295297
elif test x"${CC}" = x"xlc"; then
296298
# AIX xlc has to have strict aliasing turned off too
297299
PGAC_PROG_CC_CFLAGS_OPT([-qnoansialias])

0 commit comments

Comments
 (0)