Skip to content

Commit dcc0d8d

Browse files
committed
work around optimisation bugs for rint
1 parent 39bfc46 commit dcc0d8d

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

Make.inc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ CFLAGS_add += -std=c99 -Wall -I$(OPENLIBM_HOME) -I$(OPENLIBM_HOME)/include -I$(O
4949

5050
default: all
5151

52+
# *int / *intf need to be built with -O0
53+
src/%int.c.o: src/%int.c
54+
$(CC) $(CPPFLAGS) -O0 $(CFLAGS_add) -c $< -o $@
55+
56+
src/%intf.c.o: src/%intf.c
57+
$(CC) $(CPPFLAGS) -O0 $(CFLAGS_add) -c $< -o $@
58+
5259
%.c.o: %.c
5360
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add) -c $< -o $@
5461

@@ -78,14 +85,7 @@ override ARCH := amd64
7885
endif
7986

8087
# The optimization flag may be overriden with the environment variable CFLAGS.
81-
ifeq ($(ARCH),powerpc)
82-
# tests hang at higher optimization levels
83-
CFLAGS ?= -O0
84-
else if ($(ARCH),arm)
85-
CFLAGS ?= -O0
86-
else
8788
CFLAGS ?= -O2
88-
endif
8989

9090
ifneq (,$(findstring MINGW,$(OS)))
9191
override OS=WINNT

test/libm-test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4443,7 +4443,7 @@ main (int argc, char **argv)
44434443
/* Nearest integer functions: */
44444444
ceil_test ();
44454445
floor_test ();
4446-
//nearbyint_test ();
4446+
nearbyint_test ();
44474447
rint_test ();
44484448
lrint_test ();
44494449
llrint_test ();

0 commit comments

Comments
 (0)