This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/41711] [F2008] BOZ format does not support reading large kind reals
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Dec 2009 14:43:39 -0000
- Subject: [Bug libfortran/41711] [F2008] BOZ format does not support reading large kind reals
- References: <bug-41711-10743@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #21 from burnus at gcc dot gnu dot org 2009-12-07 14:43 -------
(In reply to comment #20)
> Dominique's idea is good. Let's go to that (comment #14) for now and leave
> the rest as enhancement. This would be a great project for a new volunteer. > Anyone interested. I am willing to provide guidance. :)
Going with comment 14 is trivial: The following program works with the patch
below. Now one only needs to modify the test case such that it also works on
real(kind=16) systems (for "{ dg-require-effective-target fortran_large_real
}") and one needs to bootstrap/regtest.
implicit none
character(len=30) :: str
integer(16) :: i16
real(10) :: r10
str = ' 4002A000000000000000'
print '(a)', str
read(str,'(z30)') i16
read(str,'(z30)') r10
print '(z30)', i16
print '(z30)', r10
end
Index: libgfortran/io/read.c
===================================================================
--- libgfortran/io/read.c (revision 155032)
+++ libgfortran/io/read.c (working copy)
@@ -45,6 +45,8 @@ set_integer (void *dest, GFC_INTEGER_LAR
switch (length)
{
#ifdef HAVE_GFC_INTEGER_16
+/* length=10 comes about for kind=10 real/complex BOZ, cf. PR41711. */
+ case 10:
case 16:
{
GFC_INTEGER_16 tmp = value;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41711