8000 Disable excessive FP optimization by recent versions of gcc. · jcsston/postgres@01e80a0 · GitHub
[go: up one dir, main page]

Skip to content
< 8000 !-- -->

Commit 01e80a0

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 81f4e6c commit 01e80a0

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

configure

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4054,6 +4054,56 @@ sed 's/^/| /' conftest.$ac_ext >&5
40544054
echo "${ECHO_T}no" >&6; }
40554055
fi
40564056

4057+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4058+
4059+
# Disable FP optimizations that cause various errors on gcc 4.5+ or maybe 4.6+
4060+
{ echo "$as_me:$LINENO: checking if $CC supports -fexcess-precision=standard" >&5
4061+
echo $ECHO_N "checking if $CC supports -fexcess-precision=standard... $ECHO_C" >&6; }
4062+
pgac_save_CFLAGS=$CFLAGS
4063+
CFLAGS="$pgac_save_CFLAGS -fexcess-precision=standard"
4064+
cat >conftest.$ac_ext <<_ACEOF
4065+
/* confdefs.h. */
4066+
_ACEOF
4067+
cat confdefs.h >>conftest.$ac_ext
4068+
cat >>conftest.$ac_ext <<_ACEOF
4069+
/* end confdefs.h. */
4070+
4071+
int
4072+
main ()
4073+
{
4074+
4075+
;
4076+
return 0;
4077+
}
4078+
_ACEOF
4079+
rm -f conftest.$ac_objext
4080+
if { (ac_try="$ac_compile"
4081+
case "(($ac_try" in
4082+
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4083+
*) ac_try_echo=$ac_try;;
4084+
esac
4085+
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
4086+
(eval "$ac_compile") 2>conftest.er1
4087+
ac_status=$?
4088+
grep -v '^ *+' conftest.er1 >conftest.err
4089+
rm -f conftest.er1
4090+
cat conftest.err >&5
4091+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
4092+
(exit $ac_status); } && {
4093+
test -z "$ac_c_werror_flag" ||
4094+
test ! -s conftest.err
4095+
} && test -s conftest.$ac_objext; then
4096+
{ echo "$as_me:$LINENO: result: yes" >&5
4097+
echo "${ECHO_T}yes" >&6; }
4098+
else
4099+
echo "$as_me: failed program was:" >&5
4100+
sed 's/^/| /' conftest.$ac_ext >&5
4101+
4102+
CFLAGS="$pgac_save_CFLAGS"
4103+
{ echo "$as_me:$LINENO: result: no" >&5
4104+
echo "${ECHO_T}no" >&6; }
4105+
fi
4106+
40574107
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
40584108

40594109
elif test "$ICC" = yes; then

configure.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,8 @@ if test "$GCC" = yes -a "$ICC" = no; then
433433
PGAC_PROG_CC_CFLAGS_OPT([-fno-strict-aliasing])
434434
# Disable optimizations that assume no overflow; needed for gcc 4.3+
435435
PGAC_PROG_CC_CFLAGS_OPT([-fwrapv])
436+
# Disable FP optimizations that cause various errors on gcc 4.5+ or maybe 4.6+
437+
PGAC_PROG_CC_CFLAGS_OPT([-fexcess-precision=standard])
436438
elif test "$ICC" = yes; then
437439
# Intel's compiler has a bug/misoptimization in checking for
438440
# division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS.

0 commit comments

Comments
 (0)
0