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