From owner-freebsd-arm@freebsd.org Wed Jan 11 17:26:26 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFA35CAB10B for ; Wed, 11 Jan 2017 17:26:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B58F9104E for ; Wed, 11 Jan 2017 17:26:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v0BHQQ8b089140 for ; Wed, 11 Jan 2017 17:26:26 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-arm@FreeBSD.org Subject: [Bug 215977] clang on armv6 incorrectly emits call to sincos() Date: Wed, 11 Jan 2017 17:26:26 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: arm X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: jiashiun@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-arm@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 17:26:27 -0000 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.=