gcc/libgfortran/io
Jakub Jelinek 4e5ca7ff8c libfortran: Fix up boz_15.f90 on powerpc64le with -mabi=ieeelongdouble [PR106079]
The boz_15.f90 test FAILs on powerpc64le-linux when -mabi=ieeelongdouble
is used (either default through --with-long-double-format=ieee or
when used explicitly).
The problem is that the read/write transfer routines are called with
BT_REAL (or BT_COMPLEX) type and kind 17 which is magic we use to say
it is the IEEE quad real(kind=16) rather than the IBM double double
real(kind=16).  For the floating point input/output we then handle kind
17 specially, but for B/O/Z we just treat the bytes of the floating point
value as binary blob and using 17 in that case results in unexpected
behavior, for write it means we don't estimate right how many chars we'll
need and print ******************** etc. rather than what we should, and
even with explicit size we'd print one further byte than intended.
For read it would even mean overwriting some unrelated byte after the
floating point object.

Fixed by using 16 instead of 17 in the read_radix and write_{b,o,z} calls.

2022-08-01  Jakub Jelinek  <jakub@redhat.com>

	PR libfortran/106079
	* io/transfer.c (formatted_transfer_scalar_read,
	formatted_transfer_scalar_write): For type BT_REAL with kind 17
	change kind to 16 before calling read_radix or write_{b,o,z}.

(cherry picked from commit 82ac4cd213)
2022-08-03 11:22:05 +02:00
..
async.c Update copyright years. 2022-01-03 10:42:10 +01:00
async.h Update copyright years. 2022-01-03 10:42:10 +01:00
close.c Update copyright years. 2022-01-03 10:42:10 +01:00
fbuf.c Update copyright years. 2022-01-03 10:42:10 +01:00
fbuf.h Update copyright years. 2022-01-03 10:42:10 +01:00
file_pos.c Implement CONVERT specifier for OPEN. 2022-01-11 23:49:52 +01:00
format.c Update copyright years. 2022-01-03 10:42:10 +01:00
format.h Update copyright years. 2022-01-03 10:42:10 +01:00
inquire.c Implement CONVERT specifier for OPEN. 2022-01-11 23:49:52 +01:00
intrinsics.c Update copyright years. 2022-01-03 10:42:10 +01:00
io.h fortran, libgfortran: -mabi=ieeelongdouble I/O 2022-01-11 23:49:48 +01:00
list_read.c Update copyright years. 2022-01-03 10:42:10 +01:00
lock.c Update copyright years. 2022-01-03 10:42:10 +01:00
open.c Implement CONVERT specifier for OPEN. 2022-01-11 23:49:52 +01:00
read.c fortran, libgfortran: Assorted -mabi=ieeelongdouble I/O fixes 2022-01-11 23:49:49 +01:00
size_from_kind.c fortran, libgfortran: -mabi=ieeelongdouble I/O 2022-01-11 23:49:48 +01:00
transfer128.c fortran, libgfortran: -mabi=ieeelongdouble I/O 2022-01-11 23:49:48 +01:00
transfer.c libfortran: Fix up boz_15.f90 on powerpc64le with -mabi=ieeelongdouble [PR106079] 2022-08-03 11:22:05 +02:00
unit.c Update copyright years. 2022-01-03 10:42:10 +01:00
unix.c Update copyright years. 2022-01-03 10:42:10 +01:00
unix.h Update copyright years. 2022-01-03 10:42:10 +01:00
write_float.def libgfortran: -mabi=ieeelongdouble I/O fix 2022-01-11 23:49:49 +01:00
write.c fortran, libgfortran: -mabi=ieeelongdouble I/O 2022-01-11 23:49:48 +01:00