]> granicus.if.org Git - graphviz/commitdiff
stop enabling -ffast-math on any platform
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 12 Oct 2022 04:10:54 +0000 (21:10 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 13 Oct 2022 00:01:33 +0000 (17:01 -0700)
The `-ffast-math` compiler option enables a mode of floating point semantics
that are heavily relaxed from strict IEEE 754 conformance in the name of speed.¹
The permissible optimizations under `-ffast-math` include transformations that
produce floating point results most users would consider wrong. It is unclear
why “do math fast but incorrectly” is a useful mode. It seems the world is
finally coming around to this tenet.²

This change stops enabling `-ffast-math` anywhere in the Autotools build system.

Gitlab: fixes #1412, #2296
Reported-by: Kasper Daniel Hansen
Reported-by: Ross Barnowski
¹ https://gcc.gnu.org/wiki/FloatingPointMath
² https://simonbyrne.github.io/notes/fastmath/,
  https://moyix.blogspot.com/2022/09/someones-been-messing-with-my-subnormals.html

CHANGELOG.md
configure.ac

index 2a8265b46f4e0fcb7a732f19ac0ef8696283687d..c3cf7ddcb67a3001cfdfa2d1ef57f7e34d3d0725 100644 (file)
@@ -18,6 +18,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
   no longer suppresses `-ffast-math`. Users relying on this are encouraged to
   investigate what in their build environment is appending a flag their C
   compiler does not support.
+- The `-ffast-math` compiler flag is no longer enabled by the Autotools build
+  system.
+
+### Fixed
+
+- Issues with GCC 8, `-O3` and `-ffast-math` #1412
+- Problem building Graphviz-5.0.1: undefined symbols `__*_finite` #2296
 
 ### Removed
 
index 49dd28cefd3a7daf628b736e378bbc422a77b22a..33febee1a55b3d4fdaeb54186e51174ca0c7d145 100644 (file)
@@ -396,10 +396,10 @@ else
                LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names"
                ;;
            *-freebsd* )
-               CFLAGS="${CFLAGS} -Wstrict-prototypes -Wpointer-arith -Wall -ffast-math"
+               CFLAGS="${CFLAGS} -Wstrict-prototypes -Wpointer-arith -Wall"
                    ;;
            * )
-               CFLAGS="${CFLAGS} -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wall -ffast-math"
+               CFLAGS="${CFLAGS} -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wall"
                ;;
            esac
            ;;