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