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