2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
[official-gcc.git] / gcc / fortran / ChangeLog
blob818c50f9a194ca9288dc327da5b5397f82ad4620
1 2018-03-15  Steven G. Kargl  <kargl@gcc.gnu.org>
3         PR fortran/78741
4         * decl.c (get_proc_name):  Check for clash of entry name with
5         subroutine name.
7 2018-03-15  Steven G. Kargl  <kargl@gcc.gnu.org>
9         PR fortran/69395
10         * decl.c (merge_array_spec): Limit the merging to maximum allowed
11         dimensions, and issue error message if limit is exceeded.
13 2018-03-13  Steven G. Kargl  <kargl@gcc.gnu.org>
15         * check.c (gfc_check_kill_sub):  Remove check for INTEGER(4) or (8).
16         * intrinsic.c (add_functions): Remove reference to gfc_resolve_kill.
17         (add_subroutines): Remove reference to gfc_resolve_kill_sub.
18         * intrinsic.texi: Update documentation.
19         * iresolve.c (gfc_resolve_kill, gfc_resolve_kill_sub): Remove.
20         * trans-decl.c (gfc_build_intrinsic_function_decls):  Add
21         gfor_fndecl_kill and gfor_fndecl_kill_sub
22         * trans-intrinsic.c (conv_intrinsic_kill, conv_intrinsic_kill_sub): new
23         functions.
24         (gfc_conv_intrinsic_function): Use conv_intrinsic_kill.
25         (gfc_conv_intrinsic_subroutine): Use conv_intrinsic_kill_sub.
26         * trans.h: Declare gfor_fndecl_kill and gfor_fndecl_kill_sub.
28 2018-03-11  Paul Thomas  <pault@gcc.gnu.org>
30         PR fortran/84546
31         * trans-array.c (structure_alloc_comps): Make sure that the
32         vptr is copied and that the unlimited polymorphic _len is used
33         to compute the size to be allocated.
34         * trans-expr.c (gfc_get_class_array_ref): If unlimited, use the
35         unlimited polymorphic _len for the offset to the element.
36         (gfc_copy_class_to_class): Set the new 'unlimited' argument.
37         * trans.h : Add the boolean 'unlimited' to the prototype.
39 2018-03-11  Steven G. Kargl  <kargl@gcc.gnu.org>
41         PR fortran/83939
42         * resolve.c (resolve_fl_procedure): Enforce F2018:C15100.
44 2018-03-11  Steven G. Kargl  <kargls@gcc.gnu.org>
46         * check.c (gfc_check_kill):  Check pid and sig are scalar.
47         (gfc_check_kill_sub): Restrict kind to 4 and 8.
48         * intrinsic.c (add_function): Sort keyword list.  Add pid and sig
49         keywords for KILL.  Remove redundant *back="back" in favor of the
50         original *bck="back".
51         (add_subroutines): Sort keyword list.  Add pid and sig keywords
52         for KILL.
53         * intrinsic.texi: Fix documentation to consistently use pid and sig.
54         * iresolve.c (gfc_resolve_kill): Kind can only be 4 or 8.  Choose the
55         correct function.
56         (gfc_resolve_rename_sub): Add comment.
58 2018-03-11  Thomas Koenig  <tkoenig@gcc.gnu.org>
60         PR fortran/66128
61         * simplify.c (simplify_transformation): Return default result for
62         empty array argument.
63         (gfc_simplify_all): Remove special-case handling for zerosize.
64         (gfc_simplify_any): Likewise.
65         (gfc_simplify_count): Likewise.
66         (gfc_simplify_iall): Likewise.
67         (gfc_simplify_iany): Likewise.
68         (gfc_simplify_iparity): Likewise.
69         (gfc_simplify_minval): Likewise.
70         (gfc_simplify_maxval): Likewise.
71         (gfc_simplify_norm2): Likewise.
72         (gfc_simplify_product): Likewise.
73         (gfc_simplify_sum): Likewise.
75 2018-03-10  Steven G. Kargl  <kargl@gcc.gnu.org>
77         PR fortran/84734
78         * arith.c (check_result, eval_intrinsic):  If result overflows, pass
79         the expression up the chain instead of a NULL pointer.
81 2018-03-07  Steven G. Kargl  <kargl@gcc.gnu.org>
83         PR fortran/64124
84         PR fortran/70409
85         * decl.c (gfc_match_char_spec): Try to reduce a charlen to a constant.
87 2017-03-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
89         PR fortran/84697
90         PR fortran/66128
91         * expr.c (simplify_parameter_variable): If p is a size zero array
92         and not an ARRAY_EXPR insert an empty array constructor and
93         return.
94         * gfortran.h: Add prototype for gfc_is_size_zero_array.
95         * simplify.c (is_size_zero_array): Make non-static and rename into
96         (gfc_is_size_zero_array):  Check for parameter arrays of zero
97         size by comparing shape and absence of constructor.
98         (gfc_simplify_all): Use gfc_is_size_zero_array instead of
99         is_size_zero_array.
100         (gfc_simplify_count): Likewise.
101         (gfc_simplify_iall): Likewise.
102         (gfc_simplify_iany): Likewise.
103         (gfc_simplify_iparity): Likewise.
104         (gfc_simplify_minval): Likewise.
105         (gfc_simplify_maxval): Likewise.
106         (gfc_simplify_product): Likewise.
107         (gfc_simplify_sum): Likewise.
109 2018-03-06  Steven G. Kargl  <kargl@gcc.gnu.org>
111         PR fortran/56667
112         * primary.c (match_sym_complex_part): Give the matcher for an implied
113         do-loop a chance to run.
115 2018-03-03  Harald Anlauf  <anlauf@gmx.de>
117         PR fortran/71085
118         * trans-expr.c (gfc_apply_interface_mapping_to_expr): Do not
119         dereference NULL pointer.
121 2018-03-03  Steven G. Kargl  <kargl@gcc.gnu.org>
123         PR fortran/66128
124         * simplify.c (is_size_zero_array): New function to check for size
125         zero array.
126         (gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
127          gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
128          gfc_simplify_minval, gfc_simplify_maxval, gfc_simplify_norm2,
129          gfc_simplify_product, gfc_simplify_sum): Use it, and implement
130         requirements from F2018.
132 2018-03-03  Steven G. Kargl  <kargl@gcc.gnu.org>
134         PR fortran/51434
135         * simplify.c (gfc_simplify_transfer): Resolve mold.
137 2018-03-03  Paul Thomas  <pault@gcc.gnu.org>
139         PR fortran/80965
140         * resolve.c (build_loc_call): Change symtree name from 'loc' to
141         '_loc'.
143 2018-03-01  Paul Thomas  <pault@gcc.gnu.org>
145         PR fortran/84219
146         * target-memory.c (gfc_interpret_derived): Assert that BT_VOID
147         components are caf tokens.
148         (gfc_target_interpret_expr): Treat BT_VOID expressions as
149         integers.
151 2018-03-01  Paul Thomas  <pault@gcc.gnu.org>
153         PR fortran/84538
154         * class.c (class_array_ref_detected): Remove the condition that
155         there be no reference after the array reference.
156         (find_intrinsic_vtab): Remove excess whitespace.
157         * trans-array.c (gfc_conv_scalarized_array_ref): Rename 'tmp'
158         as 'base and call build_class_array_ref earlier.
160 2018-02-28  Paul Thomas  <pault@gcc.gnu.org>
162         PR fortran/83901
163         * trans-stmt.c (trans_associate_var): Make sure that the se
164         expression is a pointer type before converting it to the symbol
165         backend_decl type.
167 2018-02-25  Steven G. Kargl  <kargl@gcc.gnu.org>
169         PR fortran/83633
170         * decl.c (variable_decl): Check that an explicit-shape-array with
171         nonconstant bounds is allowed.
173 2018-02-25  Paul Thomas  <pault@gcc.gnu.org>
175         PR fortran/84523
176         * trans-intrinsic.c (gfc_conv_allocated): If the argument se
177         has a pre block, add it to the expression pre block.
179 2018-02-25  Thomas Koenig  <tkoenig@gcc.gnu.org>
181         PR fortran/78238
182         * gfortran.h (gfc_integer_4_kind): Define.
183         * resolve.c (resolve_select_type): Make sure that the
184         kind of c->high is gfc_integer_4_kind.
186 2018-02-24  Steven G. Kargl <kargl@gcc.gnu.org>
188         PR fortran/30792
189         * decl.c (gfc_match_data): Check for invalid substring in
190         data-implied-do
192 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
194         * intrinsic.texi: Arguments to MATMUL cannot both be rank one.
196 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
198         PR fortran/84511
199         * trans-io.c (transfer_expr): Deal with C_LOC in transfer statement.
201 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
203         PR fortran/84346
204         * interface.c (compare_actual_formal): Issue error if keyword is
205         used in a statement function.
207 2018-02-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
209         PR fortran/84506
210         * trans-io.c (set_parameter_value_inquire): Adjust range check of
211         negative unit values for kind=8 units to the kind=4 negative limit.
213 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
215         PR fortran/83149
216         * trans-types.c (gfc_sym_type): Test sym->ns->proc_name before
217         accessing its components.
219 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
221         PR fortran/83149
222         * trans-decl.c (gfc_finish_var_decl): Test sym->ns->proc_name
223         before accessing its components.
225 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
227         PR fortran/83148
228         * trans-const.c : Clean up some whitespace issues.
229         * trans-expr.c (gfc_conv_initializer): If an iso_c_binding
230         derived type has a kind value of zero, set it to the default
231         integer kind.
233 2018-02-23  Janne Blomqvist  <jb@gcc.gnu.org>
235         PR fortran/84519
236         * trans-decl.c (gfc_build_builtin_function_decls): Add bool
237         argument to stop and error stop decls.
238         * trans-stmt.c (gfc_trans_stop): Add false value to argument
239         lists.
241 2018-02-22  Janne Blomqvist  <jb@gcc.gnu.org>
243         PR 78534
244         PR 84509
245         * trans-decl.c (gfc_build_builtin_function_decls): Pass
246         gfc_int8_type node to pause_numeric, size_type_node to
247         pause_string.
248         * trans-stmt.c (gfc_trans_pause): Likewise.
250 2018-02-22  Janne Blomqvist  <jb@gcc.gnu.org>
252         * gfortran.texi: Update Coarray API description.
253         * trans-decl.c (gfc_build_builtin_function_decls): Use size_t for
254         character lengths, int for exit codes.
255         (generate_coarray_sym_init): Use size_t for character length.
256         * trans-intrinsic.c (conv_co_collective): Likewise.
257         * trans-stmt.c (gfc_trans_lock_unlock): Likewise.
258         (gfc_trans_event_post_wait): Likewise.
259         (gfc_trans_sync): Likewise.
260         (gfc_trans_stop): Use size_t for character lengths, int for exit
261         codes.
263 2018-02-20  Thomas Koenig  <tkoenig@gcc.gnu.org>
265         PR fortran/48890
266         PR fortran/83823
267         * primary.c (gfc_convert_to_structure_constructor):
268         For a constant string constructor, make sure the length
269         is correct.
271 2018-02-19  Paul Thomas  <pault@gcc.gnu.org>
273         PR fortran/83344
274         PR fortran/83975
275         * resolve.c (resolve_assoc_var): Rearrange the logic for the
276         determination of the character length of associate names. If
277         the associate name is missing a length expression or the length
278         expression is not a constant and the target is not a variable,
279         make the associate name allocatable and deferred length.
280         * trans-decl.c (gfc_get_symbol_decl): Null the character length
281         backend_decl for deferred length associate names that are not
282         variables. Set 'length' to gfc_index_zero_node for character
283         associate names, whose character length is a PARM_DECL.
285 2018-02-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
287         PR fortran/35339
288         * frontend-passes.c (traverse_io_block): Remove workaround for
289         PR 80945.
291 2018-02-19  Andre Vehreschild  <vehre@gcc.gnu.org>
293         * gfortran.texi: Document additional src/dst_type.  Fix some typos.
294         * trans-decl.c (gfc_build_builtin_function_decls): Declare the new
295         argument of _caf_*_by_ref () with * e { get, send, sendget }.
296         * trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Add the type of the
297         data referenced when generating a call to caf_get_by_ref ().
298         (conv_caf_send): Same but for caf_send_by_ref () and
299         caf_sendget_by_ref ().
301 2018-02-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
303         PR fortran/84389
304         * io.c (check_format): Allow FMT_COLON.
306 2018-02-18  Paul Thomas  <pault@gcc.gnu.org>
308         PR fortran/80945
309         * trans-array.c (gfc_conv_expr_descriptor): Set parmtype from
310         the typenode in the case of deferred length characters.
312 2018-02-17  Thomas Koenig  <tkoenig@gcc.gnu.org>
314         PR fortran/84270
315         * frontend-passes (scalarized_expr):  If the expression
316         is an assumed size array, leave in the last reference
317         and pass AR_SECTION instead of AR_FULL to gfc_resolve
318         in order to avoid an error.
320 2018-02-17  Paul Thomas  <pault@gcc.gnu.org>
322         PR fortran/84115
323         * resolve.c (resolve_assoc_var): If a non-constant target expr.
324         has no string length expression, make the associate variable
325         into a deferred length, allocatable symbol.
326         * trans-decl.c (gfc_is_reallocatable_lhs): Add and use a ptr to
327         the symbol.
328         * trans-stmt.c (trans_associate_var): Null and free scalar
329         associate names that are allocatable. After assignment, remove
330         the allocatable attribute to prevent reallocation.
332 2018-02-16  Jakub Jelinek  <jakub@redhat.com>
334         PR fortran/84418
335         * trans-openmp.c (gfc_trans_omp_clauses): For OMP_CLAUSE_LINEAR_REF
336         kind set OMP_CLAUSE_LINEAR_STEP to TYPE_SIZE_UNIT times last_step.
338 2018-02-16  Dominique d'Humieres  <dominiq@gcc.gnu.org>
340         PR fortran/84354
341         * decl.c (gfc_get_pdt_instance): Replace '%qs' with %qs.
343 2018-02-15  Janus Weil  <janus@gcc.gnu.org>
345         PR fortran/84409
346         * interface.c (check_dtio_arg_TKR_intent): Add a check for character
347         length.
349 2018-02-14  Janus Weil  <janus@gcc.gnu.org>
351         PR fortran/84385
352         * match.c (gfc_match_select_type): Fix check for selector in
353         SELECT TYPE statement.
355 2018-02-13  Janus Weil  <janus@gcc.gnu.org>
357         PR fortran/84313
358         * symbol.c (check_conflict): Reject procedure pointers in common blocks.
360 2018-02-13  Alastair McKinstry  <alastair.mckinstry@sceal.ie>
361             Janne Blomqvist  <jb@gcc.gnu.org>
363         * module.c (dump_module): Use lbasename to ensure that module
364         files are reproducible.
366 2018-02-12  Janus Weil  <janus@gcc.gnu.org>
368         PR fortran/84273
369         * resolve.c (resolve_component): Fix checks of passed argument in
370         procedure-pointer components.
372 2018-02-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
374         PR fortran/35299
375         * resolve.c (resolve_formal_arglist): Update error message.
377 2018-02-11  Andre Vehreschild  <vehre@gcc.gnu.org>
379         * gfortran.texi: Fix typos in documentation of caf_register ().
380         * trans-array.c (structure_alloc_comps): Only register a component of
381         a derived typed corray, not of an ultimate component coarray.
383 2018-02-11  Steven G. Kargl  <kargl@gcc.gnu.org>
385         PR fortran/54223
386         PR fortran/84276
387         * interface.c (compare_actual_formal): Add in_statement_function
388         bool parameter.  Skip check of INTENT attribute for statement
389         functions.  Arguments to a statement function cannot be optional,
390         issue error for missing argument.
391         (gfc_procedure_use, gfc_ppc_use, gfc_arglist_matches_symbol): Use
392          in_statement_function.
394 2018-02-11  Paul Thomas  <pault@gcc.gnu.org>
396         PR fortran/84074
397         * trans-expr.c (gfc_conv_derived_to_class): Set the use_offset
398         flag. If the is a vector subscript or the expression is not a
399         variable, make the descriptor one-based.
401 2018-02-10  Paul Thomas  <pault@gcc.gnu.org>
403         PR fortran/84141
404         PR fortran/84155
405         * trans-array.c (gfc_array_init_size): Revert the change made
406         in revision 257356 setting the dtype.
407         * trans-types.c (gfc_get_dtype): Do not use the cached dtype.
408         Call gfc_get_dtype_rank_type every time.
410         PR fortran/56691
411         * trans-array.c (gfc_conv_expr_descriptor): If the source array
412         is a descriptor type, use its offset, removing the condition
413         that is be a class expression.
415 2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>
417         PR fortran/82994
418         * match.c (gfc_match_deallocate): Check for NULL pointer.
420 2018-02-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
422         PR fortran/68560
423         * trans-intrinsic.c (gfc_conv_intrinsic_shape): New function.
424         (gfc_conv_intrinsic_function): Call it.
426 2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>
428         PR fortran/82049
429         * match.c (gfc_match_type_spec): If the charlen is non-NULL, then
430         try to resolve it.  While here return early if possible.
432 2018-02-04  Paul Thomas  <pault@gcc.gnu.org>
434         PR fortran/84115
435         * trans-decl.c (gfc_get_symbol_decl): Do not finish the decl of
436         'length' if the symbol charlen backend_decl is an indirect ref.
438 2018-02-03  Paul Thomas  <pault@gcc.gnu.org>
440         PR fortran/84141
441         PR fortran/84155
442         * trans-array.c (gfc_array_init_size): Instead of gfc_get_dtype
443         use gfc_get_dtype_rank_type.
445 2018-02-01  Janne Blomqvist  <jb@gcc.gnu.org>
447         PR 83975
448         PR 83344
449         * resolve.c (resolve_assoc_var): Generate an error if
450         target length unknown.
452 2018-02-01  Janne Blomqvist  <jb@gcc.gnu.org>
454         PR fortran/83705
455         * simplify.c (gfc_simplify_repeat): Increase limit for deferring
456         to runtime, print a warning message.
458 2018-01-31  Jakub Jelinek  <jakub@redhat.com>
460         PR fortran/84116
461         * openmp.c (gfc_match_omp_clauses): If all the linear
462         gfc_match_omp_variable_list calls failed, don't gfc_free_omp_namelist
463         nor set *head = NULL.  Formatting fixes.
465 2018-01-31  Paul Thomas  <pault@gcc.gnu.org>
467         PR fortran/84088
468         * trans-expr.c (gfc_conv_procedure_call): If the parm expr is
469         an address expression passed to an assumed rank dummy, convert
470         to an indirect reference.
472 2018-01-31  Thomas Koenig  <tkoenig@gcc.gnu.org>
474         * dump-parse-tree.c (write_proc): Use sym_name (which may
475         be sym->binding_label) instead of sym->name.
477 2018-01-31  Janne Blomqvist  <jb@gcc.gnu.org>
479         * trans-const.c (gfc_conv_string_init): Use gfc_charlen_t instead
480         of int for slen.
482 2018-01-31  Janne Blomqvist  <jb@gcc.gnu.org>
484         PR fortran/78534
485         * trans-expr.c (fill_with_spaces): Use memset instead of
486         generating loop.
487         (gfc_trans_string_copy): Improve opportunity to use builtins with
488         constant lengths.
490 2018-01-30  Jakub Jelinek  <jakub@redhat.com>
492         PR debug/84131
493         * trans-array.c (gfc_get_descriptor_offsets_for_info): Set *data_off
494         to DATA_FIELD's offset rather than OFFSET_FIELD's offset.
496 2018-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
498         PR fortran/84134
499         * array.c (gfc_ref_dimen_size): Whitespace fixes.  If stride is
500         zero, return false.
502 2018-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
504         PR fortran/84133
505         * frontend-passes (matmul_to_var_expr): Return early if
506         in association list.
507         (inline_matmul_assign): Likewise.
509 2017-01-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
511         PR fortran/84073
512         * resolve.c (resolve_component): Ensure BIND(C) character
513         components have length one.
514         (resolve_symbol): Likewise for variables.
516 2018-01-27  Jakub Jelinek  <jakub@redhat.com>
518         PR fortran/84065
519         * decl.c (add_init_expr_to_sym): Ignore initializers for too large
520         lengths.
522 2018-01-26  Damian Rouson  <damian@sourceryinstitute.org>
523             Alessandro Fanfarillo  <fanfarillo.gcc@gmail.com>
524             Soren Rasmussen  <s.c.rasmussen@gmail.com>
526         Partial support for Fortran 2018 teams features.
528         * array.c (gfc_match_array_ref): add team attribute in coarray
529         transfers.
530         * check.c (gfc_check_get_team, gfc_check_team_number): add new
531         functions for get_team and team_number.
532         * dump-parse-tree.c (show_code_node): add new statements: form team,
533         change team, end team, and sync team.
534         * expr.c (gfc_find_team_co): add new function.
535         * gfortran.h: add new statements.
536         * intrinsic.c (add_functions): add get_team and team_number functions.
537         * intrinsic.h: add get_team and team_number prototypes for check,
538         simplify, and resolve.
539         * iresolve.c (gfc_resolve_get_team, gfc_resolve_team_number): add new
540         functions.
541         * iso-fortran-env.def: add the team_type derived type.
542         * match.c (gfc_match_if, gfc_match_form_team, gfc_match_team_number)
543         (gfc_match_end_team, gfc_match_sync_team, gfc_match_change_team):
544         add change team, end team, form team, sync team match and functions.
545         * match.h: add new prototypes for change team, end team, form team,
546         and sync team.
547         * parse.c (decode_statement): add cases for change team, end team,
548         form team, and sync team.
549         * resolve.c: add cases for exec form team, change team, end team, and
550         sync team.
551         * simplify.c (gfc_simplify_get_team): add new function for get team.
552         * st.c (gfc_free_statement): add cases exec for change team, end team,
553         form team, sync team.
554         * trans-decl.c (gfor_fndecl_caf_form_team)
555         (gfor_fndecl_caf_change_team, gfor_fndecl_caf_end_team)
556         (gfor_fndecl_caf_sync_team, gfor_fndecl_caf_get_team)
557         (gfor_fndecl_caf_team_number): add functions and definitions.
558         * trans-intrinsic.c (conv_caf_send, conv_intrinsic_team_number): add
559         new function and team_type argument support.
560         * trans-stmt.c (gfc_trans_form_team, gfc_trans_change_team)
561         (gfc_trans_end_team, gfc_trans_sync_team): add new functions.
562         * trans-stmt.h: add new prototypes.
563         * trans-types.c (gfc_get_derived_type): check condition for team_type.
564         * trans.c (trans_code): new exec cases for form team, change team, end
565         team, and sync team.
566         * trans.h: add new prototypes.
568 2018-01-26  Steven G. Kargl  <kargl@gcc.gnu.org>
570         PR fortran/83998
571         * simplify.c (compute_dot_product):  Initialize result to INTEGER(1) 0
572         or .false.  The summation does the correct type conversion.
573         (gfc_simplify_dot_product): Special case zero-sized arrays.
575 2018-25-01  Paul Thomas  <pault@gcc.gnu.org>
577         PR fortran/37577
578         * array.c (gfc_match_array_ref): If standard earlier than F2008
579         it is an error if the reference dimension is greater than 7.
580         libgfortran.h : Increase GFC_MAX_DIMENSIONS to 15. Change the
581         dtype masks and shifts accordingly.
582         * trans-array.c (gfc_conv_descriptor_dtype): Use the dtype
583         type node to check the field.
584         (gfc_conv_descriptor_dtype): Access the rank field of dtype.
585         (duplicate_allocatable_coarray): Access the rank field of the
586         dtype descriptor rather than the dtype itself.
587         * trans-expr.c (get_scalar_to_descriptor_type): Store the type
588         of 'scalar' on entry and use its TREE_TYPE if it is ARRAY_TYPE
589         (ie. a character).
590         (gfc_conv_procedure_call): Pass TREE_OPERAND (tmp,0) to
591         get_scalar_to_descriptor_type if the actual expression is a
592         constant.
593         (gfc_trans_structure_assign): Assign the rank directly to the
594         dtype rank field.
595         * trans-intrinsic.c (gfc_conv_intrinsic_rank): Cast the result
596         to default integer kind.
597         (gfc_conv_intrinsic_sizeof): Obtain the element size from the
598         'elem_len' field of the dtype.
599         * trans-io.c (gfc_build_io_library_fndecls): Replace
600         gfc_int4_type_node with dtype_type_node where necessary.
601         (transfer_namelist_element): Use gfc_get_dtype_rank_type for
602         scalars.
603         * trans-types.c : Provide 'get_dtype_type_node' to acces the
604         dtype_type_node and, if necessary, build it.
605         The maximum size of an array element is now determined by the
606         maximum value of size_t.
607         Update the description of the array descriptor, including the
608         type def for the dtype_type.
609         (gfc_get_dtype_rank_type): Build a constructor for the dtype.
610         Distinguish RECORD_TYPEs that are BT_DERIVED or BT_CLASS.
611         (gfc_get_array_descriptor_base): Change the type of the dtype
612         field to dtype_type_node.
613         (gfc_get_array_descr_info): Get the offset to the rank field of
614         the dtype.
615         * trans-types.h : Add a prototype for 'get_dtype_type_node ()'.
616         * trans.h : Define the indices of the dtype fields.
618 2018-23-01  Paul Thomas  <pault@gcc.gnu.org>
620         PR fortran/83866
621         * decl.c (gfc_match_derived_decl): If eos not matched, recover
622         and emit error about garbage after declaration.
624 2018-23-01  Paul Thomas  <pault@gcc.gnu.org>
626         PR fortran/83898
627         * trans-stmt.c (trans_associate_var): Do not set cst_array_ctor
628         for characters.
630 2018-01-22  Janne Blomqvist  <jb@gcc.gnu.org>
632         PR 78534
633         PR 83704
634         * arith.c (gfc_arith_concat): Use size_t for string length.
635         (gfc_compare_string): Likewise.
636         (gfc_compare_with_Cstring): Likewise.
637         * array.c (gfc_resolve_character_array_constructor): Use
638         HOST_WIDE_INT, gfc_mpz_get_hwi.
639         * check.c (gfc_check_fe_runtime_error): Use size_t.
640         * data.c (create_character_initializer): Use HOST_WIDE_INT,
641         gfc_extract_hwi.
642         * decl.c (gfc_set_constant_character_len): Use gfc_charlen_t.
643         (add_init_expr_to_sym): Use HOST_WIDE_INT.
644         * expr.c (gfc_build_init_expr): Use HOST_WIDE_INT,
645         gfc_extract_hwi.
646         (gfc_apply_init): Likewise.
647         * match.h (gfc_set_constant_character_len): Update prototype.
648         * primary.c (match_string_constant): Use size_t.
649         * resolve.c (resolve_ordinary_assign): Use HOST_WIDE_INT,
650         gfc_mpz_get_hwi.
651         * simplify.c (init_result_expr): Likewise.
652         (gfc_simplify_len_trim): Use size_t.
653         * target-memory.c (gfc_encode_character): Use size_t.
654         (gfc_target_encode_expr): Use HOST_WIDE_INT, gfc_mpz_get_hwi.
655         (interpret_array): Use size_t.
656         (gfc_interpret_character): Likewise.
657         * target-memory.h (gfc_encode_character): Update prototype.
658         (gfc_interpret_character): Likewise.
659         (gfc_target_interpret_expr): Likewise.
660         * trans-const.c (gfc_build_string_const): Use size_t for length
661         argument.
662         (gfc_build_wide_string_const): Likewise.
663         * trans-const.h (gfc_build_string_const): Likewise.
664         (gfc_build_wide_string_const): Likewise.
666 2018-01-20  Steven G. Kargl  <kargl@gcc.gnu.org>
668         PR fortran/83900
669     * simplify.c (gfc_simplify_matmul): Set return type correctly.
671 2018-01-19  Steven G. Kargl  <kargl@gcc.gnu.org>
673         PR fortran/83900
674         * simplify.c (gfc_simplify_matmul): Delete bogus assertion.
676 2018-01-17  Harald Anlauf  <anlauf@gmx.de>
678         PR fortran/83864
679         * expr.c (add_init_expr_to_sym): Do not dereference NULL pointer.
681 2018-01-17  Harald Anlauf  <anlauf@gmx.de>
683         PR fortran/83874
684         * decl.c (add_init_expr_to_sym): Do not dereference NULL pointer.
686 2018-01-15  Louis Krupp  <louis.krupp@zoho.com>
688         PR fortran/82257
689         * interface.c (compare_rank): Don't try to retrieve CLASS_DATA
690         from symbol marked unlimited polymorphic.
691         * resolve.c (resolve_structure_cons): Likewise.
692         * misc.c (gfc_typename): Don't dereference derived->components
693         if it's NULL.
695 2018-01-15  Thomas Koenig  <tkoenig@gcc.gnu.org>
697         PR fortran/54613
698         * gfortran.h (gfc_check_f): Rename f4ml to f5ml.
699         (gfc_logical_4_kind): New macro
700         * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument.
701         (gfc_simplify_maxloc): Likewise.
702         (gfc_resolve_maxloc): Likewise.
703         (gfc_resolve_minloc): Likewise.
704         * check.c (gfc_check_minloc_maxloc): Add checking for "back"
705         argument; also raise error if it is used (for now). Add it
706         if it isn't present.
707         * intrinsic.c (add_sym_4ml): Rename to
708         (add_sym_5ml), adjust for extra argument.
709         (add_functions): Add "back" constant. Adjust maxloc and minloc
710         for back argument.
711         * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is
712         not of gfc_logical_4_kind, convert.
713         (gfc_resolve_minloc): Likewise.
714         * simplify.c (gfc_simplify_minloc): Add back argument.
715         (gfc_simplify_maxloc): Likewise.
716         * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last
717         argument to %VAL to ensure passing by value.
718         (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc
719         also for library calls.
721 2018-01-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
723         PR fortran/82007
724         * resolve.c (resolve_transfer): Delete code looking for 'DT'
725         format specifiers in format strings. Set formatted to true if a
726         format string or format label is present.
727         * trans-io.c (get_dtio_proc): Likewise. (transfer_expr): Fix
728         whitespace.
730 2018-01-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
732         PR fortran/83744
733         * dump-parse-tree.c (get_c_type_name): Remove extra line.
734         Change for loop to use declaration in for loop. Handle BT_LOGICAL
735         and BT_CHARACTER.
736         (write_decl): Add where argument. Fix indentation. Replace
737         assert with error message. Add typename to warning
738         in comment.
739         (write_type): Adjust locus to call of write_decl.
740         (write_variable): Likewise.
741         (write_proc): Likewise. Replace assert with error message.
743 2018-01-13  Paul Thomas  <pault@gcc.gnu.org>
745         PR fortran/52162
746         * trans-expr.c (gfc_trans_scalar_assign): Flag is_alloc_lhs if
747         the rhs expression is neither an elemental nor a conversion
748         function.
750         PR fortran/83622
751         * trans-array.c (is_pointer_array): Remove unconditional return
752         of false for -fopenmp.
754 2018-01-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
755         <emsr@gcc.gnu.org>
757         PR fortran/83803
758         * dump-parse-tree.c (write_proc): Always emit closing parenthesis
759         for functions.
761 2018-01-10  Steven G. Kargl  <kargl@gcc.gnu.org>
763         PR fortran/82367
764         * resolve.c (resolve_allocate_expr): Check for NULL pointer.
766 2018-01-10  Steven G. Kargl  <kargl@gcc.gnu.org>
768         PR fortran/83093
769         * resolve.c (resolve_charlen): Check the type of cl->length
770         after resolution.
772 2018-01-10  Janne Blomqvist  <jb@gcc.gnu.org>
774         PR fortran/83740
775         * trans-array.c (gfc_trans_array_ctor_element): Fix formatting.
777 2018-01-10  Janne Blomqvist  <jb@gcc.gnu.org>
779         PR fortran/83740
780         * trans-array.c (gfc_trans_array_ctor_element): Convert RHS to the
781         LHS type when assigning.
783 2018-01-09  Steven G. Kargl  <kargl@gcc.gnu.org>
785         PR fortran/83742
786         * expr.c (gfc_is_simply_contiguous): Check for NULL pointer.
788 2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>
790         * match.c (gfc_match_allocate): Check for NULL pointer.
792 2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>
794         * expr.c (gfc_check_pointer_assign): Fix typo in comment.
796 2018-01-08  Paul Thomas  <pault@gcc.gnu.org>
798         PR fortran/83611
799         * decl.c (gfc_get_pdt_instance): If parameterized arrays have
800         an initializer, convert the kind parameters and add to the
801         component if the instance.
802         * trans-array.c (structure_alloc_comps): Add 'is_pdt_type' and
803         use it with case COPY_ALLOC_COMP. Call 'duplicate_allocatable'
804         for parameterized arrays. Clean up typos in comments. Convert
805         parameterized array initializers and copy into the array.
806         * trans-expr.c (gfc_trans_scalar_assign): Do a deep copy for
807         parameterized types.
808         *trans-stmt.c (trans_associate_var): Deallocate associate vars
809         as necessary, when they are PDT function results for example.
811         PR fortran/83731
812         * trans-array.c (structure_alloc_comps): Only compare len parms
813         when they are declared explicitly.
815 2018-01-06  Janne Blomqvist  <jb@gcc.gnu.org>
817         PR fortran/50892
818         * trans-expr.c (gfc_trans_pointer_assignment): fold_convert rhs to
819         lhs type.
821 2018-01-05  Janne Blomqvist  <jb@gcc.gnu.org>
823         PR fortran/78534
824         PR fortran/66310
825         * array.c (got_charlen): Use gfc_charlen_int_kind.
826         * class.c (gfc_find_derived_vtab): Use gfc_size_kind instead of
827         hardcoded kind.
828         (find_intrinsic_vtab): Likewise.
829         * decl.c (match_char_length): Use gfc_charlen_int_kind.
830         (add_init_expr_to_sym): Use gfc_charlen_t and gfc_charlen_int_kind.
831         (gfc_match_implicit): Use gfc_charlen_int_kind.
832         * dump-parse-tree.c (show_char_const): Use gfc_charlen_t and size_t.
833         (show_expr): Use HOST_WIDE_INT_PRINT_DEC.
834         * expr.c (gfc_get_character_expr): Length parameter of type
835         gfc_charlen_t.
836         (gfc_get_int_expr): Value argument of type HOST_WIDE_INT.
837         (gfc_extract_hwi): New function.
838         (simplify_const_ref): Make string_len of type gfc_charlen_t.
839         (gfc_simplify_expr): Use HOST_WIDE_INT for substring refs.
840         * frontend-passes.c (optimize_trim): Use gfc_charlen_int_kind.
841         * gfortran.h (gfc_mpz_get_hwi): New prototype.
842         (gfc_mpz_set_hwi): Likewise.
843         (gfc_charlen_t): New typedef.
844         (gfc_expr): Use gfc_charlen_t for character lengths.
845         (gfc_size_kind): New extern variable.
846         (gfc_extract_hwi): New prototype.
847         (gfc_get_character_expr): Use gfc_charlen_t for character length.
848         (gfc_get_int_expr): Use HOST_WIDE_INT type for value argument.
849         * gfortran.texi: Update description of hidden string length argument.
850         * iresolve.c (check_charlen_present): Use gfc_charlen_int_kind.
851         (gfc_resolve_char_achar): Likewise.
852         (gfc_resolve_repeat): Pass string length directly without
853         temporary, use gfc_charlen_int_kind.
854         (gfc_resolve_transfer): Use gfc_charlen_int_kind.
855         * match.c (select_intrinsic_set_tmp): Use HOST_WIDE_INT for charlen.
856         * misc.c (gfc_mpz_get_hwi): New function.
857         (gfc_mpz_set_hwi): New function.
858         * module.c (atom_int): Change type from int to HOST_WIDE_INT.
859         (parse_integer): Don't complain about large integers.
860         (write_atom): Use HOST_WIDE_INT for integers.
861         (mio_integer): Handle integer type mismatch.
862         (mio_hwi): New function.
863         (mio_intrinsic_op): Use HOST_WIDE_INT.
864         (mio_array_ref): Likewise.
865         (mio_expr): Likewise.
866         * primary.c (match_substring): Use gfc_charlen_int_kind.
867         * resolve.c (resolve_substring_charlen): Use gfc_charlen_int_kind.
868         (resolve_character_operator): Likewise.
869         (resolve_assoc_var): Likewise.
870         (resolve_select_type): Use HOST_WIDE_INT for charlen, use snprintf.
871         (resolve_charlen): Use mpz_sgn to determine sign.
872         * simplify.c (gfc_simplify_repeat): Use HOST_WIDE_INT/gfc_charlen_t
873         instead of long.
874         * symbol.c (generate_isocbinding_symbol): Use gfc_charlen_int_kind.
875         * target-memory.c (size_character): Length argument of type
876         gfc_charlen_t.
877         (gfc_encode_character): Likewise.
878         (gfc_interpret_character): Use gfc_charlen_t.
879         * target-memory.h (gfc_encode_character): Modify prototype.
880         * trans-array.c (gfc_trans_array_ctor_element): Use existing type.
881         (get_array_ctor_var_strlen): Use gfc_conv_mpz_to_tree_type.
882         (trans_array_constructor): Use existing type.
883         (get_array_charlen): Likewise.
884         * trans-const.c (gfc_conv_mpz_to_tree_type): New function.
885         * trans-const.h (gfc_conv_mpz_to_tree_type): New prototype.
886         * trans-decl.c (gfc_trans_deferred_vars): Use existing type.
887         (add_argument_checking): Likewise.
888         * trans-expr.c (gfc_class_len_or_zero_get): Build const of type
889         gfc_charlen_type_node.
890         (gfc_conv_intrinsic_to_class): Use gfc_charlen_int_kind instead of
891         4, fold_convert to correct type.
892         (gfc_conv_class_to_class): Build const of type size_type_node for
893         size.
894         (gfc_copy_class_to_class): Likewise.
895         (gfc_conv_string_length): Use same type in expression.
896         (gfc_conv_substring): Likewise, use HOST_WIDE_INT for charlen.
897         (gfc_conv_string_tmp): Make sure len is of the right type.
898         (gfc_conv_concat_op): Use same type in expression.
899         (gfc_conv_procedure_call): Likewise.
900         (fill_with_spaces): Comment out memset() block due to spurious
901         -Wstringop-overflow warnings.
902         (gfc_trans_string_copy): Use gfc_charlen_type_node.
903         (alloc_scalar_allocatable_for_subcomponent_assignment):
904         fold_convert to right type.
905         (gfc_trans_subcomponent_assign): Likewise.
906         (trans_class_vptr_len_assignment): Build const of correct type.
907         (gfc_trans_pointer_assignment): Likewise.
908         (alloc_scalar_allocatable_for_assignment): fold_convert to right
909         type in expr.
910         (trans_class_assignment): Build const of correct type.
911         * trans-intrinsic.c (gfc_conv_associated): Likewise.
912         (gfc_conv_intrinsic_repeat): Do calculation in sizetype.
913         * trans-io.c (gfc_build_io_library_fndecls): Use
914         gfc_charlen_type_node for character lengths.
915         (set_string): Convert to right type in assignment.
916         * trans-stmt.c (gfc_trans_label_assign): Build const of
917         gfc_charlen_type_node.
918         (trans_associate_var): Likewise.
919         (gfc_trans_character_select): Likewise.
920         (gfc_trans_allocate): Likewise, don't typecast strlen result.
921         (gfc_trans_deallocate): Don't typecast strlen result.
922         * trans-types.c (gfc_size_kind): New variable.
923         (gfc_init_types): Determine gfc_charlen_int_kind and gfc_size_kind
924         from size_type_node.
925         * trans-types.h: Fix comment.
927 2018-01-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
929         PR fortran/83683
930         PR fortran/45689
931         * check.c (gfc_check_eoshift): Check for string length and
932         for conformance of boundary.
933         * intrinsic.c (add_functions): Add gfc_simplify_eoshift.
934         * intrinsic.h: Add prototype for gfc_simplify_eoshift.
935         * simplify.c (gfc_simplify_eoshift): New function.
937 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
938             Alan Hayward  <alan.hayward@arm.com>
939             David Sherwood  <david.sherwood@arm.com>
941         * trans-types.c (gfc_type_for_mode): Handle MODE_VECTOR_BOOL.
943 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
944             Alan Hayward  <alan.hayward@arm.com>
945             David Sherwood  <david.sherwood@arm.com>
947         * trans-types.c (gfc_type_for_mode): Check valid_vector_subparts_p.
949 2018-01-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
951         PR fortran/83664
952         * check.c (gfc_check_eoshift): Error for missing boundary if array
953         is not one of the standard types.
955 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
957         Update copyright years.
959         * gfortranspec.c (lang_specific_driver): Update copyright notice
960         dates.
961         * gfc-internals.texi: Bump @copying's copyright year.
962         * gfortran.texi: Ditto.
963         * intrinsic.texi: Ditto.
964         * invoke.texi: Ditto.
966 2017-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
968         PR fortran/45689
969         * intrinsic.c (add_function): Add gfc_simplify_maxloc and
970         gfc_simplify_minloc to maxloc and minloc, respectively.
971         * intrinsic.h: Add prototypes for gfc_simplify_minloc
972         and gfc_simplify_maxloc.
973         * simplify.c (min_max_chose): Adjust prototype.  Modify function
974         to have a return value which indicates if the extremum was found.
975         (is_constant_array_expr): Fix typo in comment.
976         (simplify_minmaxloc_to_scalar): New function.
977         (simplify_minmaxloc_nodim): New function.
978         (new_array): New function.
979         (simplify_minmaxloc_to_array): New function.
980         (gfc_simplify_minmaxloc): New function.
981         (simplify_minloc): New function.
982         (simplify_maxloc): New function.
984 2018-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
986         PR fortran/45689
987         PR fortran/83650
988         * simplify.c (gfc_simplify_cshift): Re-implement to allow full
989         range of arguments.
991 2018-01-01  Paul Thomas  <pault@gcc.gnu.org>
993         PR fortran/83076
994         * resolve.c (resolve_fl_derived0): Add caf_token fields for
995         allocatable and pointer scalars, when -fcoarray selected.
996         * trans-types.c (gfc_copy_dt_decls_ifequal): Copy the token
997         field as well as the backend_decl.
998         (gfc_get_derived_type): Flag GFC_FCOARRAY_LIB for module
999         derived types that are not vtypes. Components with caf_token
1000         attribute are pvoid types. For a component requiring it, find
1001         the caf_token field and have the component token field point to
1002         its backend_decl.
1004         PR fortran/83319
1005         *trans-types.c (gfc_get_array_descriptor_base): Add the token
1006         field to the descriptor even when codimen not set.
1008 Copyright (C) 2018 Free Software Foundation, Inc.
1010 Copying and distribution of this file, with or without modification,
1011 are permitted in any medium without royalty provided the copyright
1012 notice and this notice are preserved.