2018-03-01 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / fortran / ChangeLog
blob742b83d096b896c8557611f8ef144cc2b118c2fa
1 2018-03-01  Paul Thomas  <pault@gcc.gnu.org>
3         PR fortran/84219
4         * target-memory.c (gfc_interpret_derived): Assert that BT_VOID
5         components are caf tokens.
6         (gfc_target_interpret_expr): Treat BT_VOID expressions as
7         integers.
9 2018-03-01  Paul Thomas  <pault@gcc.gnu.org>
11         PR fortran/84538
12         * class.c (class_array_ref_detected): Remove the condition that
13         there be no reference after the array reference.
14         (find_intrinsic_vtab): Remove excess whitespace.
15         * trans-array.c (gfc_conv_scalarized_array_ref): Rename 'tmp'
16         as 'base and call build_class_array_ref earlier.
18 2018-02-28  Paul Thomas  <pault@gcc.gnu.org>
20         PR fortran/83901
21         * trans-stmt.c (trans_associate_var): Make sure that the se
22         expression is a pointer type before converting it to the symbol
23         backend_decl type.
25 2018-02-25  Steven G. Kargl  <kargl@gcc.gnu.org>
27         PR fortran/83633
28         * decl.c (variable_decl): Check that an explicit-shape-array with
29         nonconstant bounds is allowed.
31 2018-02-25  Paul Thomas  <pault@gcc.gnu.org>
33         PR fortran/84523
34         * trans-intrinsic.c (gfc_conv_allocated): If the argument se
35         has a pre block, add it to the expression pre block.
37 2018-02-25  Thomas Koenig  <tkoenig@gcc.gnu.org>
39         PR fortran/78238
40         * gfortran.h (gfc_integer_4_kind): Define.
41         * resolve.c (resolve_select_type): Make sure that the
42         kind of c->high is gfc_integer_4_kind.
44 2018-02-24  Steven G. Kargl <kargl@gcc.gnu.org>
46         PR fortran/30792
47         * decl.c (gfc_match_data): Check for invalid substring in
48         data-implied-do
50 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
52         * intrinsic.texi: Arguments to MATMUL cannot both be rank one.
54 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
56         PR fortran/84511
57         * trans-io.c (transfer_expr): Deal with C_LOC in transfer statement.
59 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
61         PR fortran/84346
62         * interface.c (compare_actual_formal): Issue error if keyword is
63         used in a statement function.
65 2018-02-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
67         PR fortran/84506
68         * trans-io.c (set_parameter_value_inquire): Adjust range check of
69         negative unit values for kind=8 units to the kind=4 negative limit.
71 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
73         PR fortran/83149
74         * trans-types.c (gfc_sym_type): Test sym->ns->proc_name before
75         accessing its components.
77 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
79         PR fortran/83149
80         * trans-decl.c (gfc_finish_var_decl): Test sym->ns->proc_name
81         before accessing its components.
83 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
85         PR fortran/83148
86         * trans-const.c : Clean up some whitespace issues.
87         * trans-expr.c (gfc_conv_initializer): If an iso_c_binding
88         derived type has a kind value of zero, set it to the default
89         integer kind.
91 2018-02-23  Janne Blomqvist  <jb@gcc.gnu.org>
93         PR fortran/84519
94         * trans-decl.c (gfc_build_builtin_function_decls): Add bool
95         argument to stop and error stop decls.
96         * trans-stmt.c (gfc_trans_stop): Add false value to argument
97         lists.
99 2018-02-22  Janne Blomqvist  <jb@gcc.gnu.org>
101         PR 78534
102         PR 84509
103         * trans-decl.c (gfc_build_builtin_function_decls): Pass
104         gfc_int8_type node to pause_numeric, size_type_node to
105         pause_string.
106         * trans-stmt.c (gfc_trans_pause): Likewise.
108 2018-02-22  Janne Blomqvist  <jb@gcc.gnu.org>
110         * gfortran.texi: Update Coarray API description.
111         * trans-decl.c (gfc_build_builtin_function_decls): Use size_t for
112         character lengths, int for exit codes.
113         (generate_coarray_sym_init): Use size_t for character length.
114         * trans-intrinsic.c (conv_co_collective): Likewise.
115         * trans-stmt.c (gfc_trans_lock_unlock): Likewise.
116         (gfc_trans_event_post_wait): Likewise.
117         (gfc_trans_sync): Likewise.
118         (gfc_trans_stop): Use size_t for character lengths, int for exit
119         codes.
121 2018-02-20  Thomas Koenig  <tkoenig@gcc.gnu.org>
123         PR fortran/48890
124         PR fortran/83823
125         * primary.c (gfc_convert_to_structure_constructor):
126         For a constant string constructor, make sure the length
127         is correct.
129 2018-02-19  Paul Thomas  <pault@gcc.gnu.org>
131         PR fortran/83344
132         PR fortran/83975
133         * resolve.c (resolve_assoc_var): Rearrange the logic for the
134         determination of the character length of associate names. If
135         the associate name is missing a length expression or the length
136         expression is not a constant and the target is not a variable,
137         make the associate name allocatable and deferred length.
138         * trans-decl.c (gfc_get_symbol_decl): Null the character length
139         backend_decl for deferred length associate names that are not
140         variables. Set 'length' to gfc_index_zero_node for character
141         associate names, whose character length is a PARM_DECL.
143 2018-02-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
145         PR fortran/35339
146         * frontend-passes.c (traverse_io_block): Remove workaround for
147         PR 80945.
149 2018-02-19  Andre Vehreschild  <vehre@gcc.gnu.org>
151         * gfortran.texi: Document additional src/dst_type.  Fix some typos.
152         * trans-decl.c (gfc_build_builtin_function_decls): Declare the new
153         argument of _caf_*_by_ref () with * e { get, send, sendget }.
154         * trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Add the type of the
155         data referenced when generating a call to caf_get_by_ref ().
156         (conv_caf_send): Same but for caf_send_by_ref () and
157         caf_sendget_by_ref ().
159 2018-02-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
161         PR fortran/84389
162         * io.c (check_format): Allow FMT_COLON.
164 2018-02-18  Paul Thomas  <pault@gcc.gnu.org>
166         PR fortran/80945
167         * trans-array.c (gfc_conv_expr_descriptor): Set parmtype from
168         the typenode in the case of deferred length characters.
170 2018-02-17  Thomas Koenig  <tkoenig@gcc.gnu.org>
172         PR fortran/84270
173         * frontend-passes (scalarized_expr):  If the expression
174         is an assumed size array, leave in the last reference
175         and pass AR_SECTION instead of AR_FULL to gfc_resolve
176         in order to avoid an error.
178 2018-02-17  Paul Thomas  <pault@gcc.gnu.org>
180         PR fortran/84115
181         * resolve.c (resolve_assoc_var): If a non-constant target expr.
182         has no string length expression, make the associate variable
183         into a deferred length, allocatable symbol.
184         * trans-decl.c (gfc_is_reallocatable_lhs): Add and use a ptr to
185         the symbol.
186         * trans-stmt.c (trans_associate_var): Null and free scalar
187         associate names that are allocatable. After assignment, remove
188         the allocatable attribute to prevent reallocation.
190 2018-02-16  Jakub Jelinek  <jakub@redhat.com>
192         PR fortran/84418
193         * trans-openmp.c (gfc_trans_omp_clauses): For OMP_CLAUSE_LINEAR_REF
194         kind set OMP_CLAUSE_LINEAR_STEP to TYPE_SIZE_UNIT times last_step.
196 2018-02-16  Dominique d'Humieres  <dominiq@gcc.gnu.org>
198         PR fortran/84354
199         * decl.c (gfc_get_pdt_instance): Replace '%qs' with %qs.
201 2018-02-15  Janus Weil  <janus@gcc.gnu.org>
203         PR fortran/84409
204         * interface.c (check_dtio_arg_TKR_intent): Add a check for character
205         length.
207 2018-02-14  Janus Weil  <janus@gcc.gnu.org>
209         PR fortran/84385
210         * match.c (gfc_match_select_type): Fix check for selector in
211         SELECT TYPE statement.
213 2018-02-13  Janus Weil  <janus@gcc.gnu.org>
215         PR fortran/84313
216         * symbol.c (check_conflict): Reject procedure pointers in common blocks.
218 2018-02-13  Alastair McKinstry  <alastair.mckinstry@sceal.ie>
219             Janne Blomqvist  <jb@gcc.gnu.org>
221         * module.c (dump_module): Use lbasename to ensure that module
222         files are reproducible.
224 2018-02-12  Janus Weil  <janus@gcc.gnu.org>
226         PR fortran/84273
227         * resolve.c (resolve_component): Fix checks of passed argument in
228         procedure-pointer components.
230 2018-02-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
232         PR fortran/35299
233         * resolve.c (resolve_formal_arglist): Update error message.
235 2018-02-11  Andre Vehreschild  <vehre@gcc.gnu.org>
237         * gfortran.texi: Fix typos in documentation of caf_register ().
238         * trans-array.c (structure_alloc_comps): Only register a component of
239         a derived typed corray, not of an ultimate component coarray.
241 2018-02-11  Steven G. Kargl  <kargl@gcc.gnu.org>
243         PR fortran/54223
244         PR fortran/84276
245         * interface.c (compare_actual_formal): Add in_statement_function
246         bool parameter.  Skip check of INTENT attribute for statement
247         functions.  Arguments to a statement function cannot be optional,
248         issue error for missing argument.
249         (gfc_procedure_use, gfc_ppc_use, gfc_arglist_matches_symbol): Use
250          in_statement_function.
252 2018-02-11  Paul Thomas  <pault@gcc.gnu.org>
254         PR fortran/84074
255         * trans-expr.c (gfc_conv_derived_to_class): Set the use_offset
256         flag. If the is a vector subscript or the expression is not a
257         variable, make the descriptor one-based.
259 2018-02-10  Paul Thomas  <pault@gcc.gnu.org>
261         PR fortran/84141
262         PR fortran/84155
263         * trans-array.c (gfc_array_init_size): Revert the change made
264         in revision 257356 setting the dtype.
265         * trans-types.c (gfc_get_dtype): Do not use the cached dtype.
266         Call gfc_get_dtype_rank_type every time.
268         PR fortran/56691
269         * trans-array.c (gfc_conv_expr_descriptor): If the source array
270         is a descriptor type, use its offset, removing the condition
271         that is be a class expression.
273 2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>
275         PR fortran/82994
276         * match.c (gfc_match_deallocate): Check for NULL pointer.
278 2018-02-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
280         PR fortran/68560
281         * trans-intrinsic.c (gfc_conv_intrinsic_shape): New function.
282         (gfc_conv_intrinsic_function): Call it.
284 2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>
286         PR fortran/82049
287         * match.c (gfc_match_type_spec): If the charlen is non-NULL, then
288         try to resolve it.  While here return early if possible.
290 2018-02-04  Paul Thomas  <pault@gcc.gnu.org>
292         PR fortran/84115
293         * trans-decl.c (gfc_get_symbol_decl): Do not finish the decl of
294         'length' if the symbol charlen backend_decl is an indirect ref.
296 2018-02-03  Paul Thomas  <pault@gcc.gnu.org>
298         PR fortran/84141
299         PR fortran/84155
300         * trans-array.c (gfc_array_init_size): Instead of gfc_get_dtype
301         use gfc_get_dtype_rank_type.
303 2018-02-01  Janne Blomqvist  <jb@gcc.gnu.org>
305         PR 83975
306         PR 83344
307         * resolve.c (resolve_assoc_var): Generate an error if
308         target length unknown.
310 2018-02-01  Janne Blomqvist  <jb@gcc.gnu.org>
312         PR fortran/83705
313         * simplify.c (gfc_simplify_repeat): Increase limit for deferring
314         to runtime, print a warning message.
316 2018-01-31  Jakub Jelinek  <jakub@redhat.com>
318         PR fortran/84116
319         * openmp.c (gfc_match_omp_clauses): If all the linear
320         gfc_match_omp_variable_list calls failed, don't gfc_free_omp_namelist
321         nor set *head = NULL.  Formatting fixes.
323 2018-01-31  Paul Thomas  <pault@gcc.gnu.org>
325         PR fortran/84088
326         * trans-expr.c (gfc_conv_procedure_call): If the parm expr is
327         an address expression passed to an assumed rank dummy, convert
328         to an indirect reference.
330 2018-01-31  Thomas Koenig  <tkoenig@gcc.gnu.org>
332         * dump-parse-tree.c (write_proc): Use sym_name (which may
333         be sym->binding_label) instead of sym->name.
335 2018-01-31  Janne Blomqvist  <jb@gcc.gnu.org>
337         * trans-const.c (gfc_conv_string_init): Use gfc_charlen_t instead
338         of int for slen.
340 2018-01-31  Janne Blomqvist  <jb@gcc.gnu.org>
342         PR fortran/78534
343         * trans-expr.c (fill_with_spaces): Use memset instead of
344         generating loop.
345         (gfc_trans_string_copy): Improve opportunity to use builtins with
346         constant lengths.
348 2018-01-30  Jakub Jelinek  <jakub@redhat.com>
350         PR debug/84131
351         * trans-array.c (gfc_get_descriptor_offsets_for_info): Set *data_off
352         to DATA_FIELD's offset rather than OFFSET_FIELD's offset.
354 2018-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
356         PR fortran/84134
357         * array.c (gfc_ref_dimen_size): Whitespace fixes.  If stride is
358         zero, return false.
360 2018-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
362         PR fortran/84133
363         * frontend-passes (matmul_to_var_expr): Return early if
364         in association list.
365         (inline_matmul_assign): Likewise.
367 2017-01-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
369         PR fortran/84073
370         * resolve.c (resolve_component): Ensure BIND(C) character
371         components have length one.
372         (resolve_symbol): Likewise for variables.
374 2018-01-27  Jakub Jelinek  <jakub@redhat.com>
376         PR fortran/84065
377         * decl.c (add_init_expr_to_sym): Ignore initializers for too large
378         lengths.
380 2018-01-26  Damian Rouson  <damian@sourceryinstitute.org>
381             Alessandro Fanfarillo  <fanfarillo.gcc@gmail.com>
382             Soren Rasmussen  <s.c.rasmussen@gmail.com>
384         Partial support for Fortran 2018 teams features.
386         * array.c (gfc_match_array_ref): add team attribute in coarray
387         transfers.
388         * check.c (gfc_check_get_team, gfc_check_team_number): add new
389         functions for get_team and team_number.
390         * dump-parse-tree.c (show_code_node): add new statements: form team,
391         change team, end team, and sync team.
392         * expr.c (gfc_find_team_co): add new function.
393         * gfortran.h: add new statements.
394         * intrinsic.c (add_functions): add get_team and team_number functions.
395         * intrinsic.h: add get_team and team_number prototypes for check,
396         simplify, and resolve.
397         * iresolve.c (gfc_resolve_get_team, gfc_resolve_team_number): add new
398         functions.
399         * iso-fortran-env.def: add the team_type derived type.
400         * match.c (gfc_match_if, gfc_match_form_team, gfc_match_team_number)
401         (gfc_match_end_team, gfc_match_sync_team, gfc_match_change_team):
402         add change team, end team, form team, sync team match and functions.
403         * match.h: add new prototypes for change team, end team, form team,
404         and sync team.
405         * parse.c (decode_statement): add cases for change team, end team,
406         form team, and sync team.
407         * resolve.c: add cases for exec form team, change team, end team, and
408         sync team.
409         * simplify.c (gfc_simplify_get_team): add new function for get team.
410         * st.c (gfc_free_statement): add cases exec for change team, end team,
411         form team, sync team.
412         * trans-decl.c (gfor_fndecl_caf_form_team)
413         (gfor_fndecl_caf_change_team, gfor_fndecl_caf_end_team)
414         (gfor_fndecl_caf_sync_team, gfor_fndecl_caf_get_team)
415         (gfor_fndecl_caf_team_number): add functions and definitions.
416         * trans-intrinsic.c (conv_caf_send, conv_intrinsic_team_number): add
417         new function and team_type argument support.
418         * trans-stmt.c (gfc_trans_form_team, gfc_trans_change_team)
419         (gfc_trans_end_team, gfc_trans_sync_team): add new functions.
420         * trans-stmt.h: add new prototypes.
421         * trans-types.c (gfc_get_derived_type): check condition for team_type.
422         * trans.c (trans_code): new exec cases for form team, change team, end
423         team, and sync team.
424         * trans.h: add new prototypes.
426 2018-01-26  Steven G. Kargl  <kargl@gcc.gnu.org>
428         PR fortran/83998
429         * simplify.c (compute_dot_product):  Initialize result to INTEGER(1) 0
430         or .false.  The summation does the correct type conversion.
431         (gfc_simplify_dot_product): Special case zero-sized arrays.
433 2018-25-01  Paul Thomas  <pault@gcc.gnu.org>
435         PR fortran/37577
436         * array.c (gfc_match_array_ref): If standard earlier than F2008
437         it is an error if the reference dimension is greater than 7.
438         libgfortran.h : Increase GFC_MAX_DIMENSIONS to 15. Change the
439         dtype masks and shifts accordingly.
440         * trans-array.c (gfc_conv_descriptor_dtype): Use the dtype
441         type node to check the field.
442         (gfc_conv_descriptor_dtype): Access the rank field of dtype.
443         (duplicate_allocatable_coarray): Access the rank field of the
444         dtype descriptor rather than the dtype itself.
445         * trans-expr.c (get_scalar_to_descriptor_type): Store the type
446         of 'scalar' on entry and use its TREE_TYPE if it is ARRAY_TYPE
447         (ie. a character).
448         (gfc_conv_procedure_call): Pass TREE_OPERAND (tmp,0) to
449         get_scalar_to_descriptor_type if the actual expression is a
450         constant.
451         (gfc_trans_structure_assign): Assign the rank directly to the
452         dtype rank field.
453         * trans-intrinsic.c (gfc_conv_intrinsic_rank): Cast the result
454         to default integer kind.
455         (gfc_conv_intrinsic_sizeof): Obtain the element size from the
456         'elem_len' field of the dtype.
457         * trans-io.c (gfc_build_io_library_fndecls): Replace
458         gfc_int4_type_node with dtype_type_node where necessary.
459         (transfer_namelist_element): Use gfc_get_dtype_rank_type for
460         scalars.
461         * trans-types.c : Provide 'get_dtype_type_node' to acces the
462         dtype_type_node and, if necessary, build it.
463         The maximum size of an array element is now determined by the
464         maximum value of size_t.
465         Update the description of the array descriptor, including the
466         type def for the dtype_type.
467         (gfc_get_dtype_rank_type): Build a constructor for the dtype.
468         Distinguish RECORD_TYPEs that are BT_DERIVED or BT_CLASS.
469         (gfc_get_array_descriptor_base): Change the type of the dtype
470         field to dtype_type_node.
471         (gfc_get_array_descr_info): Get the offset to the rank field of
472         the dtype.
473         * trans-types.h : Add a prototype for 'get_dtype_type_node ()'.
474         * trans.h : Define the indices of the dtype fields.
476 2018-23-01  Paul Thomas  <pault@gcc.gnu.org>
478         PR fortran/83866
479         * decl.c (gfc_match_derived_decl): If eos not matched, recover
480         and emit error about garbage after declaration.
482 2018-23-01  Paul Thomas  <pault@gcc.gnu.org>
484         PR fortran/83898
485         * trans-stmt.c (trans_associate_var): Do not set cst_array_ctor
486         for characters.
488 2018-01-22  Janne Blomqvist  <jb@gcc.gnu.org>
490         PR 78534
491         PR 83704
492         * arith.c (gfc_arith_concat): Use size_t for string length.
493         (gfc_compare_string): Likewise.
494         (gfc_compare_with_Cstring): Likewise.
495         * array.c (gfc_resolve_character_array_constructor): Use
496         HOST_WIDE_INT, gfc_mpz_get_hwi.
497         * check.c (gfc_check_fe_runtime_error): Use size_t.
498         * data.c (create_character_initializer): Use HOST_WIDE_INT,
499         gfc_extract_hwi.
500         * decl.c (gfc_set_constant_character_len): Use gfc_charlen_t.
501         (add_init_expr_to_sym): Use HOST_WIDE_INT.
502         * expr.c (gfc_build_init_expr): Use HOST_WIDE_INT,
503         gfc_extract_hwi.
504         (gfc_apply_init): Likewise.
505         * match.h (gfc_set_constant_character_len): Update prototype.
506         * primary.c (match_string_constant): Use size_t.
507         * resolve.c (resolve_ordinary_assign): Use HOST_WIDE_INT,
508         gfc_mpz_get_hwi.
509         * simplify.c (init_result_expr): Likewise.
510         (gfc_simplify_len_trim): Use size_t.
511         * target-memory.c (gfc_encode_character): Use size_t.
512         (gfc_target_encode_expr): Use HOST_WIDE_INT, gfc_mpz_get_hwi.
513         (interpret_array): Use size_t.
514         (gfc_interpret_character): Likewise.
515         * target-memory.h (gfc_encode_character): Update prototype.
516         (gfc_interpret_character): Likewise.
517         (gfc_target_interpret_expr): Likewise.
518         * trans-const.c (gfc_build_string_const): Use size_t for length
519         argument.
520         (gfc_build_wide_string_const): Likewise.
521         * trans-const.h (gfc_build_string_const): Likewise.
522         (gfc_build_wide_string_const): Likewise.
524 2018-01-20  Steven G. Kargl  <kargl@gcc.gnu.org>
526         PR fortran/83900
527     * simplify.c (gfc_simplify_matmul): Set return type correctly.
529 2018-01-19  Steven G. Kargl  <kargl@gcc.gnu.org>
531         PR fortran/83900
532         * simplify.c (gfc_simplify_matmul): Delete bogus assertion.
534 2018-01-17  Harald Anlauf  <anlauf@gmx.de>
536         PR fortran/83864
537         * expr.c (add_init_expr_to_sym): Do not dereference NULL pointer.
539 2018-01-17  Harald Anlauf  <anlauf@gmx.de>
541         PR fortran/83874
542         * decl.c (add_init_expr_to_sym): Do not dereference NULL pointer.
544 2018-01-15  Louis Krupp  <louis.krupp@zoho.com>
546         PR fortran/82257
547         * interface.c (compare_rank): Don't try to retrieve CLASS_DATA
548         from symbol marked unlimited polymorphic.
549         * resolve.c (resolve_structure_cons): Likewise.
550         * misc.c (gfc_typename): Don't dereference derived->components
551         if it's NULL.
553 2018-01-15  Thomas Koenig  <tkoenig@gcc.gnu.org>
555         PR fortran/54613
556         * gfortran.h (gfc_check_f): Rename f4ml to f5ml.
557         (gfc_logical_4_kind): New macro
558         * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument.
559         (gfc_simplify_maxloc): Likewise.
560         (gfc_resolve_maxloc): Likewise.
561         (gfc_resolve_minloc): Likewise.
562         * check.c (gfc_check_minloc_maxloc): Add checking for "back"
563         argument; also raise error if it is used (for now). Add it
564         if it isn't present.
565         * intrinsic.c (add_sym_4ml): Rename to
566         (add_sym_5ml), adjust for extra argument.
567         (add_functions): Add "back" constant. Adjust maxloc and minloc
568         for back argument.
569         * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is
570         not of gfc_logical_4_kind, convert.
571         (gfc_resolve_minloc): Likewise.
572         * simplify.c (gfc_simplify_minloc): Add back argument.
573         (gfc_simplify_maxloc): Likewise.
574         * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last
575         argument to %VAL to ensure passing by value.
576         (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc
577         also for library calls.
579 2018-01-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
581         PR fortran/82007
582         * resolve.c (resolve_transfer): Delete code looking for 'DT'
583         format specifiers in format strings. Set formatted to true if a
584         format string or format label is present.
585         * trans-io.c (get_dtio_proc): Likewise. (transfer_expr): Fix
586         whitespace.
588 2018-01-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
590         PR fortran/83744
591         * dump-parse-tree.c (get_c_type_name): Remove extra line.
592         Change for loop to use declaration in for loop. Handle BT_LOGICAL
593         and BT_CHARACTER.
594         (write_decl): Add where argument. Fix indentation. Replace
595         assert with error message. Add typename to warning
596         in comment.
597         (write_type): Adjust locus to call of write_decl.
598         (write_variable): Likewise.
599         (write_proc): Likewise. Replace assert with error message.
601 2018-01-13  Paul Thomas  <pault@gcc.gnu.org>
603         PR fortran/52162
604         * trans-expr.c (gfc_trans_scalar_assign): Flag is_alloc_lhs if
605         the rhs expression is neither an elemental nor a conversion
606         function.
608         PR fortran/83622
609         * trans-array.c (is_pointer_array): Remove unconditional return
610         of false for -fopenmp.
612 2018-01-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
613         <emsr@gcc.gnu.org>
615         PR fortran/83803
616         * dump-parse-tree.c (write_proc): Always emit closing parenthesis
617         for functions.
619 2018-01-10  Steven G. Kargl  <kargl@gcc.gnu.org>
621         PR fortran/82367
622         * resolve.c (resolve_allocate_expr): Check for NULL pointer.
624 2018-01-10  Steven G. Kargl  <kargl@gcc.gnu.org>
626         PR fortran/83093
627         * resolve.c (resolve_charlen): Check the type of cl->length
628         after resolution.
630 2018-01-10  Janne Blomqvist  <jb@gcc.gnu.org>
632         PR fortran/83740
633         * trans-array.c (gfc_trans_array_ctor_element): Fix formatting.
635 2018-01-10  Janne Blomqvist  <jb@gcc.gnu.org>
637         PR fortran/83740
638         * trans-array.c (gfc_trans_array_ctor_element): Convert RHS to the
639         LHS type when assigning.
641 2018-01-09  Steven G. Kargl  <kargl@gcc.gnu.org>
643         PR fortran/83742
644         * expr.c (gfc_is_simply_contiguous): Check for NULL pointer.
646 2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>
648         * match.c (gfc_match_allocate): Check for NULL pointer.
650 2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>
652         * expr.c (gfc_check_pointer_assign): Fix typo in comment.
654 2018-01-08  Paul Thomas  <pault@gcc.gnu.org>
656         PR fortran/83611
657         * decl.c (gfc_get_pdt_instance): If parameterized arrays have
658         an initializer, convert the kind parameters and add to the
659         component if the instance.
660         * trans-array.c (structure_alloc_comps): Add 'is_pdt_type' and
661         use it with case COPY_ALLOC_COMP. Call 'duplicate_allocatable'
662         for parameterized arrays. Clean up typos in comments. Convert
663         parameterized array initializers and copy into the array.
664         * trans-expr.c (gfc_trans_scalar_assign): Do a deep copy for
665         parameterized types.
666         *trans-stmt.c (trans_associate_var): Deallocate associate vars
667         as necessary, when they are PDT function results for example.
669         PR fortran/83731
670         * trans-array.c (structure_alloc_comps): Only compare len parms
671         when they are declared explicitly.
673 2018-01-06  Janne Blomqvist  <jb@gcc.gnu.org>
675         PR fortran/50892
676         * trans-expr.c (gfc_trans_pointer_assignment): fold_convert rhs to
677         lhs type.
679 2018-01-05  Janne Blomqvist  <jb@gcc.gnu.org>
681         PR fortran/78534
682         PR fortran/66310
683         * array.c (got_charlen): Use gfc_charlen_int_kind.
684         * class.c (gfc_find_derived_vtab): Use gfc_size_kind instead of
685         hardcoded kind.
686         (find_intrinsic_vtab): Likewise.
687         * decl.c (match_char_length): Use gfc_charlen_int_kind.
688         (add_init_expr_to_sym): Use gfc_charlen_t and gfc_charlen_int_kind.
689         (gfc_match_implicit): Use gfc_charlen_int_kind.
690         * dump-parse-tree.c (show_char_const): Use gfc_charlen_t and size_t.
691         (show_expr): Use HOST_WIDE_INT_PRINT_DEC.
692         * expr.c (gfc_get_character_expr): Length parameter of type
693         gfc_charlen_t.
694         (gfc_get_int_expr): Value argument of type HOST_WIDE_INT.
695         (gfc_extract_hwi): New function.
696         (simplify_const_ref): Make string_len of type gfc_charlen_t.
697         (gfc_simplify_expr): Use HOST_WIDE_INT for substring refs.
698         * frontend-passes.c (optimize_trim): Use gfc_charlen_int_kind.
699         * gfortran.h (gfc_mpz_get_hwi): New prototype.
700         (gfc_mpz_set_hwi): Likewise.
701         (gfc_charlen_t): New typedef.
702         (gfc_expr): Use gfc_charlen_t for character lengths.
703         (gfc_size_kind): New extern variable.
704         (gfc_extract_hwi): New prototype.
705         (gfc_get_character_expr): Use gfc_charlen_t for character length.
706         (gfc_get_int_expr): Use HOST_WIDE_INT type for value argument.
707         * gfortran.texi: Update description of hidden string length argument.
708         * iresolve.c (check_charlen_present): Use gfc_charlen_int_kind.
709         (gfc_resolve_char_achar): Likewise.
710         (gfc_resolve_repeat): Pass string length directly without
711         temporary, use gfc_charlen_int_kind.
712         (gfc_resolve_transfer): Use gfc_charlen_int_kind.
713         * match.c (select_intrinsic_set_tmp): Use HOST_WIDE_INT for charlen.
714         * misc.c (gfc_mpz_get_hwi): New function.
715         (gfc_mpz_set_hwi): New function.
716         * module.c (atom_int): Change type from int to HOST_WIDE_INT.
717         (parse_integer): Don't complain about large integers.
718         (write_atom): Use HOST_WIDE_INT for integers.
719         (mio_integer): Handle integer type mismatch.
720         (mio_hwi): New function.
721         (mio_intrinsic_op): Use HOST_WIDE_INT.
722         (mio_array_ref): Likewise.
723         (mio_expr): Likewise.
724         * primary.c (match_substring): Use gfc_charlen_int_kind.
725         * resolve.c (resolve_substring_charlen): Use gfc_charlen_int_kind.
726         (resolve_character_operator): Likewise.
727         (resolve_assoc_var): Likewise.
728         (resolve_select_type): Use HOST_WIDE_INT for charlen, use snprintf.
729         (resolve_charlen): Use mpz_sgn to determine sign.
730         * simplify.c (gfc_simplify_repeat): Use HOST_WIDE_INT/gfc_charlen_t
731         instead of long.
732         * symbol.c (generate_isocbinding_symbol): Use gfc_charlen_int_kind.
733         * target-memory.c (size_character): Length argument of type
734         gfc_charlen_t.
735         (gfc_encode_character): Likewise.
736         (gfc_interpret_character): Use gfc_charlen_t.
737         * target-memory.h (gfc_encode_character): Modify prototype.
738         * trans-array.c (gfc_trans_array_ctor_element): Use existing type.
739         (get_array_ctor_var_strlen): Use gfc_conv_mpz_to_tree_type.
740         (trans_array_constructor): Use existing type.
741         (get_array_charlen): Likewise.
742         * trans-const.c (gfc_conv_mpz_to_tree_type): New function.
743         * trans-const.h (gfc_conv_mpz_to_tree_type): New prototype.
744         * trans-decl.c (gfc_trans_deferred_vars): Use existing type.
745         (add_argument_checking): Likewise.
746         * trans-expr.c (gfc_class_len_or_zero_get): Build const of type
747         gfc_charlen_type_node.
748         (gfc_conv_intrinsic_to_class): Use gfc_charlen_int_kind instead of
749         4, fold_convert to correct type.
750         (gfc_conv_class_to_class): Build const of type size_type_node for
751         size.
752         (gfc_copy_class_to_class): Likewise.
753         (gfc_conv_string_length): Use same type in expression.
754         (gfc_conv_substring): Likewise, use HOST_WIDE_INT for charlen.
755         (gfc_conv_string_tmp): Make sure len is of the right type.
756         (gfc_conv_concat_op): Use same type in expression.
757         (gfc_conv_procedure_call): Likewise.
758         (fill_with_spaces): Comment out memset() block due to spurious
759         -Wstringop-overflow warnings.
760         (gfc_trans_string_copy): Use gfc_charlen_type_node.
761         (alloc_scalar_allocatable_for_subcomponent_assignment):
762         fold_convert to right type.
763         (gfc_trans_subcomponent_assign): Likewise.
764         (trans_class_vptr_len_assignment): Build const of correct type.
765         (gfc_trans_pointer_assignment): Likewise.
766         (alloc_scalar_allocatable_for_assignment): fold_convert to right
767         type in expr.
768         (trans_class_assignment): Build const of correct type.
769         * trans-intrinsic.c (gfc_conv_associated): Likewise.
770         (gfc_conv_intrinsic_repeat): Do calculation in sizetype.
771         * trans-io.c (gfc_build_io_library_fndecls): Use
772         gfc_charlen_type_node for character lengths.
773         (set_string): Convert to right type in assignment.
774         * trans-stmt.c (gfc_trans_label_assign): Build const of
775         gfc_charlen_type_node.
776         (trans_associate_var): Likewise.
777         (gfc_trans_character_select): Likewise.
778         (gfc_trans_allocate): Likewise, don't typecast strlen result.
779         (gfc_trans_deallocate): Don't typecast strlen result.
780         * trans-types.c (gfc_size_kind): New variable.
781         (gfc_init_types): Determine gfc_charlen_int_kind and gfc_size_kind
782         from size_type_node.
783         * trans-types.h: Fix comment.
785 2018-01-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
787         PR fortran/83683
788         PR fortran/45689
789         * check.c (gfc_check_eoshift): Check for string length and
790         for conformance of boundary.
791         * intrinsic.c (add_functions): Add gfc_simplify_eoshift.
792         * intrinsic.h: Add prototype for gfc_simplify_eoshift.
793         * simplify.c (gfc_simplify_eoshift): New function.
795 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
796             Alan Hayward  <alan.hayward@arm.com>
797             David Sherwood  <david.sherwood@arm.com>
799         * trans-types.c (gfc_type_for_mode): Handle MODE_VECTOR_BOOL.
801 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
802             Alan Hayward  <alan.hayward@arm.com>
803             David Sherwood  <david.sherwood@arm.com>
805         * trans-types.c (gfc_type_for_mode): Check valid_vector_subparts_p.
807 2018-01-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
809         PR fortran/83664
810         * check.c (gfc_check_eoshift): Error for missing boundary if array
811         is not one of the standard types.
813 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
815         Update copyright years.
817         * gfortranspec.c (lang_specific_driver): Update copyright notice
818         dates.
819         * gfc-internals.texi: Bump @copying's copyright year.
820         * gfortran.texi: Ditto.
821         * intrinsic.texi: Ditto.
822         * invoke.texi: Ditto.
824 2017-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
826         PR fortran/45689
827         * intrinsic.c (add_function): Add gfc_simplify_maxloc and
828         gfc_simplify_minloc to maxloc and minloc, respectively.
829         * intrinsic.h: Add prototypes for gfc_simplify_minloc
830         and gfc_simplify_maxloc.
831         * simplify.c (min_max_chose): Adjust prototype.  Modify function
832         to have a return value which indicates if the extremum was found.
833         (is_constant_array_expr): Fix typo in comment.
834         (simplify_minmaxloc_to_scalar): New function.
835         (simplify_minmaxloc_nodim): New function.
836         (new_array): New function.
837         (simplify_minmaxloc_to_array): New function.
838         (gfc_simplify_minmaxloc): New function.
839         (simplify_minloc): New function.
840         (simplify_maxloc): New function.
842 2018-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
844         PR fortran/45689
845         PR fortran/83650
846         * simplify.c (gfc_simplify_cshift): Re-implement to allow full
847         range of arguments.
849 2018-01-01  Paul Thomas  <pault@gcc.gnu.org>
851         PR fortran/83076
852         * resolve.c (resolve_fl_derived0): Add caf_token fields for
853         allocatable and pointer scalars, when -fcoarray selected.
854         * trans-types.c (gfc_copy_dt_decls_ifequal): Copy the token
855         field as well as the backend_decl.
856         (gfc_get_derived_type): Flag GFC_FCOARRAY_LIB for module
857         derived types that are not vtypes. Components with caf_token
858         attribute are pvoid types. For a component requiring it, find
859         the caf_token field and have the component token field point to
860         its backend_decl.
862         PR fortran/83319
863         *trans-types.c (gfc_get_array_descriptor_base): Add the token
864         field to the descriptor even when codimen not set.
866 Copyright (C) 2018 Free Software Foundation, Inc.
868 Copying and distribution of this file, with or without modification,
869 are permitted in any medium without royalty provided the copyright
870 notice and this notice are preserved.