2018-01-07 11:17:52 +01:00
|
|
|
|
2018-01-07 Janne Blomqvist <jb@gcc.gnu.org>
|
|
|
|
|
|
|
|
|
|
PR fortran/78534
|
|
|
|
|
PR fortran/83704
|
|
|
|
|
* io/fbuf.c (fbuf_init): Use size_t instead of int for length.
|
|
|
|
|
(fbuf_debug): Convert debug output to unsigned long.
|
|
|
|
|
(fbuf_reset): Use ptrdiff_t for return value.
|
|
|
|
|
(fbuf_alloc): Use size_t for length argument.
|
|
|
|
|
(fbuf_flush): Handle large buffers.
|
|
|
|
|
(fbuf_flush_list): Likewise.
|
|
|
|
|
(fbuf_seek): Use ptrdiff_t for offset and return value.
|
|
|
|
|
(fbuf_read): Use size_t for length argument.
|
|
|
|
|
(fbuf_getc_refill): Use size_t to match fbuf_read.
|
|
|
|
|
* io/fbuf.h (struct fbuf): Use size_t for lengths.
|
|
|
|
|
(fbuf_init): Use size_t instead of int for length.
|
|
|
|
|
(fbuf_reset): Use ptrdiff_t for return value.
|
|
|
|
|
(fbuf_alloc): Use size_t for length argument.
|
|
|
|
|
(fbuf_seek): Use ptrdiff_t for offset and return value.
|
|
|
|
|
(fbuf_read): Use size_t for length argument.
|
|
|
|
|
* io/io.h (read_block_form): Likewise.
|
|
|
|
|
(read_block_form4): Likewise.
|
|
|
|
|
(write_block): Likewise.
|
|
|
|
|
(read_a): Likewise.
|
|
|
|
|
(read_a_char4): Likewise.
|
|
|
|
|
(read_x): Likewise.
|
|
|
|
|
(write_a): Likewise.
|
|
|
|
|
(write_a_char4): Likewise.
|
|
|
|
|
* io/list_read.c (list_formatted_read_scalar): Use size_t to
|
|
|
|
|
handle large buffers.
|
|
|
|
|
* io/read.c (read_l): Likewise.
|
|
|
|
|
(read_utf8): Likewise.
|
|
|
|
|
(read_utf8_char1): Likewise.
|
|
|
|
|
(read_default_char1): Likewise.
|
|
|
|
|
(read_utf8_char4): Likewise.
|
|
|
|
|
(read_default_char4): Likewise.
|
|
|
|
|
(read_a): Likewise.
|
|
|
|
|
(read_a_char4): Likewise.
|
|
|
|
|
(eat_leading_spaces): Likewise.
|
|
|
|
|
(next_char): Likewise.
|
|
|
|
|
(read_decimal): Likewise.
|
|
|
|
|
(read_radix): Likewise.
|
|
|
|
|
(read_f): Likewise.
|
|
|
|
|
(read_x): Likewise.
|
|
|
|
|
* io/transfer.c (read_sf_internal): Likewise.
|
|
|
|
|
(read_sf): Likewise.
|
|
|
|
|
(read_block_form): Likewise.
|
|
|
|
|
(read_block_form4): Likewise.
|
|
|
|
|
(write_block): Likewise.
|
|
|
|
|
(formatted_transfer_scalar_write): Likewise.
|
|
|
|
|
(next_record_w): Likewise.
|
|
|
|
|
* io/unix.c (mem_alloc_r): Likewise.
|
|
|
|
|
(mem_alloc_r4): Likewise.
|
|
|
|
|
(mem_alloc_w): Likewise.
|
|
|
|
|
(mem_alloc_w4): Likewise.
|
|
|
|
|
(mem_read): Likewise.
|
|
|
|
|
(mem_read4): Likewise.
|
|
|
|
|
(mem_write): Likewise.
|
|
|
|
|
(mem_write4): Likewise.
|
|
|
|
|
(open_internal): Likewise.
|
|
|
|
|
(open_internal4): Likewise.
|
|
|
|
|
* io/unix.h (open_internal): Likewise.
|
|
|
|
|
(open_internal4): Likewise.
|
|
|
|
|
(mem_alloc_w): Likewise.
|
|
|
|
|
(mem_alloc_r): Likewise.
|
|
|
|
|
(mem_alloc_w4): Likewise.
|
|
|
|
|
(mem_alloc_r4): Likewise.
|
|
|
|
|
* io/write.c (write_check_cc): Likewise.
|
|
|
|
|
(write_cc): Likewise.
|
|
|
|
|
(write_a): Likewise.
|
|
|
|
|
(write_a_char4): Likewise.
|
|
|
|
|
|
2018-01-06 20:16:55 +01:00
|
|
|
|
2018-01-06 Janne Blomqvist <jb@gcc.gnu.org>
|
|
|
|
|
|
|
|
|
|
* io/write.c (namelist_write): Remove unused variable "i".
|
|
|
|
|
|
2018-01-06 20:09:52 +01:00
|
|
|
|
2018-01-06 Dominique d'Humieres <dominiq@lps.ens.fr>
|
|
|
|
|
Janne Blomqvist <jb@gcc.gnu.org>
|
|
|
|
|
|
|
|
|
|
PR fortran/83704
|
|
|
|
|
* io/write.c (write_character): Use size_t instead of int for
|
|
|
|
|
length.
|
|
|
|
|
|
2018-01-06 20:16:55 +01:00
|
|
|
|
2018-01-05 Janne Blomqvist <jb@gcc.gnu.org>
|
2018-01-06 11:42:57 +01:00
|
|
|
|
|
|
|
|
|
PR fortran/78534
|
|
|
|
|
* intrinsics/args.c (getarg_i4): Use gfc_charlen_type.
|
|
|
|
|
(get_command_argument_i4): Likewise.
|
|
|
|
|
(get_command_i4): Likewise.
|
|
|
|
|
* intrinsics/chmod.c (chmod_internal): Likewise.
|
|
|
|
|
* intrinsics/env.c (get_environment_variable_i4): Likewise.
|
|
|
|
|
* intrinsics/extends_type_of.c (struct vtype): Use size_t for size
|
|
|
|
|
member.
|
|
|
|
|
* intrinsics/gerror.c (gerror): Use gfc_charlen_type.
|
|
|
|
|
* intrinsics/getlog.c (getlog): Likewise.
|
|
|
|
|
* intrinsics/hostnm.c (hostnm_0): Likewise.
|
|
|
|
|
* intrinsics/string_intrinsics_inc.c (string_len_trim): Rework to
|
|
|
|
|
work if gfc_charlen_type is unsigned.
|
|
|
|
|
(string_scan): Likewise.
|
|
|
|
|
* io/transfer.c (transfer_character): Modify prototype.
|
|
|
|
|
(transfer_character_write): Likewise.
|
|
|
|
|
(transfer_character_wide): Likewise.
|
|
|
|
|
(transfer_character_wide_write): Likewise.
|
|
|
|
|
(transfer_array): Typecast to avoid signed-unsigned comparison.
|
|
|
|
|
* io/unit.c (is_trim_ok): Use gfc_charlen_type.
|
|
|
|
|
* io/write.c (namelist_write): Likewise.
|
|
|
|
|
* libgfortran.h (gfc_charlen_type): Change typedef to size_t.
|
|
|
|
|
|
2018-01-03 11:03:58 +01:00
|
|
|
|
2018-01-03 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
Update copyright years.
|
|
|
|
|
|
PR libgfortran/83649 Chunk large reads and writes
It turns out that Linux never reads or writes more than 2147479552
bytes in a single syscall. For writes this is not a problem as
libgfortran already contains a loop around write() to handle short
writes. But for reads we cannot do this, since then read will hang if
we have a short read when reading from the terminal. Also, there are
reports that macOS fails I/O's larger than 2 GB. Thus, to work around
these issues do large reads/writes in chunks.
The testcase from the PR
program largewr
integer(kind=1) :: a(2_8**31+1)
a = 0
a(size(a, kind=8)) = 1
open(10, file="largewr.dat", access="stream", form="unformatted")
write (10) a
close(10)
a(size(a, kind=8)) = 2
open(10, file="largewr.dat", access="stream", form="unformatted")
read (10) a
if (a(size(a, kind=8)) == 1) then
print *, "All is well"
else
print *, "Oh no"
end if
end program largewr
fails on trunk but works with the patch.
Regtested on x86_64-pc-linux-gnu, committed to trunk.
libgfortran/ChangeLog:
2018-01-02 Janne Blomqvist <jb@gcc.gnu.org>
PR libgfortran/83649
* io/unix.c (MAX_CHUNK): New define.
(raw_read): For reads larger than MAX_CHUNK, loop.
(raw_write): Write no more than MAX_CHUNK bytes per iteration.
From-SVN: r256074
2018-01-02 14:25:10 +01:00
|
|
|
|
2018-01-02 Janne Blomqvist <jb@gcc.gnu.org>
|
|
|
|
|
|
|
|
|
|
PR libgfortran/83649
|
|
|
|
|
* io/unix.c (MAX_CHUNK): New define.
|
|
|
|
|
(raw_read): For reads larger than MAX_CHUNK, loop.
|
|
|
|
|
(raw_write): Write no more than MAX_CHUNK bytes per iteration.
|
2016-01-04 15:30:50 +01:00
|
|
|
|
|
2018-01-03 11:03:58 +01:00
|
|
|
|
Copyright (C) 2018 Free Software Foundation, Inc.
|
2010-01-04 09:59:59 +01:00
|
|
|
|
|
|
|
|
|
Copying and distribution of this file, with or without modification,
|
|
|
|
|
are permitted in any medium without royalty provided the copyright
|
|
|
|
|
notice and this notice are preserved.
|