This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[gfortran,patch] Fix code generated for NINT
- From: FX Coudert <fxcoudert at gmail dot com>
- To: GFORTRAN list <fortran at gcc dot gnu dot org>, GCC-patches list <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 31 Jul 2007 22:31:12 +0100
- Subject: [gfortran,patch] Fix code generated for NINT
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:to:message-id:content-type:from:subject:date:x-mailer; b=nSxI0WabVQ5kYIR/j+ZULSBiInUc0W23Ff/a5S16ecouAhE0/Bha5asAdlqBLlgI7fbTEahH8rup0nbWuA+heGIBXx3vvEhBEKZE9NFKqoEgcl7GcylL9UyFmqcP1pdonobnOXH0jFoXyu6wNrMBu4gB04OQ/8B8RRN9cNuFGzI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:to:message-id:content-type:from:subject:date:x-mailer; b=NhzHCLCHL6z9tyNzkdBoiWMXLKHdP5/OFcHZjjVf+Ngzld9y1W+gNFcnt6q41OE2sojU3dv7kBjgbTr1g40LMuoVXrqUNFRgqgAHnXT8YlwzXINnR0BlErQsgSNTxJ71X4BOPpsimQMP4YfYakIDAaO1t5Rp2UTROTvmgEJj0MM=
Attached patch fixes PR31202 by correcting the code generated for
calls to the intrinsic NINT (and ANINT). Instead of adding 0.5 and
rounding by casting into an integer, we simply call the lround (or
llround) functions. A fallback implementation of these functions is
provided for libgfortran.
I've bootstrapped and regtested on x86_64-linux, but I'd be glad if
someone with a platform without full C99 support, and especiall
lround, could test it. I once had access to a sparc-solaris2.9,
which fulfilled these criteria, but not more.
OK for mainline?
:ADDPATCH 31202:Attachment:
nint.ChangeLog
Description: Binary data
Attachment:
nint.diff
Description: Binary data