New I/O specifiers CARRIAGECONTROL, READONLY, SHARE with -fdec.
[official-gcc.git] / libgfortran / ChangeLog
blob107372340ed13103530d0dc05cf6ea96e10c74d5
1 2016-10-26  Fritz Reese  <fritzoreese@gmail.com>
3         * libgfortran.h (IOPARM_OPEN_HAS_READONLY, IOPARM_OPEN_HAS_SHARE,
4         IOPARM_OPEN_HAS_CC): New for READONLY, SHARE, and CARRIAGECONTROL.
5         * io/close.c (st_close): Support READONLY.
6         * io/io.h (st_parameter_open, unit_flags): Support SHARE,
7         CARRIAGECONTROL, and READONLY.
8         * io/open.c (st_open): Ditto.
9         * io/transfer.c (data_transfer_init): Ditto.
10         * io/io.h (st_parameter_dt): New member 'cc' for CARRIAGECONTROL.
11         * io/write.c (write_check_cc, write_cc): New functions for
12         CARRIAGECONTROL.
13         * io/transfer.c (next_record_cc): Ditto.
14         * io/file_pos.c (st_endfile): Support SHARE and CARRIAGECONTROL.
15         * io/io.h (st_parameter_inquire): Ditto.
16         * io/open.c (edit_modes, new_unit): Ditto.
17         * io/inquire.c (inquire_via_unit, inquire_via_filename): Ditto.
18         * io/io.h (unit_share, unit_cc, cc_fortran, IOPARM_INQUIRE_HAS_SHARE,
19         IOPARM_INQUIRE_HAS_CC): New for SHARE and CARRIAGECONTROL.
20         * io/open.c (share_opt, cc_opt): Ditto.
21         * io/read.c (read_x): Support CARRIAGECONTROL.
22         * io/transfer.c (read_sf, next_record_r, next_record_w): Ditto.
23         * io/write.c (list_formatted_write_scalar, write_a): Ditto.
24         * io/unix.h (close_share): New prototype.
25         * io/unix.c (open_share, close_share): New functions to handle SHARE.
26         * io/unix.c (open_external): Handle READONLY. Call open_share.
27         * io/close.c (st_close): Call close_share.
29 2016-10-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
31         PR fortran/77828
32         * io/io.h (st_parameter_dt): Reorder for readability and sanity.
33         * io/transfer.c (data_transfer_init): Remove TODO and enable the
34         runtime error message, rec= specifier not allowed in STREAM
35         access.
36         * libtool-version: Bump major version of libgfortran to 4.
38 2016-10-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
40         PR libfortran/78055
41         * io/io.h (st_parameter_dt): Restore GFC_IO_INT to maintain
42         alignment.
44 2016-10-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
46         * io/transfer.c (finalize_transfer): Free format data in child
47         procedures. (st_read_done, st_write_done): Don't free format
48         hash table.
50 2016-10-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
52         PR fortran/48298
53         * io/io.h: Move size_used from dtp to unit structure. Add bool
54         has_size to unit structure.
55         * io/read.c (read_x): Use has_size and size_used.
56         * io/transfer.c (read_sf_internal,read_sf,read_block_form,
57         read_block_form4): Likewise.
58         (data_transfer_init): If parent, initialize the size variables.
59         (finalize_transfer): Set the size variable using size_used in
60         gfc_unit. (write_block): Delete bogus/dead code.
62 2016-10-16  Janne Blomqvist  <jb@gcc.gnu.org>
64         PR libfortran/48587
65         * io/transfer.c (data_transfer_init): Improve error message,
66         remove redundant check.
68 2016-10-15  Janne Blomqvist  <jb@gcc.gnu.org>
70         PR libfortran/48587
71         * io/io.h (get_unique_unit_number): Remove prototype.
72         (newunit_alloc): New prototype.
73         * io/open.c (st_open): Call newunit_alloc.
74         * io/unit.c (newunits,newunit_size,newunit_lwi): New static
75         variables.
76         (GFC_FIRST_NEWUNIT): Rename to NEWUNIT_START.
77         (next_available_newunit): Remove variable.
78         (get_unit): Call newunit_alloc, don't try to create negative
79         external unit.
80         (close_unit_1): Call newunit_free.
81         (close_units): Free newunits array.
82         (get_unique_number): Remove function.
83         (newunit_alloc): New function.
84         (newunit_free): New function.
85         * io/transfer.c (data_transfer_init): Check for invalid unit
86         number.
88 2016-10-09  Janne Blomqvist  <jb@gcc.gnu.org>
90         PR libfortran/67585
91         * io/io.h: TEMP_FAILURE_RETRY: Define macro if not found.
92         * io/unix.c (raw_read): Handle EINTR.
93         (raw_write): Check for return value -1.
94         (raw_seek): Handle EINTR.
95         (raw_tell): Likewise.
96         (raw_size): Likewise.
97         (raw_truncate): Likewise.
98         (raw_close): Likewise.
99         (buf_flush): Call raw_seek instead of lseek.
100         (buf_read): Likewise.
101         (buf_write): Likewise.
102         (fd_to_stream): Handle EINTR.
103         (tempfile_open): Likewise.
104         (regular_file2): Likewise.
105         (compare_file_filename): Likewise.
106         (find_file): Likewise.
107         (inquire_sequential): Likewise.
108         (inquire_direct): Likewise.
109         (inquire_formatted): Likewise.
111 2016-10-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
113         PR fortran/77868
114         * io/inquire.c (inquire_via_unit): NULL guard the check for
115         internal unit passed into child IO procedure.
117 2016-10-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
119         * io/inquire.c (inquire_via_unit): Add check for internal unit
120         passed into child IO procedure.
122 2016-10-01  Andre Vehreschild  <vehre@gcc.gnu.org>
124         PR fortran/77663
125         * caf/single.c (caf_internal_error): Fix not terminating va-list.
126         (_gfortran_caf_register): Free memory also when other allocs failed.
127         (_gfortran_caf_get_by_ref): Fixed style.
128         (send_by_ref): Token is now stored at the correct position preventing
129         inaccessible tokens, memory loss and possibly crashes.
131 2016-09-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
133         PR libgfortran/77707
134         io/transfer.c (next_record): Flush before calculating next_record.
135         Correctly calculate.
137 2016-09-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
139         PR libgfortran/48298
140         * io/inquire.c (inquire_via_unit): Adjust error check for the
141         two possible internal unit KINDs.
142         * io/io.h: Adjust defines for is_internal_unit and
143         is_char4_unit. (gfc_unit): Add internal unit data to structure.
144         (get_internal_unit): Change declaration to set_internal_unit.
145         (free_internal_unit): Change name to stash_internal_unit_number.
146         (get_unique_unit_number): Adjust parameter argument.
147         Define IOPARM_DT_HAS_UDTIO. (gfc_saved_unit): New structure.
148         * io/list_read.c (next_char_internal): Use is_char4_unit.
149         * io/open.c (st_open): Adjust call to get_unique_unit_number.
150         * io/transfer.c (write_block): Use is_char4_unit.
151         (data_transfer_init): Update check for unit numbers.
152         (st_read_done): Free the various allocated memories used for the
153         internal units and stash the negative unit number and pointer to unit
154         structure to allow reuse. (st_write_done): Likewise stash the freed
155         unit.
156         * io/unit.c: Create a fixed size buffer of 16 gfc_saved_unit's to use
157         as a stack to save newunit unit numbers and unit structure for reuse.
158         (get_external_unit): Change name to get_gfc_unit to better
159         reflect what it does. (find_unit): Change call to get_gfc_unit.
160         (find_or_create_unit): Likewise. (get_internal_unit): Change
161         name to set_internal_unit. Move internal unit from the dtp
162         structure to the gfc_unit structure so that it can be passed to
163         child I/O statements through the UNIT.
164         (free_internal_unit): Change name to stash_internal_unit_number.
165         Push the common.unit number onto the newunit stack, saving it
166         for possible reuse later. (get_unit): Set the internal unit
167         KIND. Use get_unique_unit_number to get a negative unit number
168         for the internal unit. Use get_gfc_unit to get the unit structure
169         and use set_internal_unit to initialize it.
170         (init_units): Initialize the newunit stack.
171         (get_unique_unit_number): Check the stack for an available unit
172         number and use it. If none there get the next most negative
173         number. (close_units): Free any unit structures pointed to from the save
174         stack.
176 2016-09-21  Janne Blomqvist  <jb@gcc.gnu.org>
178         * intrinsics/random.c (getosrandom): Use rand_s() on
179         MinGW-w64. Fix bounds overflow in fallback code.
181 2016-09-19  Andre Vehreschild  <vehre@gcc.gnu.org>
183         * caf/libcaf.h: Add caf_reference_type.
184         * caf/mpi.c: Adapted signature of caf_register().
185         * caf/single.c (struct caf_single_token): Added to keep the pointer
186         to the memory registered and array descriptor.
187         (caf_internal_error): Added convenience interface.
188         (_gfortran_caf_register): Adapted to work with caf_single_token and
189         return memory in the array descriptor.
190         (_gfortran_caf_deregister): Same.
191         (assign_char1_from_char4): Fixed style.
192         (convert_type): Fixed incorrect conversion.
193         (_gfortran_caf_get): Adapted to work with caf_single_token.
194         (_gfortran_caf_send): Same.
195         (_gfortran_caf_sendget): Same.
196         (copy_data): Added to stop repeating it in all _by_ref functions.
197         (get_for_ref): Recursive getting of coarray data using a chain of
198         references.
199         (_gfortran_caf_get_by_ref): Driver for computing the memory needed for
200         the get and checking properties of the operation.
201         (send_by_ref): Same as get_for_ref but for sending data.
202         (_gfortran_caf_send_by_ref): Same like caf_get_by_ref but for sending.
203         (_gfortran_caf_sendget_by_ref): Uses get_by_ref and send_by_ref to
204         implement sendget for reference chains.
205         (_gfortran_caf_atomic_define): Adapted to work with caf_single_token.
206         (_gfortran_caf_atomic_ref): Likewise.
207         (_gfortran_caf_atomic_cas): Likewise.
208         (_gfortran_caf_atomic_op): Likewise.
209         (_gfortran_caf_event_post): Likewise.
210         (_gfortran_caf_event_wait): Likewise.
211         (_gfortran_caf_event_query): Likewise.
212         (_gfortran_caf_lock): Likewise.
213         (_gfortran_caf_unlock): Likewise.
215 2016-09-09  Steven G. Kargl  <kargl@gcc.gnu.org>
217         PR fortran/77507
218         * ieee/ieee_arithmetic.F90 (IEEE_VALUE_4,IEEE_VALUE_8,IEEE_VALULE_10,
219         IEEE_VALUE_16):  Use correct keyword.
221 2016-09-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
223         PR libgfortran/77393
224         * io/write_float.def (build_float_string): Recognize when the
225         result will not fit in the user provided, star fill, and exit
226         early.
228 2016-08-31  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
230         PR libgfortran/77393
231         * io/write.c (kind_from_size): New function to calculate required buffer
232         size based on kind type. (select_buffer, select_string): Use new
233         function. (write_float_0, write_real, write_real_g0, write_complex):
234         Adjust calls to pass parameters needed by new function.
236 2016-08-31  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
237         Paul Thomas  <pault@gcc.gnu.org>
239         PR libgfortran/48298
240         * gfortran.map : Flag _st_set_nml_dtio_var and
241         _gfortran_transfer_derived.
242         * io/format.c (format_lex): Detect DTIO formatting.
243         (parse_format_list): Parse the DTIO format.
244         (next_format): Include FMT_DT.
245         * io/format.h : Likewise. Add structure 'udf' to structure
246         'fnode' to carry the IOTYPE string and the 'vlist'.
247         * io/io.h : Add prototypes for the two types of DTIO subroutine
248         and a typedef for gfc_class. Also, add to 'namelist_type'
249         fields for the pointer to the DTIO procedure and the vtable.
250         Add fields to struct st_parameter_dt for pointers to the two
251         types of DTIO subroutine. Add to gfc_unit DTIO specific fields.
252         (internal_proto): Add prototype for 'read_user_defined' and
253         'write_user_defined'.
254         * io/list_read.c (check_buffers): Use the 'current_unit' field.
255         (unget_char): Likewise.
256         (eat_spaces): Likewise.
257         (list_formatted_read_scalar): For case BT_CLASS, call the DTIO
258         procedure.
259         (nml_get_obj_data): Likewise when DTIO procedure is present,.
260         * io/transfer.c : Export prototypes for 'transfer_derived' and
261         'transfer_derived_write'.
262         (unformatted_read): For case BT_CLASS, call the DTIO procedure.
263         (unformatted_write): Likewise.
264         (formatted_transfer_scalar_read): Likewise.
265         (formatted_transfer_scalar_write: Likewise.
266         (transfer_derived): New function.
267         (data_transfer_init): Set last_char if no child_dtio.
268         (finalize_transfer): Return if child_dtio set.
269         (st_write_done): Add condition for child_dtio not set.
270         Add extra arguments for st_set_nml_var prototype.
271         (set_nml_var): New function that contains the contents of the
272         old version of st_set_nml_var. Also sets the 'dtio_sub' and
273         'vtable' fields of the 'nml' structure.
274         (st_set_nml_var): Now just calls set_nml_var with 'dtio_sub'
275         and 'vtable' NULL.
276         (st_set_nml_dtio_var): New function that calls set_nml_var.
277         * io/unit.c (get_external_unit): If the found unit child_dtio
278         is non zero, don't do any mutex locking/unlocking.  Just
279         return the unit.
280         * io/unix.c (tempfile_open): Revert to C style comment.
281         * io/write.c (list_formatted_write_scalar): Do the DTIO call.
282         (nml_write_obj): Add BT_CLASS and do the DTIO call.
284 2016-08-29  Nathan Sidwell  <nathan@acm.org>
286         * configure.ac (nvptx-*): Hardwire newlib.
287         * configure: Rebuilt.
289 2016-08-19  Janne Blomqvist  <jb@gcc.gnu.org>
291         * intrinsics/random.c (xor_keys): New array with "secret" keys.
292         (scramble_seed): XOR given seed with xor_keys array rather than
293         shuffling bytes.
294         (unscramble_seed): Remove function.
295         (random_seed_i4): Use new scramble_seed.
296         (random_seed_i8): Likewise.
298 2016-08-19  Janne Blomqvist  <jb@gcc.gnu.org>
300         * intrinsics/random.c (master_init): New variable.
301         (init_rand_state): Move below getosrandom (), maybe initialize
302         master_state.
303         (random_seed_i4): If called with no arguments, set master_init to
304         false, and reinitialize. If called with PUT=, set master_init to
305         true.
306         (random_seed_i8): Likewise.
308 2016-08-11  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
310         * intrinsics/random.c: Include <stdlib.h>.
312 2016-08-11  Janne Blomqvist  <jb@gcc.gnu.org>
314         * intrinsics/random.c: Replace KISS with xorshift1024* using
315         per-thread state.
316         * runtime/main.c (init): Don't call random_seed_i4.
318 2016-07-22  Andre Vehreschild  <vehre@gcc.gnu.org>
320         * caf/libcaf.h: Add parameter stat to caf_get() and
321         caf_send()'s function prototypes.
322         * caf/single.c (_gfortran_caf_get): Implement reporting
323         error using stat instead of abort().
324         (_gfortran_caf_send): Same.
325         (_gfortran_caf_sendget): Use NULL for stat when calling
326         caf_send().
328 2016-06-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
330         PR libgfortran/48852
331         * io/write.c: Cleaned up whitespace.
332         (write_d, write_e, write_f, write_es, write_en): Use new helper
333         function write_float_0.
334         (write_float_0): New helper function.
335         (get_precision, select_buffer, select_string, write_float_string): New
336         helper functions used in remaining float writing functions.
337         Helper function write_float_string now contains code for writing
338         to kind=4 character internal units.
339         (write_real): Modified to establish working buffers at this level
340         and to  use new helper functions.
341         (write_real_g0): Likewise modified.
342         (write_complex): Likewise modified. Gets both float strings before
343         output so that final lengths can be determined which allows right
344         justifying the complex number with no intervening spaces.
345         * io/write_float.def (build_float_string): Renamed from previosly
346         output_float, modified to use buffers passed in from higher functions,
347         builds a null terminated string of the floating point value. Character
348         kind=4 code eliminated.
349         (write_infnan): Likewise modified to use incoming buffers and eliminate
350         kind=4 related code.
351         (OUTPUT_FLOAT_FMT_G): Deleted, functionality moved into FORMAT_FLOAT.
352         (FORMAT_FLOAT): Renamed macro from WRITE_FLOAT. Use build_float_string.
353         (get_float_string): Renamed from write_float, uses FORMAT_FLOAT macro.
354         Buffer allocation removed, now at higher level.
356 2016-05-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
358         PR libgfortran/71123
359         * io/list_read (eat_spaces): Eat '\r' as part of spaces.
361 2016-04-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
363         PR libgfortran/70684
364         * io/list_read (check_buffers): Add '\r' to check for end of line.
366 2016-03-30  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
367             Dominique d'Humieres  <dominiq@lps.ens.fr>
369         PR libgfortran/70235
370         * io/write_float.def: Fix PF format for negative values of the scale
371         factor.
373 2016-03-28  Alessandro Fanfarillo  <fanfarillo.gcc@gmail.com>
375         * caf/libcaf.h: caf_stop_numeric and caf_stop_str prototype.
376         * caf/single.c: _gfortran_caf_stop_numeric and
377         _gfortran_caf_stop_str implementation.
379 2016-02-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
381         PR libgfortran/69456
382         * io/list_read.c (read_real): If digit is missing from exponent issue
383         an error. (parse_real): Likewise and adjusted error message to clarify
384         it is part of a complex number.
385         (nml_read_obj): Bump item count and add comment that this is used to
386         identify which item in a namelist read has a problem.
388 2016-02-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
390         PR libgfortran/69651
391         * io/list_read.c (push_char4): Fix the pointer usage for xrealloc.
393 2016-02-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
395         PR libgfortran/69651
396         * io/list_read.c: Entire file trailing spaces removed.
397         (CASE_SEPARATORS): Remove '!'.
398         (is_separator): Add namelist mode as condition with '!'.
399         (push_char): Remove un-needed memset. (push_char4): Likewise and remove
400         'new' pointer. (eat_separator): Remove un-needed use of notify_std.
401         (read_logical): If '!' bang encountered when not in namelist mode got
402         bad_logical to give an error. (read_integer): Likewise reject '!'.
403         (read_character): Remove condition testing c = '!' which is now inside
404         the is_separator macro. (parse_real): Reject '!' unless in namelist mode.
405         (read_complex): Reject '!' unless in namelist mode. (read_real): Likewise
406         reject '!'.
408 2016-02-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
410         PR libgfortran/69668
411         * io/list_read.c (read_character): Remove code related to DELIM_NONE.
413 2016-01-23  John David Anglin  <danglin@gcc.gnu.org>
415         PR libfortran/68744
416         * runtime/backtrace.c: Include gthr.h.
417         (show_backtrace): Use __gthread_active_p() to determine whether threads
418         are active.  Return if lbstate is NULL.
420 2016-01-15  Jakub Jelinek  <jakub@redhat.com>
422         * intrinsics/execute_command_line.c (set_cmdstat): Use "%s", msg
423         instead of msg to avoid -Wformat-security warning.
425 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
427         Update copyright years.
429 Copyright (C) 2016 Free Software Foundation, Inc.
431 Copying and distribution of this file, with or without modification,
432 are permitted in any medium without royalty provided the copyright
433 notice and this notice are preserved.