Fix changelog
[official-gcc.git] / gcc / fortran / ChangeLog
blobf21f7c774698c06290b0011e98d2cf6f7bdfd523
1 2018-03-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
2             Dominique d'Humieres  <dominiq@gcc.gnu.org>
4         PR fortran/69497
5         * symbol.c (gfc_free_namespace): Delete the assert and only if
6         refs count is equals zero, free the namespace. Otherwise,
7         something is halfway and other errors will resound.
9 2018-03-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
11         PR fortran/70068
12         * expr.c (find_substring_ref): Change types of start, end
13         and length variables to gfc_charlen_t. Set length to zero
14         for empty substring.
16 2018-03-24  Steven G. Kargl  <kargl@gcc.gnu.org>
18         PR fortran/42651
19         * decl.c (check_function_name): Improved error message
20         (gfc_match_volatile, gfc_match_asynchronous) Use check_function_name.
22 2018-03-22  Steven G. Kargl  <kargl@gcc.gnu.org>
24         PR fortran/84922
25         * decl.c (get_proc_name): If the MODULE prefix appears in interface
26         body, then it must appear on the contained subroutine or function.
27         While here, fix nearby mis-indented code.
29 2018-03-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
30         Harald Anlauf  <anlauf@gmx.de>
32         PR fortran/84957
33         * trans-types.c (gfc_sym_type): Do not dereference NULL pointer.
35 2018-03-21  Janne Blomqvist  <jb@gcc.gnu.org>
37         PR fortran/84615
38         * trans-expr.c (gfc_conv_procedure_call): Convert charlen to
39         gfc_charlen_type_node when calling procedure.
41 2018-03-20  Steven G. Kargl  <kargl@gcc.gnu.org>
43         PR fortran/85001
44         * interface.c (symbol_rank): Remove bogus null pointer check that
45         crept in when translating a ternary operator into an if-else
46         constructor.
48 2018-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
50         PR fortran/84931
51         * simplify.c (gfc_convert_constant): Correctly handle iterators
52         for type conversion.
54 2018-03-18  Steven G. Kargl  <kargl@gcc.gnu.org>
56         PR fortran/77414
57         * decl.c (get_proc_name):  Check for a subroutine re-defined in
58         the contain portion of a subroutine.  Change language of existing
59         error message to better describe the issue. While here fix whitespace
60         issues.
62 2018-03-18  Steven G. Kargl  <kargl@gcc.gnu.org>
64         PR fortran/65453
65         * decl.c (get_proc_name): Catch clash between a procedure statement
66         and a contained subprogram
68 2018-03-16  Steven G. Kargl  <kargl@gcc.gnu.org>
70         PR fortran/69395
71         * decl.c (merge_array_spec): Correct the error condition.
73 2018-03-15  Steven G. Kargl  <kargl@gcc.gnu.org>
75         PR fortran/78741
76         * decl.c (get_proc_name):  Check for clash of entry name with
77         subroutine name.
79 2018-03-15  Steven G. Kargl  <kargl@gcc.gnu.org>
81         PR fortran/69395
82         * decl.c (merge_array_spec): Limit the merging to maximum allowed
83         dimensions, and issue error message if limit is exceeded.
85 2018-03-13  Steven G. Kargl  <kargl@gcc.gnu.org>
87         * check.c (gfc_check_kill_sub):  Remove check for INTEGER(4) or (8).
88         * intrinsic.c (add_functions): Remove reference to gfc_resolve_kill.
89         (add_subroutines): Remove reference to gfc_resolve_kill_sub.
90         * intrinsic.texi: Update documentation.
91         * iresolve.c (gfc_resolve_kill, gfc_resolve_kill_sub): Remove.
92         * trans-decl.c (gfc_build_intrinsic_function_decls):  Add
93         gfor_fndecl_kill and gfor_fndecl_kill_sub
94         * trans-intrinsic.c (conv_intrinsic_kill, conv_intrinsic_kill_sub): new
95         functions.
96         (gfc_conv_intrinsic_function): Use conv_intrinsic_kill.
97         (gfc_conv_intrinsic_subroutine): Use conv_intrinsic_kill_sub.
98         * trans.h: Declare gfor_fndecl_kill and gfor_fndecl_kill_sub.
100 2018-03-11  Paul Thomas  <pault@gcc.gnu.org>
102         PR fortran/84546
103         * trans-array.c (structure_alloc_comps): Make sure that the
104         vptr is copied and that the unlimited polymorphic _len is used
105         to compute the size to be allocated.
106         * trans-expr.c (gfc_get_class_array_ref): If unlimited, use the
107         unlimited polymorphic _len for the offset to the element.
108         (gfc_copy_class_to_class): Set the new 'unlimited' argument.
109         * trans.h : Add the boolean 'unlimited' to the prototype.
111 2018-03-11  Steven G. Kargl  <kargl@gcc.gnu.org>
113         PR fortran/83939
114         * resolve.c (resolve_fl_procedure): Enforce F2018:C15100.
116 2018-03-11  Steven G. Kargl  <kargls@gcc.gnu.org>
118         * check.c (gfc_check_kill):  Check pid and sig are scalar.
119         (gfc_check_kill_sub): Restrict kind to 4 and 8.
120         * intrinsic.c (add_function): Sort keyword list.  Add pid and sig
121         keywords for KILL.  Remove redundant *back="back" in favor of the
122         original *bck="back".
123         (add_subroutines): Sort keyword list.  Add pid and sig keywords
124         for KILL.
125         * intrinsic.texi: Fix documentation to consistently use pid and sig.
126         * iresolve.c (gfc_resolve_kill): Kind can only be 4 or 8.  Choose the
127         correct function.
128         (gfc_resolve_rename_sub): Add comment.
130 2018-03-11  Thomas Koenig  <tkoenig@gcc.gnu.org>
132         PR fortran/66128
133         * simplify.c (simplify_transformation): Return default result for
134         empty array argument.
135         (gfc_simplify_all): Remove special-case handling for zerosize.
136         (gfc_simplify_any): Likewise.
137         (gfc_simplify_count): Likewise.
138         (gfc_simplify_iall): Likewise.
139         (gfc_simplify_iany): Likewise.
140         (gfc_simplify_iparity): Likewise.
141         (gfc_simplify_minval): Likewise.
142         (gfc_simplify_maxval): Likewise.
143         (gfc_simplify_norm2): Likewise.
144         (gfc_simplify_product): Likewise.
145         (gfc_simplify_sum): Likewise.
147 2018-03-10  Steven G. Kargl  <kargl@gcc.gnu.org>
149         PR fortran/84734
150         * arith.c (check_result, eval_intrinsic):  If result overflows, pass
151         the expression up the chain instead of a NULL pointer.
153 2018-03-07  Steven G. Kargl  <kargl@gcc.gnu.org>
155         PR fortran/64124
156         PR fortran/70409
157         * decl.c (gfc_match_char_spec): Try to reduce a charlen to a constant.
159 2017-03-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
161         PR fortran/84697
162         PR fortran/66128
163         * expr.c (simplify_parameter_variable): If p is a size zero array
164         and not an ARRAY_EXPR insert an empty array constructor and
165         return.
166         * gfortran.h: Add prototype for gfc_is_size_zero_array.
167         * simplify.c (is_size_zero_array): Make non-static and rename into
168         (gfc_is_size_zero_array):  Check for parameter arrays of zero
169         size by comparing shape and absence of constructor.
170         (gfc_simplify_all): Use gfc_is_size_zero_array instead of
171         is_size_zero_array.
172         (gfc_simplify_count): Likewise.
173         (gfc_simplify_iall): Likewise.
174         (gfc_simplify_iany): Likewise.
175         (gfc_simplify_iparity): Likewise.
176         (gfc_simplify_minval): Likewise.
177         (gfc_simplify_maxval): Likewise.
178         (gfc_simplify_product): Likewise.
179         (gfc_simplify_sum): Likewise.
181 2018-03-06  Steven G. Kargl  <kargl@gcc.gnu.org>
183         PR fortran/56667
184         * primary.c (match_sym_complex_part): Give the matcher for an implied
185         do-loop a chance to run.
187 2018-03-03  Harald Anlauf  <anlauf@gmx.de>
189         PR fortran/71085
190         * trans-expr.c (gfc_apply_interface_mapping_to_expr): Do not
191         dereference NULL pointer.
193 2018-03-03  Steven G. Kargl  <kargl@gcc.gnu.org>
195         PR fortran/66128
196         * simplify.c (is_size_zero_array): New function to check for size
197         zero array.
198         (gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
199          gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
200          gfc_simplify_minval, gfc_simplify_maxval, gfc_simplify_norm2,
201          gfc_simplify_product, gfc_simplify_sum): Use it, and implement
202         requirements from F2018.
204 2018-03-03  Steven G. Kargl  <kargl@gcc.gnu.org>
206         PR fortran/51434
207         * simplify.c (gfc_simplify_transfer): Resolve mold.
209 2018-03-03  Paul Thomas  <pault@gcc.gnu.org>
211         PR fortran/80965
212         * resolve.c (build_loc_call): Change symtree name from 'loc' to
213         '_loc'.
215 2018-03-01  Paul Thomas  <pault@gcc.gnu.org>
217         PR fortran/84219
218         * target-memory.c (gfc_interpret_derived): Assert that BT_VOID
219         components are caf tokens.
220         (gfc_target_interpret_expr): Treat BT_VOID expressions as
221         integers.
223 2018-03-01  Paul Thomas  <pault@gcc.gnu.org>
225         PR fortran/84538
226         * class.c (class_array_ref_detected): Remove the condition that
227         there be no reference after the array reference.
228         (find_intrinsic_vtab): Remove excess whitespace.
229         * trans-array.c (gfc_conv_scalarized_array_ref): Rename 'tmp'
230         as 'base and call build_class_array_ref earlier.
232 2018-02-28  Paul Thomas  <pault@gcc.gnu.org>
234         PR fortran/83901
235         * trans-stmt.c (trans_associate_var): Make sure that the se
236         expression is a pointer type before converting it to the symbol
237         backend_decl type.
239 2018-02-25  Steven G. Kargl  <kargl@gcc.gnu.org>
241         PR fortran/83633
242         * decl.c (variable_decl): Check that an explicit-shape-array with
243         nonconstant bounds is allowed.
245 2018-02-25  Paul Thomas  <pault@gcc.gnu.org>
247         PR fortran/84523
248         * trans-intrinsic.c (gfc_conv_allocated): If the argument se
249         has a pre block, add it to the expression pre block.
251 2018-02-25  Thomas Koenig  <tkoenig@gcc.gnu.org>
253         PR fortran/78238
254         * gfortran.h (gfc_integer_4_kind): Define.
255         * resolve.c (resolve_select_type): Make sure that the
256         kind of c->high is gfc_integer_4_kind.
258 2018-02-24  Steven G. Kargl <kargl@gcc.gnu.org>
260         PR fortran/30792
261         * decl.c (gfc_match_data): Check for invalid substring in
262         data-implied-do
264 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
266         * intrinsic.texi: Arguments to MATMUL cannot both be rank one.
268 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
270         PR fortran/84511
271         * trans-io.c (transfer_expr): Deal with C_LOC in transfer statement.
273 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
275         PR fortran/84346
276         * interface.c (compare_actual_formal): Issue error if keyword is
277         used in a statement function.
279 2018-02-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
281         PR fortran/84506
282         * trans-io.c (set_parameter_value_inquire): Adjust range check of
283         negative unit values for kind=8 units to the kind=4 negative limit.
285 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
287         PR fortran/83149
288         * trans-types.c (gfc_sym_type): Test sym->ns->proc_name before
289         accessing its components.
291 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
293         PR fortran/83149
294         * trans-decl.c (gfc_finish_var_decl): Test sym->ns->proc_name
295         before accessing its components.
297 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
299         PR fortran/83148
300         * trans-const.c : Clean up some whitespace issues.
301         * trans-expr.c (gfc_conv_initializer): If an iso_c_binding
302         derived type has a kind value of zero, set it to the default
303         integer kind.
305 2018-02-23  Janne Blomqvist  <jb@gcc.gnu.org>
307         PR fortran/84519
308         * trans-decl.c (gfc_build_builtin_function_decls): Add bool
309         argument to stop and error stop decls.
310         * trans-stmt.c (gfc_trans_stop): Add false value to argument
311         lists.
313 2018-02-22  Janne Blomqvist  <jb@gcc.gnu.org>
315         PR 78534
316         PR 84509
317         * trans-decl.c (gfc_build_builtin_function_decls): Pass
318         gfc_int8_type node to pause_numeric, size_type_node to
319         pause_string.
320         * trans-stmt.c (gfc_trans_pause): Likewise.
322 2018-02-22  Janne Blomqvist  <jb@gcc.gnu.org>
324         * gfortran.texi: Update Coarray API description.
325         * trans-decl.c (gfc_build_builtin_function_decls): Use size_t for
326         character lengths, int for exit codes.
327         (generate_coarray_sym_init): Use size_t for character length.
328         * trans-intrinsic.c (conv_co_collective): Likewise.
329         * trans-stmt.c (gfc_trans_lock_unlock): Likewise.
330         (gfc_trans_event_post_wait): Likewise.
331         (gfc_trans_sync): Likewise.
332         (gfc_trans_stop): Use size_t for character lengths, int for exit
333         codes.
335 2018-02-20  Thomas Koenig  <tkoenig@gcc.gnu.org>
337         PR fortran/48890
338         PR fortran/83823
339         * primary.c (gfc_convert_to_structure_constructor):
340         For a constant string constructor, make sure the length
341         is correct.
343 2018-02-19  Paul Thomas  <pault@gcc.gnu.org>
345         PR fortran/83344
346         PR fortran/83975
347         * resolve.c (resolve_assoc_var): Rearrange the logic for the
348         determination of the character length of associate names. If
349         the associate name is missing a length expression or the length
350         expression is not a constant and the target is not a variable,
351         make the associate name allocatable and deferred length.
352         * trans-decl.c (gfc_get_symbol_decl): Null the character length
353         backend_decl for deferred length associate names that are not
354         variables. Set 'length' to gfc_index_zero_node for character
355         associate names, whose character length is a PARM_DECL.
357 2018-02-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
359         PR fortran/35339
360         * frontend-passes.c (traverse_io_block): Remove workaround for
361         PR 80945.
363 2018-02-19  Andre Vehreschild  <vehre@gcc.gnu.org>
365         * gfortran.texi: Document additional src/dst_type.  Fix some typos.
366         * trans-decl.c (gfc_build_builtin_function_decls): Declare the new
367         argument of _caf_*_by_ref () with * e { get, send, sendget }.
368         * trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Add the type of the
369         data referenced when generating a call to caf_get_by_ref ().
370         (conv_caf_send): Same but for caf_send_by_ref () and
371         caf_sendget_by_ref ().
373 2018-02-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
375         PR fortran/84389
376         * io.c (check_format): Allow FMT_COLON.
378 2018-02-18  Paul Thomas  <pault@gcc.gnu.org>
380         PR fortran/80945
381         * trans-array.c (gfc_conv_expr_descriptor): Set parmtype from
382         the typenode in the case of deferred length characters.
384 2018-02-17  Thomas Koenig  <tkoenig@gcc.gnu.org>
386         PR fortran/84270
387         * frontend-passes (scalarized_expr):  If the expression
388         is an assumed size array, leave in the last reference
389         and pass AR_SECTION instead of AR_FULL to gfc_resolve
390         in order to avoid an error.
392 2018-02-17  Paul Thomas  <pault@gcc.gnu.org>
394         PR fortran/84115
395         * resolve.c (resolve_assoc_var): If a non-constant target expr.
396         has no string length expression, make the associate variable
397         into a deferred length, allocatable symbol.
398         * trans-decl.c (gfc_is_reallocatable_lhs): Add and use a ptr to
399         the symbol.
400         * trans-stmt.c (trans_associate_var): Null and free scalar
401         associate names that are allocatable. After assignment, remove
402         the allocatable attribute to prevent reallocation.
404 2018-02-16  Jakub Jelinek  <jakub@redhat.com>
406         PR fortran/84418
407         * trans-openmp.c (gfc_trans_omp_clauses): For OMP_CLAUSE_LINEAR_REF
408         kind set OMP_CLAUSE_LINEAR_STEP to TYPE_SIZE_UNIT times last_step.
410 2018-02-16  Dominique d'Humieres  <dominiq@gcc.gnu.org>
412         PR fortran/84354
413         * decl.c (gfc_get_pdt_instance): Replace '%qs' with %qs.
415 2018-02-15  Janus Weil  <janus@gcc.gnu.org>
417         PR fortran/84409
418         * interface.c (check_dtio_arg_TKR_intent): Add a check for character
419         length.
421 2018-02-14  Janus Weil  <janus@gcc.gnu.org>
423         PR fortran/84385
424         * match.c (gfc_match_select_type): Fix check for selector in
425         SELECT TYPE statement.
427 2018-02-13  Janus Weil  <janus@gcc.gnu.org>
429         PR fortran/84313
430         * symbol.c (check_conflict): Reject procedure pointers in common blocks.
432 2018-02-13  Alastair McKinstry  <alastair.mckinstry@sceal.ie>
433             Janne Blomqvist  <jb@gcc.gnu.org>
435         * module.c (dump_module): Use lbasename to ensure that module
436         files are reproducible.
438 2018-02-12  Janus Weil  <janus@gcc.gnu.org>
440         PR fortran/84273
441         * resolve.c (resolve_component): Fix checks of passed argument in
442         procedure-pointer components.
444 2018-02-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
446         PR fortran/35299
447         * resolve.c (resolve_formal_arglist): Update error message.
449 2018-02-11  Andre Vehreschild  <vehre@gcc.gnu.org>
451         * gfortran.texi: Fix typos in documentation of caf_register ().
452         * trans-array.c (structure_alloc_comps): Only register a component of
453         a derived typed corray, not of an ultimate component coarray.
455 2018-02-11  Steven G. Kargl  <kargl@gcc.gnu.org>
457         PR fortran/54223
458         PR fortran/84276
459         * interface.c (compare_actual_formal): Add in_statement_function
460         bool parameter.  Skip check of INTENT attribute for statement
461         functions.  Arguments to a statement function cannot be optional,
462         issue error for missing argument.
463         (gfc_procedure_use, gfc_ppc_use, gfc_arglist_matches_symbol): Use
464          in_statement_function.
466 2018-02-11  Paul Thomas  <pault@gcc.gnu.org>
468         PR fortran/84074
469         * trans-expr.c (gfc_conv_derived_to_class): Set the use_offset
470         flag. If the is a vector subscript or the expression is not a
471         variable, make the descriptor one-based.
473 2018-02-10  Paul Thomas  <pault@gcc.gnu.org>
475         PR fortran/84141
476         PR fortran/84155
477         * trans-array.c (gfc_array_init_size): Revert the change made
478         in revision 257356 setting the dtype.
479         * trans-types.c (gfc_get_dtype): Do not use the cached dtype.
480         Call gfc_get_dtype_rank_type every time.
482         PR fortran/56691
483         * trans-array.c (gfc_conv_expr_descriptor): If the source array
484         is a descriptor type, use its offset, removing the condition
485         that is be a class expression.
487 2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>
489         PR fortran/82994
490         * match.c (gfc_match_deallocate): Check for NULL pointer.
492 2018-02-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
494         PR fortran/68560
495         * trans-intrinsic.c (gfc_conv_intrinsic_shape): New function.
496         (gfc_conv_intrinsic_function): Call it.
498 2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>
500         PR fortran/82049
501         * match.c (gfc_match_type_spec): If the charlen is non-NULL, then
502         try to resolve it.  While here return early if possible.
504 2018-02-04  Paul Thomas  <pault@gcc.gnu.org>
506         PR fortran/84115
507         * trans-decl.c (gfc_get_symbol_decl): Do not finish the decl of
508         'length' if the symbol charlen backend_decl is an indirect ref.
510 2018-02-03  Paul Thomas  <pault@gcc.gnu.org>
512         PR fortran/84141
513         PR fortran/84155
514         * trans-array.c (gfc_array_init_size): Instead of gfc_get_dtype
515         use gfc_get_dtype_rank_type.
517 2018-02-01  Janne Blomqvist  <jb@gcc.gnu.org>
519         PR 83975
520         PR 83344
521         * resolve.c (resolve_assoc_var): Generate an error if
522         target length unknown.
524 2018-02-01  Janne Blomqvist  <jb@gcc.gnu.org>
526         PR fortran/83705
527         * simplify.c (gfc_simplify_repeat): Increase limit for deferring
528         to runtime, print a warning message.
530 2018-01-31  Jakub Jelinek  <jakub@redhat.com>
532         PR fortran/84116
533         * openmp.c (gfc_match_omp_clauses): If all the linear
534         gfc_match_omp_variable_list calls failed, don't gfc_free_omp_namelist
535         nor set *head = NULL.  Formatting fixes.
537 2018-01-31  Paul Thomas  <pault@gcc.gnu.org>
539         PR fortran/84088
540         * trans-expr.c (gfc_conv_procedure_call): If the parm expr is
541         an address expression passed to an assumed rank dummy, convert
542         to an indirect reference.
544 2018-01-31  Thomas Koenig  <tkoenig@gcc.gnu.org>
546         * dump-parse-tree.c (write_proc): Use sym_name (which may
547         be sym->binding_label) instead of sym->name.
549 2018-01-31  Janne Blomqvist  <jb@gcc.gnu.org>
551         * trans-const.c (gfc_conv_string_init): Use gfc_charlen_t instead
552         of int for slen.
554 2018-01-31  Janne Blomqvist  <jb@gcc.gnu.org>
556         PR fortran/78534
557         * trans-expr.c (fill_with_spaces): Use memset instead of
558         generating loop.
559         (gfc_trans_string_copy): Improve opportunity to use builtins with
560         constant lengths.
562 2018-01-30  Jakub Jelinek  <jakub@redhat.com>
564         PR debug/84131
565         * trans-array.c (gfc_get_descriptor_offsets_for_info): Set *data_off
566         to DATA_FIELD's offset rather than OFFSET_FIELD's offset.
568 2018-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
570         PR fortran/84134
571         * array.c (gfc_ref_dimen_size): Whitespace fixes.  If stride is
572         zero, return false.
574 2018-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
576         PR fortran/84133
577         * frontend-passes (matmul_to_var_expr): Return early if
578         in association list.
579         (inline_matmul_assign): Likewise.
581 2017-01-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
583         PR fortran/84073
584         * resolve.c (resolve_component): Ensure BIND(C) character
585         components have length one.
586         (resolve_symbol): Likewise for variables.
588 2018-01-27  Jakub Jelinek  <jakub@redhat.com>
590         PR fortran/84065
591         * decl.c (add_init_expr_to_sym): Ignore initializers for too large
592         lengths.
594 2018-01-26  Damian Rouson  <damian@sourceryinstitute.org>
595             Alessandro Fanfarillo  <fanfarillo.gcc@gmail.com>
596             Soren Rasmussen  <s.c.rasmussen@gmail.com>
598         Partial support for Fortran 2018 teams features.
600         * array.c (gfc_match_array_ref): add team attribute in coarray
601         transfers.
602         * check.c (gfc_check_get_team, gfc_check_team_number): add new
603         functions for get_team and team_number.
604         * dump-parse-tree.c (show_code_node): add new statements: form team,
605         change team, end team, and sync team.
606         * expr.c (gfc_find_team_co): add new function.
607         * gfortran.h: add new statements.
608         * intrinsic.c (add_functions): add get_team and team_number functions.
609         * intrinsic.h: add get_team and team_number prototypes for check,
610         simplify, and resolve.
611         * iresolve.c (gfc_resolve_get_team, gfc_resolve_team_number): add new
612         functions.
613         * iso-fortran-env.def: add the team_type derived type.
614         * match.c (gfc_match_if, gfc_match_form_team, gfc_match_team_number)
615         (gfc_match_end_team, gfc_match_sync_team, gfc_match_change_team):
616         add change team, end team, form team, sync team match and functions.
617         * match.h: add new prototypes for change team, end team, form team,
618         and sync team.
619         * parse.c (decode_statement): add cases for change team, end team,
620         form team, and sync team.
621         * resolve.c: add cases for exec form team, change team, end team, and
622         sync team.
623         * simplify.c (gfc_simplify_get_team): add new function for get team.
624         * st.c (gfc_free_statement): add cases exec for change team, end team,
625         form team, sync team.
626         * trans-decl.c (gfor_fndecl_caf_form_team)
627         (gfor_fndecl_caf_change_team, gfor_fndecl_caf_end_team)
628         (gfor_fndecl_caf_sync_team, gfor_fndecl_caf_get_team)
629         (gfor_fndecl_caf_team_number): add functions and definitions.
630         * trans-intrinsic.c (conv_caf_send, conv_intrinsic_team_number): add
631         new function and team_type argument support.
632         * trans-stmt.c (gfc_trans_form_team, gfc_trans_change_team)
633         (gfc_trans_end_team, gfc_trans_sync_team): add new functions.
634         * trans-stmt.h: add new prototypes.
635         * trans-types.c (gfc_get_derived_type): check condition for team_type.
636         * trans.c (trans_code): new exec cases for form team, change team, end
637         team, and sync team.
638         * trans.h: add new prototypes.
640 2018-01-26  Steven G. Kargl  <kargl@gcc.gnu.org>
642         PR fortran/83998
643         * simplify.c (compute_dot_product):  Initialize result to INTEGER(1) 0
644         or .false.  The summation does the correct type conversion.
645         (gfc_simplify_dot_product): Special case zero-sized arrays.
647 2018-25-01  Paul Thomas  <pault@gcc.gnu.org>
649         PR fortran/37577
650         * array.c (gfc_match_array_ref): If standard earlier than F2008
651         it is an error if the reference dimension is greater than 7.
652         libgfortran.h : Increase GFC_MAX_DIMENSIONS to 15. Change the
653         dtype masks and shifts accordingly.
654         * trans-array.c (gfc_conv_descriptor_dtype): Use the dtype
655         type node to check the field.
656         (gfc_conv_descriptor_dtype): Access the rank field of dtype.
657         (duplicate_allocatable_coarray): Access the rank field of the
658         dtype descriptor rather than the dtype itself.
659         * trans-expr.c (get_scalar_to_descriptor_type): Store the type
660         of 'scalar' on entry and use its TREE_TYPE if it is ARRAY_TYPE
661         (ie. a character).
662         (gfc_conv_procedure_call): Pass TREE_OPERAND (tmp,0) to
663         get_scalar_to_descriptor_type if the actual expression is a
664         constant.
665         (gfc_trans_structure_assign): Assign the rank directly to the
666         dtype rank field.
667         * trans-intrinsic.c (gfc_conv_intrinsic_rank): Cast the result
668         to default integer kind.
669         (gfc_conv_intrinsic_sizeof): Obtain the element size from the
670         'elem_len' field of the dtype.
671         * trans-io.c (gfc_build_io_library_fndecls): Replace
672         gfc_int4_type_node with dtype_type_node where necessary.
673         (transfer_namelist_element): Use gfc_get_dtype_rank_type for
674         scalars.
675         * trans-types.c : Provide 'get_dtype_type_node' to acces the
676         dtype_type_node and, if necessary, build it.
677         The maximum size of an array element is now determined by the
678         maximum value of size_t.
679         Update the description of the array descriptor, including the
680         type def for the dtype_type.
681         (gfc_get_dtype_rank_type): Build a constructor for the dtype.
682         Distinguish RECORD_TYPEs that are BT_DERIVED or BT_CLASS.
683         (gfc_get_array_descriptor_base): Change the type of the dtype
684         field to dtype_type_node.
685         (gfc_get_array_descr_info): Get the offset to the rank field of
686         the dtype.
687         * trans-types.h : Add a prototype for 'get_dtype_type_node ()'.
688         * trans.h : Define the indices of the dtype fields.
690 2018-23-01  Paul Thomas  <pault@gcc.gnu.org>
692         PR fortran/83866
693         * decl.c (gfc_match_derived_decl): If eos not matched, recover
694         and emit error about garbage after declaration.
696 2018-23-01  Paul Thomas  <pault@gcc.gnu.org>
698         PR fortran/83898
699         * trans-stmt.c (trans_associate_var): Do not set cst_array_ctor
700         for characters.
702 2018-01-22  Janne Blomqvist  <jb@gcc.gnu.org>
704         PR 78534
705         PR 83704
706         * arith.c (gfc_arith_concat): Use size_t for string length.
707         (gfc_compare_string): Likewise.
708         (gfc_compare_with_Cstring): Likewise.
709         * array.c (gfc_resolve_character_array_constructor): Use
710         HOST_WIDE_INT, gfc_mpz_get_hwi.
711         * check.c (gfc_check_fe_runtime_error): Use size_t.
712         * data.c (create_character_initializer): Use HOST_WIDE_INT,
713         gfc_extract_hwi.
714         * decl.c (gfc_set_constant_character_len): Use gfc_charlen_t.
715         (add_init_expr_to_sym): Use HOST_WIDE_INT.
716         * expr.c (gfc_build_init_expr): Use HOST_WIDE_INT,
717         gfc_extract_hwi.
718         (gfc_apply_init): Likewise.
719         * match.h (gfc_set_constant_character_len): Update prototype.
720         * primary.c (match_string_constant): Use size_t.
721         * resolve.c (resolve_ordinary_assign): Use HOST_WIDE_INT,
722         gfc_mpz_get_hwi.
723         * simplify.c (init_result_expr): Likewise.
724         (gfc_simplify_len_trim): Use size_t.
725         * target-memory.c (gfc_encode_character): Use size_t.
726         (gfc_target_encode_expr): Use HOST_WIDE_INT, gfc_mpz_get_hwi.
727         (interpret_array): Use size_t.
728         (gfc_interpret_character): Likewise.
729         * target-memory.h (gfc_encode_character): Update prototype.
730         (gfc_interpret_character): Likewise.
731         (gfc_target_interpret_expr): Likewise.
732         * trans-const.c (gfc_build_string_const): Use size_t for length
733         argument.
734         (gfc_build_wide_string_const): Likewise.
735         * trans-const.h (gfc_build_string_const): Likewise.
736         (gfc_build_wide_string_const): Likewise.
738 2018-01-20  Steven G. Kargl  <kargl@gcc.gnu.org>
740         PR fortran/83900
741     * simplify.c (gfc_simplify_matmul): Set return type correctly.
743 2018-01-19  Steven G. Kargl  <kargl@gcc.gnu.org>
745         PR fortran/83900
746         * simplify.c (gfc_simplify_matmul): Delete bogus assertion.
748 2018-01-17  Harald Anlauf  <anlauf@gmx.de>
750         PR fortran/83864
751         * expr.c (add_init_expr_to_sym): Do not dereference NULL pointer.
753 2018-01-17  Harald Anlauf  <anlauf@gmx.de>
755         PR fortran/83874
756         * decl.c (add_init_expr_to_sym): Do not dereference NULL pointer.
758 2018-01-15  Louis Krupp  <louis.krupp@zoho.com>
760         PR fortran/82257
761         * interface.c (compare_rank): Don't try to retrieve CLASS_DATA
762         from symbol marked unlimited polymorphic.
763         * resolve.c (resolve_structure_cons): Likewise.
764         * misc.c (gfc_typename): Don't dereference derived->components
765         if it's NULL.
767 2018-01-15  Thomas Koenig  <tkoenig@gcc.gnu.org>
769         PR fortran/54613
770         * gfortran.h (gfc_check_f): Rename f4ml to f5ml.
771         (gfc_logical_4_kind): New macro
772         * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument.
773         (gfc_simplify_maxloc): Likewise.
774         (gfc_resolve_maxloc): Likewise.
775         (gfc_resolve_minloc): Likewise.
776         * check.c (gfc_check_minloc_maxloc): Add checking for "back"
777         argument; also raise error if it is used (for now). Add it
778         if it isn't present.
779         * intrinsic.c (add_sym_4ml): Rename to
780         (add_sym_5ml), adjust for extra argument.
781         (add_functions): Add "back" constant. Adjust maxloc and minloc
782         for back argument.
783         * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is
784         not of gfc_logical_4_kind, convert.
785         (gfc_resolve_minloc): Likewise.
786         * simplify.c (gfc_simplify_minloc): Add back argument.
787         (gfc_simplify_maxloc): Likewise.
788         * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last
789         argument to %VAL to ensure passing by value.
790         (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc
791         also for library calls.
793 2018-01-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
795         PR fortran/82007
796         * resolve.c (resolve_transfer): Delete code looking for 'DT'
797         format specifiers in format strings. Set formatted to true if a
798         format string or format label is present.
799         * trans-io.c (get_dtio_proc): Likewise. (transfer_expr): Fix
800         whitespace.
802 2018-01-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
804         PR fortran/83744
805         * dump-parse-tree.c (get_c_type_name): Remove extra line.
806         Change for loop to use declaration in for loop. Handle BT_LOGICAL
807         and BT_CHARACTER.
808         (write_decl): Add where argument. Fix indentation. Replace
809         assert with error message. Add typename to warning
810         in comment.
811         (write_type): Adjust locus to call of write_decl.
812         (write_variable): Likewise.
813         (write_proc): Likewise. Replace assert with error message.
815 2018-01-13  Paul Thomas  <pault@gcc.gnu.org>
817         PR fortran/52162
818         * trans-expr.c (gfc_trans_scalar_assign): Flag is_alloc_lhs if
819         the rhs expression is neither an elemental nor a conversion
820         function.
822         PR fortran/83622
823         * trans-array.c (is_pointer_array): Remove unconditional return
824         of false for -fopenmp.
826 2018-01-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
827         <emsr@gcc.gnu.org>
829         PR fortran/83803
830         * dump-parse-tree.c (write_proc): Always emit closing parenthesis
831         for functions.
833 2018-01-10  Steven G. Kargl  <kargl@gcc.gnu.org>
835         PR fortran/82367
836         * resolve.c (resolve_allocate_expr): Check for NULL pointer.
838 2018-01-10  Steven G. Kargl  <kargl@gcc.gnu.org>
840         PR fortran/83093
841         * resolve.c (resolve_charlen): Check the type of cl->length
842         after resolution.
844 2018-01-10  Janne Blomqvist  <jb@gcc.gnu.org>
846         PR fortran/83740
847         * trans-array.c (gfc_trans_array_ctor_element): Fix formatting.
849 2018-01-10  Janne Blomqvist  <jb@gcc.gnu.org>
851         PR fortran/83740
852         * trans-array.c (gfc_trans_array_ctor_element): Convert RHS to the
853         LHS type when assigning.
855 2018-01-09  Steven G. Kargl  <kargl@gcc.gnu.org>
857         PR fortran/83742
858         * expr.c (gfc_is_simply_contiguous): Check for NULL pointer.
860 2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>
862         * match.c (gfc_match_allocate): Check for NULL pointer.
864 2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>
866         * expr.c (gfc_check_pointer_assign): Fix typo in comment.
868 2018-01-08  Paul Thomas  <pault@gcc.gnu.org>
870         PR fortran/83611
871         * decl.c (gfc_get_pdt_instance): If parameterized arrays have
872         an initializer, convert the kind parameters and add to the
873         component if the instance.
874         * trans-array.c (structure_alloc_comps): Add 'is_pdt_type' and
875         use it with case COPY_ALLOC_COMP. Call 'duplicate_allocatable'
876         for parameterized arrays. Clean up typos in comments. Convert
877         parameterized array initializers and copy into the array.
878         * trans-expr.c (gfc_trans_scalar_assign): Do a deep copy for
879         parameterized types.
880         *trans-stmt.c (trans_associate_var): Deallocate associate vars
881         as necessary, when they are PDT function results for example.
883         PR fortran/83731
884         * trans-array.c (structure_alloc_comps): Only compare len parms
885         when they are declared explicitly.
887 2018-01-06  Janne Blomqvist  <jb@gcc.gnu.org>
889         PR fortran/50892
890         * trans-expr.c (gfc_trans_pointer_assignment): fold_convert rhs to
891         lhs type.
893 2018-01-05  Janne Blomqvist  <jb@gcc.gnu.org>
895         PR fortran/78534
896         PR fortran/66310
897         * array.c (got_charlen): Use gfc_charlen_int_kind.
898         * class.c (gfc_find_derived_vtab): Use gfc_size_kind instead of
899         hardcoded kind.
900         (find_intrinsic_vtab): Likewise.
901         * decl.c (match_char_length): Use gfc_charlen_int_kind.
902         (add_init_expr_to_sym): Use gfc_charlen_t and gfc_charlen_int_kind.
903         (gfc_match_implicit): Use gfc_charlen_int_kind.
904         * dump-parse-tree.c (show_char_const): Use gfc_charlen_t and size_t.
905         (show_expr): Use HOST_WIDE_INT_PRINT_DEC.
906         * expr.c (gfc_get_character_expr): Length parameter of type
907         gfc_charlen_t.
908         (gfc_get_int_expr): Value argument of type HOST_WIDE_INT.
909         (gfc_extract_hwi): New function.
910         (simplify_const_ref): Make string_len of type gfc_charlen_t.
911         (gfc_simplify_expr): Use HOST_WIDE_INT for substring refs.
912         * frontend-passes.c (optimize_trim): Use gfc_charlen_int_kind.
913         * gfortran.h (gfc_mpz_get_hwi): New prototype.
914         (gfc_mpz_set_hwi): Likewise.
915         (gfc_charlen_t): New typedef.
916         (gfc_expr): Use gfc_charlen_t for character lengths.
917         (gfc_size_kind): New extern variable.
918         (gfc_extract_hwi): New prototype.
919         (gfc_get_character_expr): Use gfc_charlen_t for character length.
920         (gfc_get_int_expr): Use HOST_WIDE_INT type for value argument.
921         * gfortran.texi: Update description of hidden string length argument.
922         * iresolve.c (check_charlen_present): Use gfc_charlen_int_kind.
923         (gfc_resolve_char_achar): Likewise.
924         (gfc_resolve_repeat): Pass string length directly without
925         temporary, use gfc_charlen_int_kind.
926         (gfc_resolve_transfer): Use gfc_charlen_int_kind.
927         * match.c (select_intrinsic_set_tmp): Use HOST_WIDE_INT for charlen.
928         * misc.c (gfc_mpz_get_hwi): New function.
929         (gfc_mpz_set_hwi): New function.
930         * module.c (atom_int): Change type from int to HOST_WIDE_INT.
931         (parse_integer): Don't complain about large integers.
932         (write_atom): Use HOST_WIDE_INT for integers.
933         (mio_integer): Handle integer type mismatch.
934         (mio_hwi): New function.
935         (mio_intrinsic_op): Use HOST_WIDE_INT.
936         (mio_array_ref): Likewise.
937         (mio_expr): Likewise.
938         * primary.c (match_substring): Use gfc_charlen_int_kind.
939         * resolve.c (resolve_substring_charlen): Use gfc_charlen_int_kind.
940         (resolve_character_operator): Likewise.
941         (resolve_assoc_var): Likewise.
942         (resolve_select_type): Use HOST_WIDE_INT for charlen, use snprintf.
943         (resolve_charlen): Use mpz_sgn to determine sign.
944         * simplify.c (gfc_simplify_repeat): Use HOST_WIDE_INT/gfc_charlen_t
945         instead of long.
946         * symbol.c (generate_isocbinding_symbol): Use gfc_charlen_int_kind.
947         * target-memory.c (size_character): Length argument of type
948         gfc_charlen_t.
949         (gfc_encode_character): Likewise.
950         (gfc_interpret_character): Use gfc_charlen_t.
951         * target-memory.h (gfc_encode_character): Modify prototype.
952         * trans-array.c (gfc_trans_array_ctor_element): Use existing type.
953         (get_array_ctor_var_strlen): Use gfc_conv_mpz_to_tree_type.
954         (trans_array_constructor): Use existing type.
955         (get_array_charlen): Likewise.
956         * trans-const.c (gfc_conv_mpz_to_tree_type): New function.
957         * trans-const.h (gfc_conv_mpz_to_tree_type): New prototype.
958         * trans-decl.c (gfc_trans_deferred_vars): Use existing type.
959         (add_argument_checking): Likewise.
960         * trans-expr.c (gfc_class_len_or_zero_get): Build const of type
961         gfc_charlen_type_node.
962         (gfc_conv_intrinsic_to_class): Use gfc_charlen_int_kind instead of
963         4, fold_convert to correct type.
964         (gfc_conv_class_to_class): Build const of type size_type_node for
965         size.
966         (gfc_copy_class_to_class): Likewise.
967         (gfc_conv_string_length): Use same type in expression.
968         (gfc_conv_substring): Likewise, use HOST_WIDE_INT for charlen.
969         (gfc_conv_string_tmp): Make sure len is of the right type.
970         (gfc_conv_concat_op): Use same type in expression.
971         (gfc_conv_procedure_call): Likewise.
972         (fill_with_spaces): Comment out memset() block due to spurious
973         -Wstringop-overflow warnings.
974         (gfc_trans_string_copy): Use gfc_charlen_type_node.
975         (alloc_scalar_allocatable_for_subcomponent_assignment):
976         fold_convert to right type.
977         (gfc_trans_subcomponent_assign): Likewise.
978         (trans_class_vptr_len_assignment): Build const of correct type.
979         (gfc_trans_pointer_assignment): Likewise.
980         (alloc_scalar_allocatable_for_assignment): fold_convert to right
981         type in expr.
982         (trans_class_assignment): Build const of correct type.
983         * trans-intrinsic.c (gfc_conv_associated): Likewise.
984         (gfc_conv_intrinsic_repeat): Do calculation in sizetype.
985         * trans-io.c (gfc_build_io_library_fndecls): Use
986         gfc_charlen_type_node for character lengths.
987         (set_string): Convert to right type in assignment.
988         * trans-stmt.c (gfc_trans_label_assign): Build const of
989         gfc_charlen_type_node.
990         (trans_associate_var): Likewise.
991         (gfc_trans_character_select): Likewise.
992         (gfc_trans_allocate): Likewise, don't typecast strlen result.
993         (gfc_trans_deallocate): Don't typecast strlen result.
994         * trans-types.c (gfc_size_kind): New variable.
995         (gfc_init_types): Determine gfc_charlen_int_kind and gfc_size_kind
996         from size_type_node.
997         * trans-types.h: Fix comment.
999 2018-01-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
1001         PR fortran/83683
1002         PR fortran/45689
1003         * check.c (gfc_check_eoshift): Check for string length and
1004         for conformance of boundary.
1005         * intrinsic.c (add_functions): Add gfc_simplify_eoshift.
1006         * intrinsic.h: Add prototype for gfc_simplify_eoshift.
1007         * simplify.c (gfc_simplify_eoshift): New function.
1009 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1010             Alan Hayward  <alan.hayward@arm.com>
1011             David Sherwood  <david.sherwood@arm.com>
1013         * trans-types.c (gfc_type_for_mode): Handle MODE_VECTOR_BOOL.
1015 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
1016             Alan Hayward  <alan.hayward@arm.com>
1017             David Sherwood  <david.sherwood@arm.com>
1019         * trans-types.c (gfc_type_for_mode): Check valid_vector_subparts_p.
1021 2018-01-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
1023         PR fortran/83664
1024         * check.c (gfc_check_eoshift): Error for missing boundary if array
1025         is not one of the standard types.
1027 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
1029         Update copyright years.
1031         * gfortranspec.c (lang_specific_driver): Update copyright notice
1032         dates.
1033         * gfc-internals.texi: Bump @copying's copyright year.
1034         * gfortran.texi: Ditto.
1035         * intrinsic.texi: Ditto.
1036         * invoke.texi: Ditto.
1038 2017-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
1040         PR fortran/45689
1041         * intrinsic.c (add_function): Add gfc_simplify_maxloc and
1042         gfc_simplify_minloc to maxloc and minloc, respectively.
1043         * intrinsic.h: Add prototypes for gfc_simplify_minloc
1044         and gfc_simplify_maxloc.
1045         * simplify.c (min_max_chose): Adjust prototype.  Modify function
1046         to have a return value which indicates if the extremum was found.
1047         (is_constant_array_expr): Fix typo in comment.
1048         (simplify_minmaxloc_to_scalar): New function.
1049         (simplify_minmaxloc_nodim): New function.
1050         (new_array): New function.
1051         (simplify_minmaxloc_to_array): New function.
1052         (gfc_simplify_minmaxloc): New function.
1053         (simplify_minloc): New function.
1054         (simplify_maxloc): New function.
1056 2018-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
1058         PR fortran/45689
1059         PR fortran/83650
1060         * simplify.c (gfc_simplify_cshift): Re-implement to allow full
1061         range of arguments.
1063 2018-01-01  Paul Thomas  <pault@gcc.gnu.org>
1065         PR fortran/83076
1066         * resolve.c (resolve_fl_derived0): Add caf_token fields for
1067         allocatable and pointer scalars, when -fcoarray selected.
1068         * trans-types.c (gfc_copy_dt_decls_ifequal): Copy the token
1069         field as well as the backend_decl.
1070         (gfc_get_derived_type): Flag GFC_FCOARRAY_LIB for module
1071         derived types that are not vtypes. Components with caf_token
1072         attribute are pvoid types. For a component requiring it, find
1073         the caf_token field and have the component token field point to
1074         its backend_decl.
1076         PR fortran/83319
1077         *trans-types.c (gfc_get_array_descriptor_base): Add the token
1078         field to the descriptor even when codimen not set.
1080 Copyright (C) 2018 Free Software Foundation, Inc.
1082 Copying and distribution of this file, with or without modification,
1083 are permitted in any medium without royalty provided the copyright
1084 notice and this notice are preserved.