configure: add GCC option -fexcess-precision=standard
This option forces GCC to follow the ISO C standards concerning rounding of intermediate FP results. It avoids some FP issues with the x86 32 bits ports of OCaml, which can run into excess precision problems due to the x87 FP unit. Closes: #7917master
parent
743ca1baff
commit
c5afa9303d
|
@ -12506,7 +12506,8 @@ case $host in #(
|
|||
gcc-*) :
|
||||
internal_cflags="-Wno-unused $gcc_warnings"
|
||||
# TODO: see whether the code can be fixed to avoid -Wno-unused
|
||||
common_cflags="-O2 -fno-strict-aliasing -fwrapv -mms-bitfields"
|
||||
common_cflags="-O2 -fno-strict-aliasing -fwrapv \
|
||||
-fexcess-precision=standard -mms-bitfields"
|
||||
internal_cppflags='-DUNICODE -D_UNICODE'
|
||||
internal_cppflags="$internal_cppflags -DWINDOWS_UNICODE="
|
||||
internal_cppflags="${internal_cppflags}\$(WINDOWS_UNICODE)" ;; #(
|
||||
|
@ -12534,12 +12535,18 @@ $as_echo "$as_me: WARNING: This version of GCC is rather old.
|
|||
$as_echo "$as_me: WARNING: Consider using GCC version 4.2 or above." >&2;};
|
||||
common_cflags="-std=gnu99 -O";
|
||||
internal_cflags="$gcc_warnings" ;; #(
|
||||
gcc-4-*) :
|
||||
common_cflags="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv \
|
||||
gcc-4-234) :
|
||||
# No -fexcess-precision option before GCC 4.5
|
||||
common_cflags="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv \
|
||||
-fno-builtin-memcmp";
|
||||
internal_cflags="$gcc_warnings" ;; #(
|
||||
gcc-4-*) :
|
||||
common_cflags="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv \
|
||||
-fno-builtin-memcmp -fexcess-precision=standard";
|
||||
internal_cflags="$gcc_warnings" ;; #(
|
||||
gcc-*) :
|
||||
common_cflags="-O2 -fno-strict-aliasing -fwrapv";
|
||||
common_cflags="-O2 -fno-strict-aliasing -fwrapv \
|
||||
-fexcess-precision=standard";
|
||||
internal_cflags="$gcc_warnings -fno-common" ;; #(
|
||||
msvc-*) :
|
||||
common_cflags="-nologo -O2 -Gy- -MD"
|
||||
|
|
13
configure.ac
13
configure.ac
|
@ -561,7 +561,8 @@ AS_CASE([$host],
|
|||
[gcc-*],
|
||||
[internal_cflags="-Wno-unused $gcc_warnings"
|
||||
# TODO: see whether the code can be fixed to avoid -Wno-unused
|
||||
common_cflags="-O2 -fno-strict-aliasing -fwrapv -mms-bitfields"
|
||||
common_cflags="-O2 -fno-strict-aliasing -fwrapv \
|
||||
-fexcess-precision=standard -mms-bitfields"
|
||||
internal_cppflags='-DUNICODE -D_UNICODE'
|
||||
internal_cppflags="$internal_cppflags -DWINDOWS_UNICODE="
|
||||
internal_cppflags="${internal_cppflags}\$(WINDOWS_UNICODE)"],
|
||||
|
@ -583,12 +584,18 @@ AS_CASE([$host],
|
|||
AC_MSG_WARN([Consider using GCC version 4.2 or above.]);
|
||||
common_cflags="-std=gnu99 -O";
|
||||
internal_cflags="$gcc_warnings"],
|
||||
[gcc-4-*],
|
||||
[gcc-4-[234]],
|
||||
# No -fexcess-precision option before GCC 4.5
|
||||
[common_cflags="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv \
|
||||
-fno-builtin-memcmp";
|
||||
internal_cflags="$gcc_warnings"],
|
||||
[gcc-4-*],
|
||||
[common_cflags="-std=gnu99 -O2 -fno-strict-aliasing -fwrapv \
|
||||
-fno-builtin-memcmp -fexcess-precision=standard";
|
||||
internal_cflags="$gcc_warnings"],
|
||||
[gcc-*],
|
||||
[common_cflags="-O2 -fno-strict-aliasing -fwrapv";
|
||||
[common_cflags="-O2 -fno-strict-aliasing -fwrapv \
|
||||
-fexcess-precision=standard";
|
||||
internal_cflags="$gcc_warnings -fno-common"],
|
||||
[msvc-*],
|
||||
[common_cflags="-nologo -O2 -Gy- -MD"
|
||||
|
|
Loading…
Reference in New Issue