This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[libgfortran,patch] Changes to mk-kinds-h.sh
- From: FX Coudert <fxcoudert at gmail dot com>
- To: Fortran List <fortran at gcc dot gnu dot org>, gcc-patches list <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 9 Oct 2007 22:26:07 +0100
- Subject: [libgfortran,patch] Changes to mk-kinds-h.sh
- Dkim-signature: v=1; a=rsa-sha256; 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; bh=6oXwv368ImY7KQJqjp8qOqOuKRoqppMasoRdMArW/Mk=; b=K11phsz11p6I9RqZ3TnrtoVtV3n6KdCqWpuraFqGNn8/5/LfqGqcRLJepm4n+GJY4/aegruCmWyVVyTi3gxE2q3mQGC9T6IA8rd0SGUI5eSSERqNkbbebG/dnpfJ32CJ/9vkxUIa5xPmR1BVJ6sLLNORvWLaQHlSskByUyMNd/o=
- 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=tmG4mAforXid1EtnsDwb96OqAreV9yBU6P/P+I7artwq/Pbu1ucY8tDMdg1VE+D2RG7k0AXZVHU0QR69tfRrITBQOw68Whj3wmn3C1RzMLmelBrc/xtK8cW4z+VwfH54KyCpSIAtG0k56sa23ttxn+St4Jms/ec3hR8F426ahYk=
After some time working on real(kind=16), I realized that on PowerPC
and MIPS, it so happens that HUGE(0._16) is not equal to LDBL_MAX.
(See http://gcc.gnu.org/ml/fortran/2007-09/msg00466.html for
details.) libgfortran currently use LDBL_MAX, leading to wrong code
for {MAX,MIN}{VAL,LOC} intrinsics.
This patch fixes this by moving the definitions GFC_REAL_*_HUGE from
libgfortran.h to the generated kinds.h header file. I do this by
compiling a testcase with HUGE(0._${kind}), using -fdump-parse-tree
and scanning the output.
I also moved GFC_REAL_*_DIGITS and GFC_REAL_*_RADIX there, ad removed
GFC_REAL_LARGEST_FORMAT and GFC_REAL_LARGEST which aren't used any
more since Jerry's "per-kind I/O" patch.
Bootstrapped and regtested on x86_64-linux; regtesting did raise a
few ICEs, obviously not related to the library change (I also
regtested an unrelated front-end patch at that time), but I'll make
sure to do a clean testing before I commit. OK to commit?
FX
Attachment:
kinds.ChangeLog
Description: Binary data
Attachment:
kinds.diff
Description: Binary data