1 2016-10-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
3 * io/transfer.c (finalize_transfer): Free format data in child
4 procedures. (st_read_done, st_write_done): Don't free format
7 2016-10-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
10 * io/io.h: Move size_used from dtp to unit structure. Add bool
11 has_size to unit structure.
12 * io/read.c (read_x): Use has_size and size_used.
13 * io/transfer.c (read_sf_internal,read_sf,read_block_form,
14 read_block_form4): Likewise.
15 (data_transfer_init): If parent, initialize the size variables.
16 (finalize_transfer): Set the size variable using size_used in
17 gfc_unit. (write_block): Delete bogus/dead code.
19 2016-10-16 Janne Blomqvist <jb@gcc.gnu.org>
22 * io/transfer.c (data_transfer_init): Improve error message,
23 remove redundant check.
25 2016-10-15 Janne Blomqvist <jb@gcc.gnu.org>
28 * io/io.h (get_unique_unit_number): Remove prototype.
29 (newunit_alloc): New prototype.
30 * io/open.c (st_open): Call newunit_alloc.
31 * io/unit.c (newunits,newunit_size,newunit_lwi): New static
33 (GFC_FIRST_NEWUNIT): Rename to NEWUNIT_START.
34 (next_available_newunit): Remove variable.
35 (get_unit): Call newunit_alloc, don't try to create negative
37 (close_unit_1): Call newunit_free.
38 (close_units): Free newunits array.
39 (get_unique_number): Remove function.
40 (newunit_alloc): New function.
41 (newunit_free): New function.
42 * io/transfer.c (data_transfer_init): Check for invalid unit
45 2016-10-09 Janne Blomqvist <jb@gcc.gnu.org>
48 * io/io.h: TEMP_FAILURE_RETRY: Define macro if not found.
49 * io/unix.c (raw_read): Handle EINTR.
50 (raw_write): Check for return value -1.
51 (raw_seek): Handle EINTR.
54 (raw_truncate): Likewise.
55 (raw_close): Likewise.
56 (buf_flush): Call raw_seek instead of lseek.
58 (buf_write): Likewise.
59 (fd_to_stream): Handle EINTR.
60 (tempfile_open): Likewise.
61 (regular_file2): Likewise.
62 (compare_file_filename): Likewise.
63 (find_file): Likewise.
64 (inquire_sequential): Likewise.
65 (inquire_direct): Likewise.
66 (inquire_formatted): Likewise.
68 2016-10-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
71 * io/inquire.c (inquire_via_unit): NULL guard the check for
72 internal unit passed into child IO procedure.
74 2016-10-04 Jerry DeLisle <jvdelisle@gcc.gnu.org>
76 * io/inquire.c (inquire_via_unit): Add check for internal unit
77 passed into child IO procedure.
79 2016-10-01 Andre Vehreschild <vehre@gcc.gnu.org>
82 * caf/single.c (caf_internal_error): Fix not terminating va-list.
83 (_gfortran_caf_register): Free memory also when other allocs failed.
84 (_gfortran_caf_get_by_ref): Fixed style.
85 (send_by_ref): Token is now stored at the correct position preventing
86 inaccessible tokens, memory loss and possibly crashes.
88 2016-09-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
91 io/transfer.c (next_record): Flush before calculating next_record.
94 2016-09-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
97 * io/inquire.c (inquire_via_unit): Adjust error check for the
98 two possible internal unit KINDs.
99 * io/io.h: Adjust defines for is_internal_unit and
100 is_char4_unit. (gfc_unit): Add internal unit data to structure.
101 (get_internal_unit): Change declaration to set_internal_unit.
102 (free_internal_unit): Change name to stash_internal_unit_number.
103 (get_unique_unit_number): Adjust parameter argument.
104 Define IOPARM_DT_HAS_UDTIO. (gfc_saved_unit): New structure.
105 * io/list_read.c (next_char_internal): Use is_char4_unit.
106 * io/open.c (st_open): Adjust call to get_unique_unit_number.
107 * io/transfer.c (write_block): Use is_char4_unit.
108 (data_transfer_init): Update check for unit numbers.
109 (st_read_done): Free the various allocated memories used for the
110 internal units and stash the negative unit number and pointer to unit
111 structure to allow reuse. (st_write_done): Likewise stash the freed
113 * io/unit.c: Create a fixed size buffer of 16 gfc_saved_unit's to use
114 as a stack to save newunit unit numbers and unit structure for reuse.
115 (get_external_unit): Change name to get_gfc_unit to better
116 reflect what it does. (find_unit): Change call to get_gfc_unit.
117 (find_or_create_unit): Likewise. (get_internal_unit): Change
118 name to set_internal_unit. Move internal unit from the dtp
119 structure to the gfc_unit structure so that it can be passed to
120 child I/O statements through the UNIT.
121 (free_internal_unit): Change name to stash_internal_unit_number.
122 Push the common.unit number onto the newunit stack, saving it
123 for possible reuse later. (get_unit): Set the internal unit
124 KIND. Use get_unique_unit_number to get a negative unit number
125 for the internal unit. Use get_gfc_unit to get the unit structure
126 and use set_internal_unit to initialize it.
127 (init_units): Initialize the newunit stack.
128 (get_unique_unit_number): Check the stack for an available unit
129 number and use it. If none there get the next most negative
130 number. (close_units): Free any unit structures pointed to from the save
133 2016-09-21 Janne Blomqvist <jb@gcc.gnu.org>
135 * intrinsics/random.c (getosrandom): Use rand_s() on
136 MinGW-w64. Fix bounds overflow in fallback code.
138 2016-09-19 Andre Vehreschild <vehre@gcc.gnu.org>
140 * caf/libcaf.h: Add caf_reference_type.
141 * caf/mpi.c: Adapted signature of caf_register().
142 * caf/single.c (struct caf_single_token): Added to keep the pointer
143 to the memory registered and array descriptor.
144 (caf_internal_error): Added convenience interface.
145 (_gfortran_caf_register): Adapted to work with caf_single_token and
146 return memory in the array descriptor.
147 (_gfortran_caf_deregister): Same.
148 (assign_char1_from_char4): Fixed style.
149 (convert_type): Fixed incorrect conversion.
150 (_gfortran_caf_get): Adapted to work with caf_single_token.
151 (_gfortran_caf_send): Same.
152 (_gfortran_caf_sendget): Same.
153 (copy_data): Added to stop repeating it in all _by_ref functions.
154 (get_for_ref): Recursive getting of coarray data using a chain of
156 (_gfortran_caf_get_by_ref): Driver for computing the memory needed for
157 the get and checking properties of the operation.
158 (send_by_ref): Same as get_for_ref but for sending data.
159 (_gfortran_caf_send_by_ref): Same like caf_get_by_ref but for sending.
160 (_gfortran_caf_sendget_by_ref): Uses get_by_ref and send_by_ref to
161 implement sendget for reference chains.
162 (_gfortran_caf_atomic_define): Adapted to work with caf_single_token.
163 (_gfortran_caf_atomic_ref): Likewise.
164 (_gfortran_caf_atomic_cas): Likewise.
165 (_gfortran_caf_atomic_op): Likewise.
166 (_gfortran_caf_event_post): Likewise.
167 (_gfortran_caf_event_wait): Likewise.
168 (_gfortran_caf_event_query): Likewise.
169 (_gfortran_caf_lock): Likewise.
170 (_gfortran_caf_unlock): Likewise.
172 2016-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
175 * ieee/ieee_arithmetic.F90 (IEEE_VALUE_4,IEEE_VALUE_8,IEEE_VALULE_10,
176 IEEE_VALUE_16): Use correct keyword.
178 2016-09-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
181 * io/write_float.def (build_float_string): Recognize when the
182 result will not fit in the user provided, star fill, and exit
185 2016-08-31 Jerry DeLisle <jvdelisle@gcc.gnu.org>
188 * io/write.c (kind_from_size): New function to calculate required buffer
189 size based on kind type. (select_buffer, select_string): Use new
190 function. (write_float_0, write_real, write_real_g0, write_complex):
191 Adjust calls to pass parameters needed by new function.
193 2016-08-31 Jerry DeLisle <jvdelisle@gcc.gnu.org>
194 Paul Thomas <pault@gcc.gnu.org>
197 * gfortran.map : Flag _st_set_nml_dtio_var and
198 _gfortran_transfer_derived.
199 * io/format.c (format_lex): Detect DTIO formatting.
200 (parse_format_list): Parse the DTIO format.
201 (next_format): Include FMT_DT.
202 * io/format.h : Likewise. Add structure 'udf' to structure
203 'fnode' to carry the IOTYPE string and the 'vlist'.
204 * io/io.h : Add prototypes for the two types of DTIO subroutine
205 and a typedef for gfc_class. Also, add to 'namelist_type'
206 fields for the pointer to the DTIO procedure and the vtable.
207 Add fields to struct st_parameter_dt for pointers to the two
208 types of DTIO subroutine. Add to gfc_unit DTIO specific fields.
209 (internal_proto): Add prototype for 'read_user_defined' and
210 'write_user_defined'.
211 * io/list_read.c (check_buffers): Use the 'current_unit' field.
212 (unget_char): Likewise.
213 (eat_spaces): Likewise.
214 (list_formatted_read_scalar): For case BT_CLASS, call the DTIO
216 (nml_get_obj_data): Likewise when DTIO procedure is present,.
217 * io/transfer.c : Export prototypes for 'transfer_derived' and
218 'transfer_derived_write'.
219 (unformatted_read): For case BT_CLASS, call the DTIO procedure.
220 (unformatted_write): Likewise.
221 (formatted_transfer_scalar_read): Likewise.
222 (formatted_transfer_scalar_write: Likewise.
223 (transfer_derived): New function.
224 (data_transfer_init): Set last_char if no child_dtio.
225 (finalize_transfer): Return if child_dtio set.
226 (st_write_done): Add condition for child_dtio not set.
227 Add extra arguments for st_set_nml_var prototype.
228 (set_nml_var): New function that contains the contents of the
229 old version of st_set_nml_var. Also sets the 'dtio_sub' and
230 'vtable' fields of the 'nml' structure.
231 (st_set_nml_var): Now just calls set_nml_var with 'dtio_sub'
233 (st_set_nml_dtio_var): New function that calls set_nml_var.
234 * io/unit.c (get_external_unit): If the found unit child_dtio
235 is non zero, don't do any mutex locking/unlocking. Just
237 * io/unix.c (tempfile_open): Revert to C style comment.
238 * io/write.c (list_formatted_write_scalar): Do the DTIO call.
239 (nml_write_obj): Add BT_CLASS and do the DTIO call.
241 2016-08-29 Nathan Sidwell <nathan@acm.org>
243 * configure.ac (nvptx-*): Hardwire newlib.
244 * configure: Rebuilt.
246 2016-08-19 Janne Blomqvist <jb@gcc.gnu.org>
248 * intrinsics/random.c (xor_keys): New array with "secret" keys.
249 (scramble_seed): XOR given seed with xor_keys array rather than
251 (unscramble_seed): Remove function.
252 (random_seed_i4): Use new scramble_seed.
253 (random_seed_i8): Likewise.
255 2016-08-19 Janne Blomqvist <jb@gcc.gnu.org>
257 * intrinsics/random.c (master_init): New variable.
258 (init_rand_state): Move below getosrandom (), maybe initialize
260 (random_seed_i4): If called with no arguments, set master_init to
261 false, and reinitialize. If called with PUT=, set master_init to
263 (random_seed_i8): Likewise.
265 2016-08-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
267 * intrinsics/random.c: Include <stdlib.h>.
269 2016-08-11 Janne Blomqvist <jb@gcc.gnu.org>
271 * intrinsics/random.c: Replace KISS with xorshift1024* using
273 * runtime/main.c (init): Don't call random_seed_i4.
275 2016-07-22 Andre Vehreschild <vehre@gcc.gnu.org>
277 * caf/libcaf.h: Add parameter stat to caf_get() and
278 caf_send()'s function prototypes.
279 * caf/single.c (_gfortran_caf_get): Implement reporting
280 error using stat instead of abort().
281 (_gfortran_caf_send): Same.
282 (_gfortran_caf_sendget): Use NULL for stat when calling
285 2016-06-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
288 * io/write.c: Cleaned up whitespace.
289 (write_d, write_e, write_f, write_es, write_en): Use new helper
290 function write_float_0.
291 (write_float_0): New helper function.
292 (get_precision, select_buffer, select_string, write_float_string): New
293 helper functions used in remaining float writing functions.
294 Helper function write_float_string now contains code for writing
295 to kind=4 character internal units.
296 (write_real): Modified to establish working buffers at this level
297 and to use new helper functions.
298 (write_real_g0): Likewise modified.
299 (write_complex): Likewise modified. Gets both float strings before
300 output so that final lengths can be determined which allows right
301 justifying the complex number with no intervening spaces.
302 * io/write_float.def (build_float_string): Renamed from previosly
303 output_float, modified to use buffers passed in from higher functions,
304 builds a null terminated string of the floating point value. Character
305 kind=4 code eliminated.
306 (write_infnan): Likewise modified to use incoming buffers and eliminate
308 (OUTPUT_FLOAT_FMT_G): Deleted, functionality moved into FORMAT_FLOAT.
309 (FORMAT_FLOAT): Renamed macro from WRITE_FLOAT. Use build_float_string.
310 (get_float_string): Renamed from write_float, uses FORMAT_FLOAT macro.
311 Buffer allocation removed, now at higher level.
313 2016-05-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
316 * io/list_read (eat_spaces): Eat '\r' as part of spaces.
318 2016-04-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>
321 * io/list_read (check_buffers): Add '\r' to check for end of line.
323 2016-03-30 Jerry DeLisle <jvdelisle@gcc.gnu.org>
324 Dominique d'Humieres <dominiq@lps.ens.fr>
327 * io/write_float.def: Fix PF format for negative values of the scale
330 2016-03-28 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
332 * caf/libcaf.h: caf_stop_numeric and caf_stop_str prototype.
333 * caf/single.c: _gfortran_caf_stop_numeric and
334 _gfortran_caf_stop_str implementation.
336 2016-02-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
339 * io/list_read.c (read_real): If digit is missing from exponent issue
340 an error. (parse_real): Likewise and adjusted error message to clarify
341 it is part of a complex number.
342 (nml_read_obj): Bump item count and add comment that this is used to
343 identify which item in a namelist read has a problem.
345 2016-02-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
348 * io/list_read.c (push_char4): Fix the pointer usage for xrealloc.
350 2016-02-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
353 * io/list_read.c: Entire file trailing spaces removed.
354 (CASE_SEPARATORS): Remove '!'.
355 (is_separator): Add namelist mode as condition with '!'.
356 (push_char): Remove un-needed memset. (push_char4): Likewise and remove
357 'new' pointer. (eat_separator): Remove un-needed use of notify_std.
358 (read_logical): If '!' bang encountered when not in namelist mode got
359 bad_logical to give an error. (read_integer): Likewise reject '!'.
360 (read_character): Remove condition testing c = '!' which is now inside
361 the is_separator macro. (parse_real): Reject '!' unless in namelist mode.
362 (read_complex): Reject '!' unless in namelist mode. (read_real): Likewise
365 2016-02-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
368 * io/list_read.c (read_character): Remove code related to DELIM_NONE.
370 2016-01-23 John David Anglin <danglin@gcc.gnu.org>
373 * runtime/backtrace.c: Include gthr.h.
374 (show_backtrace): Use __gthread_active_p() to determine whether threads
375 are active. Return if lbstate is NULL.
377 2016-01-15 Jakub Jelinek <jakub@redhat.com>
379 * intrinsics/execute_command_line.c (set_cmdstat): Use "%s", msg
380 instead of msg to avoid -Wformat-security warning.
382 2016-01-04 Jakub Jelinek <jakub@redhat.com>
384 Update copyright years.
386 Copyright (C) 2016 Free Software Foundation, Inc.
388 Copying and distribution of this file, with or without modification,
389 are permitted in any medium without royalty provided the copyright
390 notice and this notice are preserved.