Subject: bin/145: gcc optimizer breaks __ieee754_hypot in libm
To: None <gnats-admin>
From: None <thomas@mathematik.uni-Bremen.de>
List: netbsd-bugs
Date: 03/01/1994 11:05:02
>Number: 145
>Category: bin
>Synopsis: gcc optimizer breaks __ieee754_hypot in libm
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: gnats-admin (Utility Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Mar 1 11:05:02 1994
>Originator: Thomas Eberhardt
>Organization:
CeVis, University of Bremen, Germany
>Release:
>Environment:
System: NetBSD ed209 0.9a ED209#0 i386
Machine: i386
>Description:
Compiling lib/libm/src/e_hypot.c with -O or -O2 gives bad code, i.e.
it calling hypot gives wrong results.
>How-To-Repeat:
call hypot(3.0, 4.0)
>Fix:
Until another release of gcc becomes available that is considered
stable, compile e_hypot.c without any optimizations:
*** lib/libm/Makefile- Sat Feb 26 11:55:15 1994
--- lib/libm/Makefile Tue Mar 1 19:42:52 1994
***************
*** 90,94 ****
--- 90,109 ----
MLINKS+=lgamma.3 gamma.3
MLINKS+=sqrt.3 cbrt.3
+ e_hypot.o:
+ ${CC} -D_MULTI_LIBM -D_POSIX_MODE -c ${.IMPSRC}
+ @${LD} -x -r ${.TARGET}
+ @mv a.out ${.TARGET}
+
+ e_hypot.po:
+ ${CC} -p -D_MULTI_LIBM -D_POSIX_MODE -c ${.IMPSRC} -o ${.TARGET}
+ @${LD} -X -r ${.TARGET}
+ @mv a.out ${.TARGET}
+
+ e_hypot.so:
+ ${CC} ${PICFLAG} -DPIC -D_MULTI_LIBM -D_POSIX_MODE -c ${.IMPSRC} -o ${.TARGET}
+ @${LD} -x -r ${.TARGET}
+ @mv a.out ${.TARGET}
+
.include <bsd.lib.mk>
>Audit-Trail:
>Unformatted:
------------------------------------------------------------------------------