From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1DAE53854813; Tue, 8 Dec 2020 17:36:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1DAE53854813 From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/98201] CSQRT function gives bad resuts at runtime Date: Tue, 08 Dec 2020 17:36:39 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 9.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2020 17:36:40 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98201 kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org --- Comment #7 from kargl at gcc dot gnu.org --- (In reply to dpozar from comment #3) > Thomas, >=20 > compile time works fine; runtime not so good. > dave >=20 So, maybe not a gfortran problem. % gfcx -o z -fdump-tree-original a.f90 % grep csqrt a.f90.004t.original=20 sq =3D __builtin_csqrtf (z); % nm z | grep sqrt U csqrtf@@FBSD_1.1 'sq =3D csqrt(z)' is compiled to 'sq =3D __builtin_csqrtf (z);' and __builtin_csqrtf() is mapped to your math library's csqrtf() function. If your math library does not have csqrtf(), then=20 there is a fall back function in libgfortran. Looking at the fallback function shows a design flaw. Don't know if that you're problem.=