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