Skip to content

Commit 0ebbba6

Browse files
committed
Tell gcc to avoid floating point contraction
On ppc64el Ubuntu, gcc was using fmadd instead of fmul which caused '-459.67 °F' to be parsed as '-8.18283712394279 fK' instead of plain '0 K'. The same problem with Reaumur could be fixed by adding extra precision digits to the numbers in the temperature.sql file, but that didn't work for °F. Turn add/mul contraction off for the nicer-looking result.
1 parent 891daf0 commit 0ebbba6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ DATA_built = unit--2--3.sql unit--3.sql
88
REGRESS = extension tables unit prefix units temperature functions derived compare aggregate iec custom
99
EXTRA_CLEAN = unitparse.yy.* powers powers.o unit-*.dump # unitparse.tab.*
1010

11+
# avoid add/mult contraction so '-459.67 °F' is really '0 K'
12+
# problem visible on ppc64el Ubuntu trusty..zesty (Debian unaffected)
13+
PG_CPPFLAGS += -ffp-contract=off
14+
1115
PG_CONFIG = pg_config
1216
PGXS := $(shell $(PG_CONFIG) --pgxs)
1317
include $(PGXS)

0 commit comments

Comments
 (0)