[libgfortran,patch] Changes to mk-kinds-h.sh

FX Coudert fxcoudert@gmail.com
Tue Oct 9 21:26:00 GMT 2007


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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: kinds.ChangeLog
Type: application/octet-stream
Size: 288 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20071009/94569a73/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kinds.diff
Type: application/octet-stream
Size: 3464 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20071009/94569a73/attachment-0001.obj>


More information about the Fortran mailing list