Date: Wed, 11 Jan 2017 17:26:26 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-arm@FreeBSD.org Subject: [Bug 215977] clang on armv6 incorrectly emits call to sincos() Message-ID: <bug-215977-7@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D215977 Bug ID: 215977 Summary: clang on armv6 incorrectly emits call to sincos() Product: Base System Version: CURRENT Hardware: arm OS: Any Status: New Severity: Affects Some People Priority: --- Component: arm Assignee: freebsd-arm@FreeBSD.org Reporter: jiashiun@gmail.com Created attachment 178761 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D178761&action= =3Dedit Example program to reproduce incorrect clang -fast-math behavior on armv6 Originally discussed on freebsd-arm@ https://lists.freebsd.org/pipermail/freebsd-arm/2017-January/015318.html On armv6/12-current as of base r311687, clang command "cc -O1 -ffast-math" optimizes adjacent calls to sin() and cos() to emits calls to nonexistent function sincos(), resulting in linker error "undefined reference to `sinco= s'". Example program sincos.c attached.=20 % uname -a FreeBSD rpi2 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r311687: Tue Jan 10 21:36= :16 CST 2017=20=20=20=20 jsli@4cbsd:/personal/freebsd/obj/x64/arm.armv6/personal/freebsd/fbsdsrc/sys= /RPI2 arm % cc --version FreeBSD clang version 3.9.1 (tags/RELEASE_391/final 289601) (based on LLVM 3.9.1) Target: armv6--freebsd12.0-gnueabihf Thread model: posix InstalledDir: /usr/bin % cc -O1 -ffast-math -lm sincos.c /tmp/sincos-767f23.o: In function `main': sincos.c:(.text+0x2c): undefined reference to `sincos' cc: error: linker command failed with exit code 1 (use -v to see invocation) % cc -O1 -fno-fast-math -lm sincos.c % cc -O0 -ffast-math -lm sincos.c % --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-215977-7>