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