[Bug 215977] clang on armv6 incorrectly emits call to sincos()
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Wed Jan 11 17:26:27 UTC 2017
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215977
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 at FreeBSD.org
Reporter: jiashiun at gmail.com
Created attachment 178761
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=178761&action=edit
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 `sincos'".
Example program sincos.c attached.
% uname -a
FreeBSD rpi2 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r311687: Tue Jan 10 21:36:16
CST 2017
jsli at 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
%
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-arm
mailing list