re PR fortran/88206 (ICE in gfc_match_type_spec, at fortran/match.c:2229)
[official-gcc.git] / gcc / fortran / ChangeLog
blobf5c2f01bab46f154c488efa804e3ce2faa0fdd9e
1 2018-12-09  Steven G. Kargl  <kargl@gcc.gnu.org>
3         PR fortran/88206
4         * match.c (gfc_match_type_spec): REAL can be an intrinsic function.
6 2018-12-09  Fritz Reese  <fritzoreese@gmail.com>
8         PR fortran/88228
9         * resolve.c (resolve_operator):  Do not call resolve_function.
10         Break like other cases.
12 2018-12-09  Cesar Philippidis  <cesar@codesourcery.com>
14         * trans-openmp.c (gfc_trans_oacc_combined_directive): Set the
15         location of combined acc loops.
17 2018-12-09  Thomas Schwinge  <thomas@codesourcery.com>
19         * openmp.c (resolve_oacc_loop_blocks): Remove checking of OpenACC
20         loop clauses.
22         PR fortran/88420
23         * openmp.c (resolve_oacc_loop_blocks): Remove "Clause SEQ
24         conflicts with INDEPENDENT" diagnostic.
26 2018-12-08  Steven G. Kargl  <kargl@gcc.gnu.org>
28         PR fortran/88048
29         * resolve.c (check_data_variable): Named constant cannot be a
30         data object.
32 2018-12-08  Steven G. Kargl  <kargl@gcc.gnu.org>
34         PR fortran/87945
35         * decl.c (var_element): Inquiry parameters cannit be data objects.
37 2018-12-08  Steven G. Kargl  <kargl@gcc.gnu.org>
39         PR fortran/88025
40         * expr.c (gfc_apply_init):  Remove asserts that cannot trigger.
41         Check for a NULL pointer.
43 2018-12-08  Steven G. Kargl  <kargl@gcc.gnu.org>
45         PR fortran/88357
46         * class.c (insert_component_ref): Check for NULL pointer and 
47         previous error message issued.
48         * parse.c (parse_associate): Check for NULL pointer.
49         * resolve.c (resolve_assoc_var): Check for NULL pointer.
51 2018-12-07  Jakub Jelinek  <jakub@redhat.com>
53         PR fortran/88377
54         * trans-openmp.c (gfc_omp_clause_default_ctor,
55         gfc_omp_clause_copy_ctor, gfc_omp_clause_assign_op,
56         gfc_omp_clause_linear_ctor, gfc_omp_clause_dtor): Only consider
57         GFC_DECL_GET_SCALAR_ALLOCATABLE vars as scalar allocatables if they
58         have pointer type.
60 2018-12-03  Fritz Reese  <fritzoreese@gmail.com>
61             Mark Eggleston  <mark.eggleston@codethink.co.uk>
63         PR fortran/87919
64         * options.c (SET_FLAG, SET_BITFLAG, SET_BITFLAG2): New macros.
65         (set_dec_flags): Set/unset DEC and std flags according to value.
66         (post_dec_flags, set_init_local_zero): New functions.
67         (gfc_init_options): Use set_init_local_zero and post_dec_flags.
68         (gfc_handle_options) <case OPT_fcheck_array_temporaries>: Use
69         SET_BITFLAG.
70         <case OPT_finit_local_zero>: Use set_init_local_zero.
71         <case OPT_fdec>: Pass value to set_dec_flags.
72         <case OPT_fdec_structure>: Remove.
74 2018-11-30  Thomas Schwinge  <thomas@codesourcery.com>
76         * gfortran.h (struct gfc_omp_clauses): Remove "wait".  Adjust all
77         users.
79         * openmp.c (gfc_match_omp_clauses): Support multiple OpenACC wait
80         clauses.
82 2018-11-27  Martin Liska  <mliska@suse.cz>
84         * decl.c (gfc_match_gcc_builtin): New function.
85         * gfortran.h (struct vect_builtin_tuple): New.
86         (gfc_adjust_builtins): Likewise.
87         * lang-specs.h (TARGET_F951_OPTIONS): New.
88         (F951_OPTIONS): Use it.
89         * lang.opt: Add new option -fpre-include.
90         * match.h (gfc_match_gcc_builtin): Declare new function.
91         * parse.c (decode_gcc_attribute): Handle builtin.
92         (parse_progunit): Call gfc_adjust_builtins.
93         * scanner.c (gfc_new_file): Load pre-included header file
94         when provided.
95         * trans-intrinsic.c (add_simd_flag_for_built_in): New.
96         (gfc_adjust_builtins): Likewise.
98 2018-11-24  Paul Thomas  <pault@gcc.gnu.org>
100         PR fortran/88143
101         * resolve.c (resolve_variable): Check for associate names with
102         NULL target.
104 2018-11-23  Jakub Jelinek  <jakub@redhat.com>
106         * lang.opt (fpad-source): New option.
107         * scanner.c (load_line): Don't pad fixed form lines if
108         !flag_pad_source.
109         * invoke.texi (-fno-pad-source): Document.
111 2018-11-21  Jakub Jelinek  <jakub@redhat.com>
113         * invoke.texi (-fdec-include): Document.
115 2018-11-21  Jakub Jelinek  <jakub@redhat.com>
116             Mark Eggleston  <mark.eggleston@codethink.com>
118         * lang.opt (fdec-include): New option.
119         * options.c (set_dec_flags): Set also flag_dec_include.
120         * scanner.c (include_line): Change return type from bool to int.
121         In fixed form allow spaces in between include keyword letters.
122         For -fdec-include, allow in fixed form 0 in column 6.  With
123         -fdec-include return -1 if the parsed line is not full include
124         statement and it could be successfully completed on continuation
125         lines.
126         (include_stmt): New function.
127         (load_file): Adjust include_line caller.  If it returns -1, keep
128         trying include_stmt until it stops returning -1 whenever adding
129         further line of input.
131 2018-11-18  Thomas Koenig  <tkoenig@gcc.gnu.org>
133         PR fortran/88073
134         * frontend-passes.c (combine_array_constructor): Do not do
135         anything if in a WHERE statement.
137 2018-11-18  Thomas Koenig  <tkoenig@gcc.gnu.org>
139         PR fortran/70260
140         * expr.c (gfc_check_assign): Reject assigning to an external
141         symbol.
142         (gfc_check_pointer_assign): Add suppress_type_test
143         argument. Insert line after if. A non-proc pointer can not point
144         to a constant.  Only check types if suppress_type_test is false.
145         * gfortran.h (gfc_check_pointer_assign): Add optional
146         suppress_type_test argument.
147         * resolve.c (gfc_resolve_code):  Move up gfc_check_pointer_assign
148         and give it the extra argument.
149         (resolve_fl_procedure): Set error on value for a function with
150         an inizializer.
152 2018-11-15  David Malcolm  <dmalcolm@redhat.com>
154         PR other/19165
155         * error.c (gfc_diagnostic_finalizer): Add diagnostic_t param.
157 2018-11-13  David Malcolm  <dmalcolm@redhat.com>
159         * cpp.c: Replace "source_location" with "location_t".
160         * gfortran.h: Likewise.
162 2018-11-08  Jakub Jelinek  <jakub@redhat.com>
164         * trans-openmp.c (gfc_trans_omp_clauses): Use
165         OMP_CLAUSE_DEFAULTMAP_SET_KIND.
166         (gfc_trans_omp_atomic): Set OMP_ATOMIC_MEMORY_ORDER
167         rather than OMP_ATOMIC_SEQ_CST.
168         (gfc_trans_omp_taskgroup): Build OMP_TASKGROUP using
169         make_node instead of build1_loc.
170         * types.def (BT_FN_VOID_BOOL, BT_FN_VOID_SIZE_SIZE_PTR,
171         BT_FN_UINT_UINT_PTR_PTR, BT_FN_UINT_OMPFN_PTR_UINT_UINT,
172         BT_FN_BOOL_UINT_LONGPTR_LONG_LONG_LONGPTR_LONGPTR_PTR_PTR,
173         BT_FN_BOOL_UINT_ULLPTR_LONG_ULL_ULLPTR_ULLPTR_PTR_PTR,
174         BT_FN_BOOL_LONG_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR_PTR_PTR,
175         BT_FN_BOOL_BOOL_ULL_ULL_ULL_LONG_ULL_ULLPTR_ULLPTR_PTR_PTR): New.
176         (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_PTR): Formatting fix.
178 2018-11-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
180         PR fortran/46020
181         * decl.c (verify_bind_c_sym): Remove unnecessary space
182         in error message.
184 2018-11-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
186         PR fortran/87782
187         * frontend-passes.c (constant_string_length): If there is a
188         substring with a length which cannot be reduced to a constant,
189         return NULL.
191 2018-11-01  Paul Thomas  <pault@gcc.gnu.org>
193         PR fortran/40196
194         * dependency.c (are_identical_variables): Return false if the
195         inquiry refs are not the same.
196         (gfc_ref_needs_temporary_p): Break on an inquiry ref.
197         * dump_parse_tree.c (show_ref): Show the inquiry ref type.
198         * expr.c (gfc_free_ref_list): Break on an inquiry ref.
199         (gfc_copy_ref): Copy the inquiry ref types.
200         (find_inquiry_ref): New function.
201         (simplify_const_ref, simplify_ref_chain): Call it. Add new arg
202         to simplify_ref_chain.
203         (gfc_simplify_expr): Use the new arg in call to
204         simplify_ref_chain.
205         (gfc_get_full_arrayspec_from_expr, gfc_is_coarray): Break on
206         inquiry ref.
207         (gfc_traverse_expr): Return true for inquiry ref.
208         * frontend-passes.c (gfc_expr_walker): Break on inquiry ref.
209         * gfortran.h : Add enums and union member in gfc_ref to
210         implement inquiry refs.
211         * intrinsic.c : Fix white nois.
212         * match.c (gfc_match_assignment): A constant lavlue is an
213         error.
214         * module.c : Add DECL_MIO_NAME for inquiry_type and the mstring
215         for inquiry_types.
216         (mio_ref): Handle inquiry refs.
217         * primary.c (is_inquiry_ref): New function.
218         (gfc_match_varspec): Handle inquiry refs calling new function.
219         (gfc_variable_attr): Detect inquiry ref for disambiguation
220         with components.
221         (caf_variable_attr): Treat inquiry and substring refs in the
222         same way.
223         * resolve.c (find_array_spec): ditto.
224         (gfc_resolve_substring_charlen): If there is neither a charlen
225         ref not an inquiry ref, return.
226         (resolve_ref): Handle inqiry refs as appropriate.
227         (resolve_allocate_expr): Entities with an inquiry ref cannot be
228         allocated.
229         * simplify.c (simplify_bound, simplify_cobound): Punt on
230         inquiry refs.
231         * trans-array.c (get_array_ctor_var_strlen): Break on inquiry
232         ref.
233         *trans-expr.c (conv_inquiry): New function.
234         (gfc_conv_variable): Retain the last typespec to pass to
235         conv_inquiry on detecting an inquiry ref.
237 2018-11-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
239         PR fortran/46020
240         * decl.c (verify_bind_c_sym): Improve error message.
242 2018-11-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
244         PR fortran/54613
245         * gfortran.texi (File format of unformatted sequential files):
246         Replace random comma with period.
247         * intrinsic.texi (Intrinsic Procedures): Add FINDLOC to menu.
248         (FINDLOC): Document.
249         (MAXLOC): Add refrence to FINDLOC.
250         (MINLOC): Likewise.
252 2018-10-31  Nathan Sidwell  <nathan@acm.org>
254         * cpp.c (gfc_cpp_init): Adjust cpp_force_token_locations call.
256 2018-10-31  Martin Liska  <mliska@suse.cz>
258         * trans-decl.c (struct module_hasher): Call htab_hash_string
259         for s->name and not for s.
261 2018-10-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
263         PR fortran/85896
264         * simplify.c (simplify_min_max): Do not convert the type of the
265         return expression.
267 2017-10-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
269         PR fortran/54613
270         * gfortran.h (gfc_isym_id): Add GFC_ISYM_FINDLOC.
271         (gfc_check_f): Add f6fl field.
272         (gfc_simplify_f): Add f6 field.
273         (gfc_resolve_f): Likewise.
274         (gfc_type_letter): Add optional logical_equas_int flag.
275         * check.c (intrinsic_type_check): New function.
276         (gfc_check_findloc): New function.
277         * intrinsics.c (gfc_type_letter): If logical_equals_int is
278         set, act accordingly.
279         (add_sym_5ml):  Reformat comment.
280         (add_sym_6fl): New function.
281         (add_functions): Add findloc.
282         (check_arglist): Add sixth argument, handle it.
283         (resolve_intrinsic): Likewise.
284         (check_specific): Handle findloc.
285         * intrinsic.h (gfc_check_findloc): Add prototype.
286         (gfc_simplify_findloc): Likewise.
287         (gfc_resolve_findloc): Likewise.
288         (MAX_INTRINSIC_ARGS): Adjust.
289         * iresolve.c (gfc_resolve_findloc): New function.
290         * simplify.c (gfc_simplify_minmaxloc): Make static.
291         (simplify_findloc_to_scalar): New function.
292         (simplify_findloc_nodim): New function.
293         (simplify_findloc_to_array): New function.
294         (gfc_simplify_findloc): New function.
295         (gfc_conv_intrinsic_findloc): New function.
296         (gfc_conv_intrinsic_function): Handle GFC_ISYM_FINDLOC.
297         (gfc_is_intrinsic_libcall): Likewise.
299 2018-10-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
301         PR fortran/86907
302         * frontend-passes.c (check_locus_code): Add information that
303         warning about missing location information points to an
304         inconsisten internal state.
305         (check_locus_expr): Likewise.
307 2018-10-25  Jakub Jelinek  <jakub@redhat.com>
309         PR fortran/87725
310         * openmp.c (gfc_match_omp_clauses): Parse simd, monotonic and
311         nonmonotonic modifiers regardless of if they have been parsed
312         already or if the opposite one has.  Fix up check whether
313         comma after modifier should be parsed.
314         (resolve_omp_clauses): Diagnose schedule modifier restrictions.
316 2018-10-23  Paul Thomas  <pault@gcc.gnu.org>
318         PR fortran/85603
319         * frontend-passes.c (get_len_call): New function to generate a
320         call to intrinsic LEN.
321         (create_var): Use this to make length expressions for variable
322         rhs string lengths.
323         Clean up some white space issues.
325 2018-10-21  Paul Thomas  <pault@gcc.gnu.org>
327         PR fortran/71880
328         * trans-expr.c (gfc_trans_pointer_assignment): Set the string
329         length for array valued deferred length lhs.
331 2018-10-18  Tobias Burnus  <burnus@net-b.de>
333         PR fortran/87625
334         * trans-array.c (gfc_is_reallocatable_lhs): Detect allocatable
335         polymorphic arrays.
337 2018-10-18  Paul Thomas  <pault@gcc.gnu.org>
339         PR fortran/58618
340         * trans-stmt.c (trans_associate_var): All strings that return
341         as pointer types can be assigned directly to the associate
342         name so remove 'attr' and the condition that uses it.
344 2018-10-18  Paul Thomas  <pault@gcc.gnu.org>
346         PR fortran/58618
347         * trans-decl.c (gfc_get_symbol_decl): Deal correctly with the
348         initialization with NULL() of a deferred length pointer.
350 2018-10-17  Tobias Burnus  <burnus@net-b.de>
352         PR fortran/87632
353         * resolve.c (resolve_select_type): Use correct variable.
355 2018-10-17  David Malcolm  <dmalcolm@redhat.com>
357         * Make-lang.in (selftest-fortran): New.
359 2018-10-17  Paul Thomas  <pault@gcc.gnu.org>
361         PR fortran/56386
362         PR fortran/58906
363         PR fortran/77385
364         PR fortran/80260
365         PR fortran/82077
366         * resolve.c (resolve_variable): Fix up expressions with array
367         associate names, where the parser did not detect that this is
368         array and there was no array part_ref in the expression.
370 2018-10-16  Tobias Burnus  <burnus@net-b.de>
372         PR fortran/67125
373         * trans-array.c (gfc_array_init_size, gfc_array_allocate):
374         Rename argument e3_is_array_constr to e3_has_nodescriptor
375         and update comments.
376         * trans-stmt.c (gfc_trans_allocate): Also fix lower bound
377         to 1 for nonalloc/nonpointer func results/vars besides
378         array constructors.
380 2018-10-16  Tobias Burnus  <burnus@net-b.de>
382         PR fortran/87556
383         * trans-stmt.c (form_team, change_team, sync_team):
384         Don't ignore argse.pre/argse.post.
386 2018-10-15  Paul Thomas  <pault@gcc.gnu.org>
387         Tobias Burnus  <burnus@gcc.gnu.org>
389         PR fortran/87566
390         * resolve.c (resolve_assoc_var): Add missing array spec for
391         class associate names.
392         (resolve_select_type): Handle case where last typed component
393         of the selector has a different type to the expression.
394         * trans-expr.c (gfc_find_and_cut_at_last_class_ref): Replace
395         call to gfc_expr_to_initialize with call to gfc_copy_expr.
396         (gfc_conv_class_to_class): Guard assignment to 'len' field
397         against case where zero constant is supplied.
399 2018-10-12  Tobias Burnus  <burnus@net-b.de>
401         PR fortran/87597
402         * expr.c (gfc_simplify_expr): Avoid simplifying
403         the 'array' argument to lbound/ubound/lcobound/
404         ucobound.
406 2018-10-12  Tobias Burnus <burnus@net-b.de>
408         PR fortran/58787
409         * decl.c (get_proc_name): Return with error before
410         creating sym_tree.
412 2018-10-11  Tobias Burnus <burnus@net-b.de>
414         Revert:
415         2018-10-09  Tobias Burnus <burnus@net-b.de>
417         PR fortran/83522
418         * resolve.c (resolve_ref): Reject nonscalar
419         substring references.
421 2018-10-09  David Malcolm  <dmalcolm@redhat.com>
423         * cpp.c (gfc_cpp_init_0): Update for renamings.
424         (cb_cpp_error): Rename to...
425         (cb_cpp_diagnostic): ...this, converting level and reason to
426         enums.
428 2018-10-09  Tobias Burnus <burnus@net-b.de>
430         PR fortran/83522
431         * resolve.c (resolve_ref): Reject nonscalar
432         substring references.
434 2018-10-09  Paul Thomas  <pault@gcc.gnu.org>
436         PR fortran/87151
437         * trans-array.c (gfc_get_array_span): Deal with deferred char
438         array components having a TYPE_MAX_VALUE of zero.
439         (gfc_array_init_size): Use the hidden string length component
440         to build the descriptor dtype.
441         (gfc_array_allocate): Remove the erroneous replacement of the
442         charlen backend decl with a temporary.
443         (gfc_conv_expr_descriptor): Use the ss_info string length in
444         the case of deferred character components.
445         (gfc_alloc_allocatable_for_assignment): Actually compare the
446         string lengths for deferred characters. Make sure that kind > 1
447         is handled correctly. Set the span field of the descriptor.
448         * trans-intrinsic.c (gfc_conv_intrinsic_len): Remove the stupid
449         comment.
451         PR fortran/80931
452         * trans-array.c (gfc_array_allocate): Set the span field for
453         variable length character arrays.
455 2018-10-08  Cesar Philippidis  <cesar@codesourcery.com>
457         * expr.c (gfc_check_pointer_assign): Demote "Assignment to
458         contiguous pointer from non-contiguous target" to a warning.
460 2018-10-08  Paul Thomas  <pault@gcc.gnu.org>
462         PR fortran/86372
463         * trans-stmt.c (trans_associate_var): Character associate names
464         with variable string length do not have to be deferred length
465         for the string length to be set, if variable.
467 2018-10-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
469         PR fortran/86111
470         * gfortran.h (enum arith): Add ARITH_WRONGCONCAT.
471         * arith.h (gfc_arith_error): Issue error for ARITH_WRONGCONCAT.
472         (gfc_arith_concat):  If the types of op1 and op2 are not
473         character of if their kinds do not match, issue ARITH_WRONGCONCAT.
475 2018-10-06  Paul Thomas  <pault@gcc.gnu.org>
477         PR fortran/83999
478         * resolve.c (resolve_fl_procedure): Include class functions in
479         the test that elemental function results be scalar.
481 2018-10-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
483         PR fortran/84640
484         * simplify.c (gfc_simplify_cshift): Extend size of hs_ex and ss_ex
485         by one. Set extents one past the array boundaries to zero to avoid
486         warning with instrumented compiler.
487         (gfc_simplify_eoshift): Likewise, only for ss_ex.
489 2018-10-05  Paul Thomas  <pault@gcc.gnu.org>
491         PR fortran/87487
492         * trans-decl.c (gfc_get_symbol_decl): Make sure that deferred
493         character length pointer initializer has the right type to fix
494         problem with deferred_character_24.f90 on big endian.
496 2018-10-03  Jeff Law  <law@redhat.comg>
498         * trans-types.c (get_typenode_from_name): Moved into gcc/tree.c.
500 2018-10-01  Paul Thomas  <pault@gcc.gnu.org>
502         PR fortran/65677
503         * trans-expr.c (gfc_trans_assignment_1): Set the 'identical'
504         flag in the call to gfc_check_dependency.
506 2018-09-30  Paul Thomas  <pault@gcc.gnu.org>
508         PR fortran/87359
509         * trans-array.c (gfc_is_reallocatable_lhs): Correct the problem
510         introduced by r264358, which prevented components of associate
511         names from being reallocated on assignment.
513 2018-09-30  Paul Thomas  <pault@gcc.gnu.org>
515         PR fortran/70752
516         PR fortran/72709
517         * trans-array.c (gfc_conv_scalarized_array_ref): If this is a
518         deferred type and the info->descriptor is present, use the
519         info->descriptor
520         (gfc_conv_array_ref): Is the se expr is a descriptor type, pass
521         it as 'decl' rather than the symbol backend_decl.
522         (gfc_array_allocate): If the se string_length is a component
523         reference, fix it and use it for the expression string length
524         if the latter is not a variable type. If it is a variable do
525         an assignment. Make use of component ref string lengths to set
526         the descriptor 'span'.
527         (gfc_conv_expr_descriptor): For pointer assignment, do not set
528         the span field if gfc_get_array_span returns zero.
529         * trans.c (get_array_span): If the upper bound a character type
530         is zero, use the descriptor span if available.
532 2018-09-30  Paul Thomas  <pault@gcc.gnu.org>
534         PR fortran/70149
535         * trans-decl.c (gfc_get_symbol_decl): A deferred character
536         length pointer that is initialized needs the string length to
537         be initialized as well.
539 2018-09-29  Paul Thomas  <pault@gcc.gnu.org>
541         PR fortran/65677
542         * trans-expr.c (gfc_trans_assignment_1): If there is dependency
543         fix the rse stringlength.
545 2018-09-25  Martin Liska  <mliska@suse.cz>
547         PR fortran/87394
548         * decl.c (add_hidden_procptr_result): Simplify condition
549         as we are in branch witch 'case1 || case2'.
551 2018-09-25  Martin Liska  <mliska@suse.cz>
553         * trans.c (remove_suffix): Remove
554         unused function.
556 2018-09-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
558         PR fortran/87397
559         * gfc_conv_procedure_call: Do not add clobber on INTENT(OUT)
560         for variables in an associate statement.
562 2018-09-24  Bernhard Reuther-Fischer  <aldot@gcc.gnu.org>
563             Cesar Philippidis  <cesar@codesourcery.com>
565         * openmp.c (resolve_oacc_loop_blocks):
567 2018-09-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
569         PR fortran/87397
570         * gfc_conv_procedure_call: Do not add clobber on INTENT(OUT)
571         for variables having the dimension attribute.
573 2018-09-23  Janne Blomqvist  <jb@gcc.gnu.org>
575         * trans-expr.c (gfc_caf_get_image_index): Do array index
576         calculations in gfc_array_index_type.
577         * trans-intrinsic.c (conv_intrinsic_event_query): Likewise.
578         * trans-stmt.c (gfc_trans_lock_unlock): Likewise.
579         (gfc_trans_event_post_wait): Likewise.
581 2018-09-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
583         PR fortran/87395
584         * gfc_conv_procedure_call: Reformat comments slightly. Do not add
585         clobber on INTENT(OUT) for saved variables.
587 2018-09-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
589         PR fortran/41453
590         * trans.h (gfc_conv_expr_reference): Add optional argument
591         add_clobber to prototype.
592         (gfc_conv_procedure_call):  Set add_clobber argument to
593         gfc_conv_procedure_reference to true for scalar, INTENT(OUT),
594         non-pointer, non-allocatable, non-dummy variables whose type
595         is neither BT_CHARACTER, BT_DERIVED or BT_CLASS, but only if
596         the procedure is not elemental.
597         * trans-expr.c (gfc_conv_procedure_reference): Add clobber
598         statement before call if add_clobber is set.
600 2018-09-22  Paul Thomas  <pault@gcc.gnu.org>
602         PR fortran/85603
603         * trans-array.c (gfc_alloc_allocatable_for_assignment): Test
604         the charlen backend_decl before using the VAR_P macro.
606 2018-09-21  Paul Thomas  <pault@gcc.gnu.org>
608         PR fortran/77325
609         * trans-array.c (gfc_alloc_allocatable_for_assignment): If the
610         rhs has a charlen expression, convert that and use it.
611         * trans-expr.c (gfc_trans_assignment_1): The rse.pre for the
612         assignment of deferred character array vars to a realocatable
613         lhs should not be added to the exterior block since vector
614         indices, for example, generate temporaries indexed within the
615         loop.
617 2018-09-21  Paul Thomas  <pault@gcc.gnu.org>
619         PR fortran/87359
620         * trans-stmt.c (gfc_trans_allocate): Don't deallocate alloc
621         components if must_finalize is set for expr3.
623 2018-09-21  Andrew Stubbs  <ams@codesourcery.com>
624             Kwok Cheung Yeung  <kcy@codesourcery.com>
626         * trans-expr.c (gfc_trans_structure_assign): Ensure that the first
627         argument of a call to _gfortran_caf_register is of size_type_node.
628         * trans-intrinsic.c (conv_intrinsic_event_query): Convert computed
629         index to a size_type_node type.
630         * trans-stmt.c (gfc_trans_event_post_wait): Likewise.
632 2018-09-20  Allan Sandfeld Jensen  <allan.jensen@qt.io>
634         * gfortranspec.c (lang_specific_driver): Handle -r like -nostdlib.
636 2018-09-20  Janus Weil  <janus@gcc.gnu.org>
638         * gfortran.h (gfc_str_startswith): New macro.
639         * decl.c (variable_decl, gfc_match_end): Use it.
640         * iresolve.c (is_trig_resolved): Ditto.
641         * module.c (load_omp_udrs, read_module): Ditto.
642         * options.c (gfc_handle_runtime_check_option): Ditto.
643         * primary.c (match_arg_list_function): Ditto.
644         * trans-decl.c (gfc_get_symbol_decl): Ditto.
645         * trans-expr.c (gfc_conv_procedure_call): Ditto.
646         * interface.c (dtio_op): Replace strncmp by strcmp.
647         * resolve.c (resolve_actual_arglist, resolve_function): Ditto.
648         * trans-expr.c (conv_arglist_function): Ditto.
649         * trans-intrinsic.c (gfc_conv_ieee_arithmetic_function): Replace macro
650         STARTS_WITH by gfc_str_startswith.
652 2018-09-20  Cesar Philippidis  <cesar@codesourcery.com>
654         * dump-parse-tree.c (show_omp_clauses): Add missing omp list_types
655         and reorder the switch cases to match the enum in gfortran.h.
657 2018-09-19  Paul Thomas  <pault@gcc.gnu.org>
659         PR fortran/84109
660         * trans-expr.c (gfc_trans_assignment_1): The rse.pre for the
661         assignment of deferred character intrinsic elemental function
662         results to a realocatable lhs must not be added to the exterior
663         block if they are array valued but must go to the loop body.
665 2018-09-18  Thomas Koenig  <tkoenig@gcc.gnu.org>
667         PR fortran/29550
668         * gfortran.h (gfc_expr): Add external_blas flag.
669         * frontend-passes.c (matrix_case): Add case A2TB2T.
670         (optimize_namespace): Handle flag_external_blas by
671         calling call_external_blas.
672         (get_array_inq_function): Add argument okind. If
673         it is nonzero, use it as the kind of argument
674         to be used.
675         (inline_limit_check): Remove m_case argument, add
676         limit argument instead.  Remove assert about m_case.
677         Set the limit for inlining from the limit argument.
678         (matmul_lhs_realloc): Handle case A2TB2T.
679         (inline_matmul_assign): Handle inline limit for other cases with
680         two rank-two matrices.  Remove no-op calls to inline_limit_check.
681         (call_external_blas): New function.
682         * trans-intrinsic.c (gfc_conv_intrinsic_funcall): Do not add
683         argument to external BLAS if external_blas is already set.
685 2018-09-18  Paul Thomas  <pault@gcc.gnu.org>
687         PR fortran/87239
688         * trans-expr.c (gfc_trans_assignment_1): The rse.pre for the
689         assignment of deferred character elemental function results to
690         a realocatable lhs must not be added to the exterior block but
691         must go to the loop body.
693 2018-09-18  Paul Thomas  <pault@gcc.gnu.org>
695         PR fortran/87336
696         * trans-array.c (gfc_get_array_span): Try to get the element
697         length of incomplete types. Return NULL_TREE otherwise.
698         (gfc_conv_expr_descriptor): Only set the 'span' field if the
699         above does not return NULL_TREE. Set 'span' field if possible
700         for all new descriptors.
702 2018-09-17  Paul Thomas  <pault@gcc.gnu.org>
704         PR fortran/64120
705         * trans-decl.c (gfc_get_symbol_decl): Flag allocatable, scalar
706         characters with a variable length expression for deferred init.
707         (gfc_trans_deferred_vars): Perform the assignment for these
708         symbols by calling gfc_conv_string_length.
710 2018-09-17  Paul Thomas  <pault@gcc.gnu.org>
712         PR fortran/85954
713         * resolve.c (resolve_assoc_var): If the target expression is a
714         deferred charlen dummy and the associate name shares the
715         charlen, generate a new one. Make sure that new charlens are in
716         the namespace list so that they get cleaned up.
717         * trans-array.c (gfc_is_reallocatable_lhs): Associate names are
718         not reallocatable.
719         * trans-decl.c (gfc_get_symbol_decl): Put deferred character
720         length dummy and result arrays on the deferred initialization
721         list so that the variable length arrays can be correctly dealt
722         with.
723         * trans-expr.c (gfc_conv_string_length): Return if 'expr' is
724         NULL rather than ICEing..
726 2018-09-16  Janus Weil  <janus@gcc.gnu.org>
728         PR fortran/86484
729         PR fortran/84543
730         * match.c (gfc_match_assignment): For a polymorphic assignment,
731         make sure that the vtab for the rhs type is generated.
733 2018-09-16  Thomas Koenig  <tkoenig@gcc.gnu.org>
735         PR fortran/37802
736         * frontend-passes.c (B_ERROR): New macro for matmul bounds
737         checking error messages.
738         (C_ERROR): Likewise.
739         (inline_matmul_assign): Reorganize bounds checking, use B_ERROR
740         and C_ERROR macros.
742 2018-09-13  Bernd Edlinger  <bernd.edlinger@hotmail.de>
744         * trans-array.c (gfc_conv_array_initializer): Remove excess precision
745         from overlength string initializers.
747 2018-09-12  Paul Thomas  <pault@gcc.gnu.org>
749         PR fortran/87284
750         * trans-expr.c (gfc_trans_class_init_assign): Access to
751         to array elements of the dynamic type requires that the array
752         reference be added to the class expression and not the _data
753         component, unlike scalar expressions.
755 2018-09-11  Janus Weil  <janus@gcc.gnu.org>
757         PR fortran/87172
758         * resolve.c (resolve_fl_derived): If a type has the 'use_assoc'
759         attribute, then it was declared in another module, so there should be
760         no error that it has not been declared.
762 2018-09-11  Paul Thomas  <pault@gcc.gnu.org>
764         PR fortran/87277
765         * expr.c (is_subref_array): Add the check of dimensionality for
766         class, dummy, pointer arrays.
768 2018-09-11  Janus Weil  <janus@gcc.gnu.org>
770         PR fortran/86830
771         * expr.c (gfc_is_simply_contiguous): Handle type-bound procedure calls
772         with non-polymorphic objects.
774 2018-09-10  Janus Weil  <janus@gcc.gnu.org>
776         PR fortran/85395
777         * decl.c (match_binding_attributes): Use correct default accessibility
778         for procedure pointer components.
780 2018-09-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
782         * simplify.c (gfc_simplify_modulo): Re-arrange code to test whether
783         'P' is zero and issue an error if it is.
785 2018-08-31  Paul Thomas  <pault@gcc.gnu.org>
787         PR fortran/86328
788         PR fortran/86760
789         * trans-array.c (gfc_conv_scalarized_array_ref): Do not fix
790         info->descriptor but pass it directly to gfc_build_array_ref.
791         (gfc_conv_array_ref): Likewise for se->expr.
792         * trans.c (gfc_build_array_ref): If 'decl' is a COMPONENT_REF
793         obtain the span field directly from it.
795 2017-08-28  Paul Thomas  <pault@gcc.gnu.org>
797         PR fortran/80477
798         * trans-expr.c (gfc_conv_procedure_call): Allocatable class
799         scalar results being passed to a derived type formal argument
800         are finalized if possible. Otherwise, rely on existing code for
801         deallocation. Make the deallocation of allocatable result
802         components conditional on finalization not taking place. Make
803         the freeing of data components after finalization conditional
804         on the data being NULL.
805         (gfc_trans_arrayfunc_assign): Change the gcc_assert to a
806         condition to return NULL_TREE.
807         (gfc_trans_assignment_1): If the assignment is class to class
808         and the rhs expression must be finalized but the assignment
809         is not marked as a polymorphic assignment, use the vptr copy
810         function instead of gfc_trans_scalar_assign.
812         PR fortran/86481
813         * trans-expr.c (gfc_conv_expr_reference): Do not add the post
814         block to the pre block if the expression is to be finalized.
815         * trans-stmt.c (gfc_trans_allocate): If the expr3 must be
816         finalized, load the post block into a finalization block and
817         add it right at the end of the allocation block.
819 2018-08-27  David Malcolm  <dmalcolm@redhat.com>
821         PR 87091
822         * error.c (gfc_format_decoder): Update for conversion of
823         show_caret_p to a tri-state.
825 2018-08-25  Janus Weil  <janus@gcc.gnu.org>
827         PR fortran/86545
828         * resolve.c (resolve_transfer): Correctly determine typespec for
829         generic function calls, in order to throw a proper error.
831 2018-08-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
833         PR fortran/86837
834         * frontend-passes.c (var_in_expr_callback): New function.
835         (var_in_expr): New function.
836         (traverse_io_block): Use var_in_expr instead of
837         gfc_check_dependency for checking if the variable depends on the
838         previous interators.
840 2018-08-23  Janne Blomqvist  <blomqvist.janne@gmail.com>
842         * trans-intrinsic.c (gfc_conv_intrinsic_minmaxval): Delete
843         HONOR_SIGNED_ZEROS checks.
845 2018-08-23  Paul Thomas  <pault@gcc.gnu.org>
847         PR fortran/86863
848         * resolve.c (resolve_typebound_call): If the TBP is not marked
849         as a subroutine, check the specific symbol.
851 2018-08-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
853         * gfortran.texi: Mention that asynchronous I/O does
854         not work on systems which lack condition variables, such
855         as AIX.
857 2018-08-22  Janus Weil  <janus@gcc.gnu.org>
859         PR fortran/86935
860         * match.c (gfc_match_associate): Improve diagnostics for the ASSOCIATE
861         statement.
863 2018-08-22  Andrew Benson  <abensonca@gmail.com>
865         * module.c (load_generic_interfaces): Move call to find_symbol()
866         so that only occurs if actually needed.
868 2018-08-22  Janus Weil  <janus@gcc.gnu.org>
870         PR fortran/86888
871         * decl.c (gfc_match_data_decl): Allow allocatable components of
872         indirectly recursive type.
873         * resolve.c (resolve_component): Remove two errors messages ...
874         (resolve_fl_derived): ... and replace them by a new one.
876 2018-08-21  Janne Blomqvist  <jb@gcc.gnu.org>
878         * trans-intrinsic.c (gfc_conv_intrinsic_minmax): Use
879         MAX_EXPR/MIN_EXPR unconditionally for real arguments.
880         * gfortran.texi (Compiler Characteristics): Document MAX/MIN
881         behavior wrt NaN.
883 2018-08-21  Nicolas Koenig  <koenigni@gcc.gnu.org>
884         Thomas Koenig <tkoenig@gcc.gnu.org>
886         PR fortran/25829
887         * gfortran.texi: Add description of asynchronous I/O.
888         * trans-decl.c (gfc_finish_var_decl): Treat asynchronous variables
889         as volatile.
890         * trans-io.c (gfc_build_io_library_fndecls): Rename st_wait to
891         st_wait_async and change argument spec from ".X" to ".w".
892         (gfc_trans_wait): Pass ID argument via reference.
894 2018-08-16  Nathan Sidwell  <nathan@acm.org>
896         * cpp.c (dump_macro): Use cpp_user_macro_p.
898 2018-08-14  Janus Weil  <janus@gcc.gnu.org>
900         PR fortran/86116
901         * interface.c (compare_type): Remove a CLASS/TYPE check.
902         (compare_type_characteristics): New function that behaves like the old
903         'compare_type'.
904         (gfc_check_dummy_characteristics, gfc_check_result_characteristics):
905         Call 'compare_type_characteristics' instead of 'compare_type'.
907 2018-08-12  Paul Thomas  <pault@gcc.gnu.org>
909         PR fortran/66679
910         * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Class array
911         elements are returned as references to the data element. Get
912         the class expression by stripping back the references. Use this
913         for the element size.
915 2018-08-12  Paul Thomas  <pault@gcc.gnu.org>
917         PR fortran/86906
918         * resolve.c (resolve_fl_variable_derived): Check if the derived
919         type is use associated before checking for the host association
920         error.
922 2018-08-10  Janus Weil  <janus@gcc.gnu.org>
924         PR fortran/57160
925         * invoke.texi (frontend-optimize): Mention short-circuiting.
926         * options.c (gfc_post_options): Disable -ffrontend-optimize with -Og.
927         * resolve.c (resolve_operator): Warn about short-circuiting only with
928         -ffrontend-optimize.
929         * trans-expr.c (gfc_conv_expr_op): Use short-circuiting operators only
930         with -ffrontend-optimize. Without that flag, make sure that both
931         operands are evaluated.
933 2018-08-08  Nathan Sidwell  <nathan@acm.org>
935         * cpp.c (cb_file_change): Use linemap_included_from.
937 2018-08-07  Cesar Philippidis  <cesar@codesourcery.com>
939         * trans-stmt.h: Remove stale reference to trans-openacc.c.
941 2018-08-04  Janus Weil  <janus@gcc.gnu.org>
943         PR fortran/45521
944         * interface.c (gfc_compare_interfaces): Apply additional
945         distinguishability criteria of F08 to operator interfaces.
947 2018-07-31  Andre Vieira  <andre.simoesdiasvieira@arm.com>
949         Revert 'AsyncI/O patch committed'
950         2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
951                 Thomas Koenig <tkoenig@gcc.gnu.org>
953         PR fortran/25829
954         * gfortran.texi: Add description of asynchronous I/O.
955         * trans-decl.c (gfc_finish_var_decl): Treat asynchronous variables
956         as volatile.
957         * trans-io.c (gfc_build_io_library_fndecls): Rename st_wait to
958         st_wait_async and change argument spec from ".X" to ".w".
959         (gfc_trans_wait): Pass ID argument via reference.
961 2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
962         Thomas Koenig <tkoenig@gcc.gnu.org>
964         PR fortran/25829
965         * gfortran.texi: Add description of asynchronous I/O.
966         * trans-decl.c (gfc_finish_var_decl): Treat asynchronous variables
967         as volatile.
968         * trans-io.c (gfc_build_io_library_fndecls): Rename st_wait to
969         st_wait_async and change argument spec from ".X" to ".w".
970         (gfc_trans_wait): Pass ID argument via reference.
972 2018-07-20  Martin Sebor  <msebor@redhat.com>
974         PR middle-end/82063
975         * gfortran.h (gfc_handle_option): Change function argument
976         to HOST_WIDE_INT.
977         * options.c (gfc_handle_option): Same.
979 2018-07-20  Andrew Benson  <abenson@carnegiescience.edu>
981         * gfortran.h (gfc_symbol): Add pointer to next derived type.
982         (gfc_dt_list, gfc_get_dt_list): Remove.
983         (gfc_namespace): Replace gfc_dt_list with gfc_symbol.
984         * parse.c (resolve_all_program_units): Replace gfc_free_dt_list() with
985         simple nullification of gfc_derived_types.
986         * resolve.c (resolve_global_procedure): Replace gfc_dt_list with
987         gfc_symbol.
988         (add_dt_to_dt_list): Change derived type linked list insertion to
989         utilize dt_next pointers in gfc_symbol.
990         * symbol.c (gfc_new_symbol, gfc_free_dt_list, gfc_symbol_done2)
991         (get_iso_c_binding_dt, generate_isocbinding_symbol): Remove
992         gfc_free_dt_list as gfc_dt_list is obsoleted. Change derived type
993         linked list search/insertion to utilize dt_next pointers in gfc_symbol.
994         * trans-types.c (gfc_get_derived_type): Change derived type linked
995         list search to utilize dt_next pointers in gfc_symbol.
997 2018-07-19  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
999         * trans-intrinsic.c: (gfc_conv_intrinsic_minmax): Emit MIN_MAX_EXPR
1000         or IFN_FMIN/FMAX sequence to calculate the min/max when possible.
1002 2018-07-18  Janus Weil  <janus@gcc.gnu.org>
1003             Thomas Koenig  <tkoenig@gcc.gnu.org>
1005         PR fortran/85599
1006         * dump-parse-tree.c (show_attr): Add handling of implicit_pure.
1007         * frontend-passes.c (do_warn_function_elimination): Do not warn for
1008         pure functions.
1009         * gfortran.h: Add prototypes for gfc_pure_function and
1010         gfc_implicit_pure_function.
1011         * gfortran.texi: Add chapter on evaluation of logical expressions.
1012         * invoke.texi: Mention that -Wfunction-elimination is implied
1013         by -Wextra.
1014         * lang.opt: Make -Wextra imply -Wfunction-elimination.
1015         * resolve.c (pure_function): Rename to gfc_pure_function.
1016         (gfc_implicit_pure_function): New function.
1017         (check_pure_function): Use it here.
1018         (impure_function_callback): New function.
1019         (resolve_operator): Call it via gfc_expr_walker.
1021 2018-07-16  Fritz Reese  <fritzoreese@gmail.com>
1023         PR fortran/83184
1024         * decl.c (match_old_style_init): Initialize locus of variable expr when
1025         creating a data variable.
1026         (match_clist_expr): Verify array is explicit shape/size before
1027         attempting to allocate constant array constructor.
1029 2018-07-16  Fritz Reese  <fritzoreese@gmail.com>
1031         PR fortran/86417
1032         * module.c (mio_component): Set component->loc when loading from module.
1034 2018-07-10  Jakub Jelinek  <jakub@redhat.com>
1036         PR fortran/86421
1037         * module.c (omp_declare_simd_clauses): Add LINEAR with _REF, _VAL and
1038         _UVAL suffixes.
1039         (mio_omp_declare_simd): Save and restore ref, val and uval modifiers
1040         on linear clauses.  Initialize n->where to gfc_current_locus.
1042 2018-07-05  Paul Thomas  <pault@gcc.gnu.org>
1044         PR fortran/86408
1045         * resolve.c.c (resolve_contained_fntype): Reference to C418 is
1046         in F2008 and not F2003.
1047         (resolve_function): Ditto in error message. Also, exclude
1048         deferred character length results from the error.
1050 2018-07-05  Fritz Reese  <fritzoreese@gmail.com>
1052         PR fortran/83183
1053         PR fortran/86325
1054         * expr.c (class_allocatable, class_pointer, comp_allocatable,
1055         comp_pointer): New helpers.
1056         (component_initializer): Generate EXPR_NULL for allocatable or pointer
1057         components. Do not generate initializers for components within BT_CLASS.
1058         Do not assign to comp->initializer.
1059         (gfc_generate_initializer): Use new helpers; move code to generate
1060         EXPR_NULL for class allocatable components into component_initializer().
1062 2018-07-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
1064         PR fortran/82009
1065         * trans-decl.c (gfc_process_block_locals): Delete assert and set
1066         saved_local_decls = NULL_TREE.
1068 2018-07-02  Richard Biener  <rguenther@suse.de>
1070         PR lto/86321
1071         * trans-types.c (gfc_get_array_type_bounds): Unshare TYPE_FIELDs
1072         for the distinct type copy.
1074 2018-07-02  Paul Thomas  <pault@gcc.gnu.org>
1076         PR fortran/82969
1077         PR fortran/86242
1078         * trans-array.c (structure_alloc_comps): Do not explicitly copy
1079         procedure pointer components.
1081 2018-07-02  Paul Thomas  <pault@gcc.gnu.org>
1083         PR fortran/45305
1084         * expr.c : Add a prototype for scalarize_intrinsic_call.
1085         (gfc_simplify_expr): Use scalarize_intrinsic_call for elemental
1086         intrinsic function calls.
1087         (scalarize_intrinsic_call): Add 'init_flag' argument. Check if
1088         the expression or any of the actual argument expressions are
1089         NULL. Before calling gfc_check_init_expr, check 'init_flag'.
1090         Only simplify the scalarized expressions if there are no errors
1091         on the stack.
1092         (gfc_check_init_expr): Set 'init_flag' true in the call to
1093         scalarize_intrinsic_call.
1095 2018-06-28  Fritz Reese  <fritzoreese@gmail.com>
1097         PR fortran/82865
1098         * decl.c (gfc_match_type): Refactor and check for PDT declarations.
1100 2018-06-28  Martin Liska  <mliska@suse.cz>
1102         * gfortranspec.c: Include opt-suggestions.h.
1104 2018-06-25  Fritz Reese  <fritzoreese@gmail.com>
1106         PR fortran/82972
1107         PR fortran/83088
1108         PR fortran/85851
1109         * expr.c (component_initializer): Assign init expr to c->initializer.
1110         (generate_isocbinding_initializer): New.
1111         (gfc_generate_initializer): Call generate_isocbinding_initializer to
1112         generate initializers for c_ptr and c_funptr with -finit-derived.
1114 2018-06-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
1116         PR fortran/85983
1117         * interface.c (check_dtio_interface1): Delete assert.
1119 2018-06-22  Paul Thomas  <pault@gcc.gnu.org>
1120             Rainer Orth  <ro@gcc.gnu.org>
1122         PR fortran/86281
1123         * resolve.c (resolve_contained_fntype): Check for the charlen
1124         before testing the length.
1126 2018-06-21  Paul Thomas  <pault@gcc.gnu.org>
1128         PR fortran/49630
1129         * resolve.c (resolve_contained_fntype): Change standard ref.
1130         from F95 to F2003: C418. Correct a spelling error in a comment.
1131         It is an error for an abstract interface to have an assumed
1132         character length result.
1133         * trans-expr.c (gfc_conv_procedure_call): Likewise change the
1134         standard reference.
1136 2018-06-21  Paul Thomas  <pault@gcc.gnu.org>
1138         PR fortran/83118
1139         * resolve.c (resolve_ordinary_assign): Force the creation of a
1140         vtable for assignment of non-polymorphic expressions to an
1141         unlimited polymorphic object.
1142         * trans-array.c (gfc_alloc_allocatable_for_assignment): Use the
1143         size of the rhs type for such assignments. Set the dtype, _len
1144         and vptrs appropriately.
1145         * trans-expr.c (gfc_trans_assignment): Force the use of the
1146         _copy function for these assignments.
1148 2018-06-20  Chung-Lin Tang <cltang@codesourcery.com>
1149             Thomas Schwinge <thomas@codesourcery.com>
1150             Cesar Philippidis  <cesar@codesourcery.com>
1152         * gfortran.h (gfc_omp_clauses): Add unsigned if_present, finalize
1153         bitfields.
1154         * openmp.c (enum omp_mask2): Remove OMP_CLAUSE_PRESENT_OR_*. Add
1155         OMP_CLAUSE_{IF_PRESENT,FINALIZE}.
1156         (gfc_match_omp_clauses): Update handling of copy, copyin, copyout,
1157         create, deviceptr, present_of_*. Add support for finalize and
1158         if_present.
1159         (OACC_PARALLEL_CLAUSES): Remove PRESENT_OR_* clauses.
1160         (OACC_KERNELS_CLAUSES): Likewise.
1161         (OACC_DATA_CLAUSES): Likewise.
1162         (OACC_DECLARE_CLAUSES): Likewise.
1163         (OACC_UPDATE_CLAUSES): Add IF_PRESENT clause.
1164         (OACC_ENTER_DATA_CLAUSES): Remove PRESENT_OR_* clauses.
1165         (OACC_EXIT_DATA_CLAUSES): Add FINALIZE clause.
1166         (gfc_match_oacc_declare): Update to OpenACC 2.5 semantics.
1167         * trans-openmp.c (gfc_trans_omp_clauses): Add support for IF_PRESENT
1168         and FINALIZE.
1170 2018-06-18  Eric Botcazou  <ebotcazou@adacore.com>
1172         * trans-decl.c (gfc_get_fake_result_decl): Revert latest change.
1174 2018-06-17  Eric Botcazou  <ebotcazou@adacore.com>
1176         * trans-decl.c (nonlocal_dummy_decl_pset): Delete.
1177         (nonlocal_dummy_decls): Likewise.
1178         (gfc_nonlocal_dummy_array_decl): Likewise.
1179         (gfc_get_symbol_decl): Do not call gfc_nonlocal_dummy_array_decl.
1180         (gfc_get_fake_result_decl): Do not generate a new DECL if simply
1181         reusing the result of a recursive call.
1182         (gfc_generate_function_code): Do not create, insert and destroy
1183         nonlocal_dummy_decls.
1185 2018-06-13  Steven G. Kargl  <kargl@gcc.gnu.org>
1187         PR fortran/86110
1188         * array.c (gfc_resolve_character_array_constructor): Avoid NULL
1189         pointer dereference.
1191 2018-06-13  Cesar Philippidis  <cesar@codesourcery.com>
1193         PR fortran/85703
1194         * parse.c (decode_oacc_directive): Set gfc_matching_function
1195         to false.
1196         (decode_omp_directive): Likewise.
1198 2018-06-13  Cesar Philippidis  <cesar@codesourcery.com>
1200         PR fortran/85702
1201         * openmp.c (gfc_match_oacc_wait): Use %C to report error location.
1203 2018-06-12  David Malcolm  <dmalcolm@redhat.com>
1205         PR other/69968
1206         * misc.c (gfc_closest_fuzzy_match): Update for renaming of
1207         levenshtein_distance to get_edit_distance.
1209 2018-06-12  Steven G. Kargl  <kargl@gcc.gnu.org>
1211         PR fortran/44491
1212         * expr.c (gfc_check_assign): Select non-NULL locus.
1214 2018-06-11  Janus Weil  <janus@gcc.gnu.org>
1216         PR fortran/45521
1217         * interface.c (compare_ptr_alloc): New function.
1218         (generic_correspondence): Call it.
1220 2018-06-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
1222         * gfortran.h (gfc_expr): Add no_bounds_check field.
1223         * frontend-passes.c (get_array_inq_function): Set no_bounds_check
1224         on function and function argument.
1225         (inline_matmul_assign): Set no_bounds_check on zero expression
1226         and on lhs of zero expression.
1227         Also handle A1B2 case if realloc on assigment is active.
1228         * trans-array.c (gfc_conv_array_ref): Don't do range checking
1229         if expr has no_bounds_check set.
1230         (gfc_conv_expr_descriptor): Set no_bounds_check on ss if expr
1231         has it set.
1232         * trans-expr.c (gfc_trans_assignment_1): Set no_bounds_check
1233         on lss and lss if the corresponding expressions have it set.
1235 2018-06-10  Dominique d'Humieres  <dominiq@gcc.gnu.org>
1237         PR fortran/79854
1238         * trans-const.c: Remove include "diagnostic-core.h".
1239         (gfc_conv_constant_to_tree): Replace fatal_error with gcc_unreachable.
1241 2018-06-10  Janus Weil  <janus@gcc.gnu.org>
1243         PR fortran/85088
1244         * decl.c (match_attr_spec): Synchronize the DECL_* enum values with the
1245         INTENT_* values from the enum 'sym_intent'. Call 'match_intent_spec'
1246         and remove a TODO note.
1247         * gfortran.h: Add a comment to sym_intent.
1249 2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>
1251         PR fortran/38351
1252         * resolve.c (resolve_operator): Provide better error message for
1253         derived type entity used in an binary intrinsic numeric operator.
1255 2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>
1257         PR fortran/85138
1258         PR fortran/85996
1259         PR fortran/86051
1260         * decl.c (gfc_match_char_spec): Use private namespace in attempt to
1261         reduce a charlen to a constant.
1263 2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>
1265         PR fortran/78278
1266         * data.c (gfc_assign_data_value): Re-arrange code to allow for
1267         an error for double initialization of CHARACTER entities.
1269 2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>
1271         PR fortran/63514
1272         * symbol.c (gfc_add_volatile): Enforce F2008:C1282 and F2018:C1588.
1274 2018-06-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
1276         PR fortran/85631
1277         * trans.h (gfc_ss): Add field no_bounds_check.
1278         * trans-array.c (gfc_conv_ss_startstride): If flag_realloc_lhs and
1279         ss->no_bounds_check is set, do not use runtime checks.
1280         * trans-expr.c (gfc_trans_assignment_1): Set lss->no_bounds_check
1281         for reallocatable lhs.
1283 2018-06-08  Steven G. Kargl  <kargl@gcc.gnu.org>
1285         PR fortran/86059
1286         * array.c (match_array_cons_element): NULL() cannot be in an
1287         array constructor.
1289 2018-06-08  Steven G. Kargl  <kargl@gcc.gnu.org>
1291         PR fortran/78571
1292         * data.c (create_character_initializer): Return early if type is
1293         incompatible with CHARACTER.
1295 2018-06-07  Steven G. Kargl  <kargl@gcc.gnu.org>
1297         PR fortran/86045
1298         * simplify.c (gfc_simplify_mod): Re-arrange code to test whether
1299         'P' is zero and issue an error if it is.
1301 2018-06-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
1303         PR fortran/85641
1304         * frontend-passes.c (is_fe_temp): Add prototype.
1305         (realloc_string_callback): Early return for frontend-generated
1306         temporary.
1308 2018-06-05  Cesar Philippidis  <cesar@codesourcery.com>
1310         PR fortran/85701
1312         * openmp.c (gfc_resolve_oacc_declare): Error on functions and
1313         subroutine data clause arguments.
1315 2018-06-04  Steven G. Kargl  <kargl@gcc.gnu.org>
1317         PR fortran/85981
1318         * resolve.c (resolve_allocate_deallocate): Check errmsg is default
1319         character kind.
1321 2018-06-03  Paul Thomas  <pault@gcc.gnu.org>
1323         PR fortran/36497
1324         * decl.c (variable_decl): Use gfc_add_type for cray pointees.
1326 2018-06-01  Steven G. Kargl  <kargl@gcc.gnu.org>
1328         PR fortran/63570
1329         * check.c (gfc_check_random_init): New function. Check arguments of
1330         RANDOM_INIT.
1331         * gfortran.h (GFC_ISYM_RANDOM_INIT): New enum token.
1332         * intrinsic.c (add_subroutines): Add RANDOM_INIT to list of
1333         subroutines.
1334         (gfc_check_intrinsic_standard): Introduce Fortran 2018 check.
1335         * intrinsic.h: Add prototypes for gfc_check_random_init and
1336         gfc_resolve_random_init
1337         * intrinsic.texi: Document new intrinsic subprogram.
1338         * iresolve.c (gfc_resolve_random_init): Resolve routine name.
1339         * trans-decl.c: Declare gfor_fndecl_random_init
1340         * trans-intrinsic.c (conv_intrinsic_random_init): New function.
1341         Translate call to RANDOM_INIT.
1342         (gfc_conv_intrinsic_subroutine): Call it.
1343         * trans.h: Declare gfor_fndecl_random_init
1345 2018-05-27  Steven G. Kargl  <kargl@gcc.gnu.org>
1347         * decl.c (match_data_constant):  Fortran 2018 allows pointer
1348         initialization in a data statement.
1350 2018-05-25  Janus Weil  <janus@gcc.gnu.org>
1352         PR fortran/85839
1353         * match.c (gfc_match_block_data): Call gfc_notify_std to warn about
1354         an obsolescent feature in Fortran 2018.
1355         (gfc_match_equivalence): Ditto.
1356         * resolve.c (resolve_common_blocks): Ditto.
1357         (gfc_resolve_forall): Ditto.
1358         * symbol.c (gfc_define_st_label): Ditto.
1360 2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
1362         PR fortran/85543
1363         * resolve.c (update_current_proc_array_outer_dependency): Avoid NULL
1364         pointer dereference.
1366 2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
1368         PR fortran/85780
1369         * resolve.c (resolve_fl_procedure): Avoid NULL dereference.
1371 2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
1373         PR fortran/85779
1374         * decl.c (gfc_match_derived_decl): Fix NULL point dereference.
1376 2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
1378         PR fortran/85895
1379         * resolve.c (resolve_sync): Resolve expression before checking for
1380         an error.
1382 2018-05-22  Janus Weil  <janus@gcc.gnu.org>
1384         PR fortran/85841
1385         * libgfortran.h: Remove the macros GFC_STD_F2008_TS and
1386         GFC_STD_OPT_F08TS.
1387         * error.c (notify_std_msg): Remove GFC_STD_F2008_TS.
1388         * options.c (set_default_std_flags): Ditto.
1389         (gfc_handle_option): Make -std=f2008ts an alias for -std=f2018.
1390         * array.c (gfc_match_array_spec): Replace GFC_STD_F2008_TS by
1391         GFC_STD_F2018.
1392         * check.c (gfc_check_atomic, gfc_check_event_query,
1393         gfc_check_c_f_pointer, gfc_check_c_f_procpointer, gfc_check_c_funloc,
1394         gfc_check_c_loc, gfc_check_num_images, gfc_check_this_image): Ditto.
1395         * decl.c (gfc_verify_c_interop_param, gfc_match_decl_type_spec): Ditto.
1396         * intrinsic.c (add_functions, add_subroutines,
1397         gfc_check_intrinsic_standard): Ditto.
1398         * iso-c-binding.def: Ditto.
1399         * iso-fortran-env.def: Ditto.
1400         * match.c (gfc_match_event_post, gfc_match_event_wait,
1401         gfc_match_fail_image, gfc_match_form_team, gfc_match_change_team,
1402         gfc_match_end_team, gfc_match_sync_team): Ditto.
1403         * gfortran.texi: Remove mention of -std=f2008ts.
1404         Move TSs into F2018 section.
1405         * invoke.texi: Update documentation of -std=f2008ts.
1407 2018-05-21  Janus Weil  <janus@gcc.gnu.org>
1409         PR fortran/85841
1410         * libgfortran.h: New macros GFC_STD_OPT_*.
1411         * error.c (notify_std_msg): New function.
1412         (gfc_notify_std): Adjust such that it can handle combinations of
1413         GFC_STD_* flags in the 'std' argument, not just a single one.
1414         * match.c (match_arithmetic_if, gfc_match_if): Reject arithmetic if
1415         in Fortran 2018.
1416         (gfc_match_stopcode): Use GFC_STD_OPT_* macros.
1417         * options.c (set_default_std_flags): Warn for F2018 deleted features
1418         by default.
1419         (gfc_handle_option): F2018 deleted features are allowed in earlier
1420         standards.
1421         * symbol.c (gfc_define_st_label, gfc_reference_st_label): Reject
1422         nonblock do constructs in Fortran 2018.
1424 2018-05-20  Paul Thomas  <pault@gcc.gnu.org>
1426         PR fortran/80657
1427         * resolve.c (flag_fn_result_spec): Use the 'sym' argument to
1428         test for self refs to the function result in the character len
1429         expression. If a self reference is found, emit an error and
1430         return true.
1431         (resolve_fntype): Use the function symbol in the calls to the
1432         above.
1434 2018-05-20  Paul Thomas  <pault@gcc.gnu.org>
1436         PR fortran/49636
1437         * trans-array.c (gfc_get_array_span): Renamed from
1438         'get_array_span'.
1439         (gfc_conv_expr_descriptor): Change references to above.
1440         * trans-array.h : Add prototype for 'gfc_get_array_span'.
1441         * trans-intrinsic.c (gfc_conv_associated): Add pre and post
1442         blocks for 'arg1'.
1443         * trans-stmt.c (trans_associate_var): If the associate name is
1444         a subref array pointer, use gfc_get_array_span for the span.
1446 2018-05-20  Paul Thomas  <pault@gcc.gnu.org>
1448         PR fortran/82275
1449         * match.c (gfc_match_type_spec): Go through the array ref and
1450         decrement 'rank' for every dimension that is an element.
1452 2018-05-19  Paul Thomas  <pault@gcc.gnu.org>
1454         PR fortran/82923
1455         PR fortran/66694
1456         PR fortran/82617
1457         * trans-array.c (gfc_alloc_allocatable_for_assignment): Set the
1458         charlen backend_decl of the rhs expr to ss->info->string_length
1459         so that the value in the current scope is used.
1461 2018-05-13  Steven G. Kargl  <kargl@gcc.gnu.org>
1463         PR fortran/63529
1464         * gfortran.texi: Clarify documentation for Cray pointer and
1465         assumed-sized array.
1467 2018-05-13  Paul Thomas  <pault@gcc.gnu.org>
1469         PR fortran/85742
1470         * trans-types.c (gfc_get_dtype_rank_type): Reorder evaluation
1471         of 'size'. If the element type is a pointer use the size of the
1472         TREE_TYPE of the type, unless it is VOID_TYPE. In this latter
1473         case, set the size to zero.
1475 2018-05-13  Steven G. Kargl  <kargl@gcc.gnu.org>
1477         * gfortran.h: Remove prototype.
1478         * symbol.c (gfc_new_undo_checkpoint): Remove unused function.
1480 2018-05-11  Steven G. Kargl  <kargl@gcc.gnu.org>
1482         PR fortran/85542
1483         * expr.c (check_inquiry): Avoid NULL pointer dereference.
1485 2018-05-10  Steven G. Kargl  <kargl@gcc.gnu.org>
1487         PR fortran/85687
1488         * check.c (gfc_check_rank): Check that the argument is a data object.
1490 2018-05-10  Steven G. Kargl  <kargl@gcc.gnu.org>
1492         PR fortran/85521
1493         * array.c (gfc_resolve_character_array_constructor): Substrings
1494         with upper bound smaller than lower bound are zero length strings.
1496 2018-05-10  Steven G. Kargl  <kargl@gcc.gnu.org>
1498         PR fortran/70870
1499         * data.c (gfc_assign_data_value): Check that a data object does
1500         not also have default initialization.
1502 2018-05-10  Marek Polacek  <polacek@redhat.com>
1504         PR fortran/85735
1505         * options.c (gfc_post_options): Set main_input_filename.
1507 2018-05-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
1509         PR fortran/54613
1510         * intrinsic.texi: Document BACK for MINLOC and MAXLOC.
1512 2018-05-10  Paul Thomas  <pault@gcc.gnu.org>
1514         PR fortran/68846
1515         PR fortran/70864
1516         * resolve.c (get_temp_from_expr): The temporary must not have
1517         dummy or intent attributes.
1519 2018-05-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
1521         PR fortran/54613
1522         * check.c (gfc_check_minmaxloc): Remove error for BACK not being
1523         implemented.  Use gfc_logical_4_kind for BACK.
1524         * simplify.c (min_max_choose): Add optional argument back_val.
1525         Handle it.
1526         (simplify_minmaxloc_to_scalar): Add argument back_val. Pass
1527         back_val to min_max_choose.
1528         (simplify_minmaxloc_to_nodim): Likewise.
1529         (simplify_minmaxloc_to_array): Likewise.
1530         (gfc_simplify_minmaxloc): Add argument back, handle it.
1531         Pass back_val to specific simplification functions.
1532         (gfc_simplify_minloc): Remove ATTRIBUTE_UNUSED from argument back,
1533         pass it on to gfc_simplify_minmaxloc.
1534         (gfc_simplify_maxloc): Likewise.
1535         * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Adjust
1536         comment. If BACK is true, use greater or equal (or lesser or
1537         equal) insteal of greater (or lesser). Mark the condition of
1538         having found a value which exceeds the limit as unlikely.
1540 2018-05-07  Jeff Law  <law@redhat.comg>
1542         * scanner.c (preprocessor_line): Call linemap_add after a line
1543         directive that changes the current filename.
1545 2018-05-06  Andre Vehreschild  <vehre@gcc.gnu.org>
1547         PR fortran/85507
1548         * dependency.c (gfc_dep_resolver): Revert looking at coarray dimension
1549         introduced by r259385.
1550         * trans-intrinsic.c (conv_caf_send): Always report a dependency for
1551         same variables in coarray assignments.
1553 2018-05-02  Tom de Vries  <tom@codesourcery.com>
1555         PR libgomp/82428
1556         * f95-lang.c (DEF_GOACC_BUILTIN_ONLY): Define.
1558 2018-04-24  Steven G. Kargl  <kargl@gcc.gnu.org>
1560         PR fortran/85520
1561         * decl.c (gfc_match_char_spec): Check for negative length and set to 0.
1563 2018-04-14  Andre Vehreschild  <vehre@gcc.gnu.org>
1565         PR fortran/81773
1566         PR fortran/83606
1567         * dependency.c (gfc_dep_resolver): Coarray indexes are to be ignored
1568         during dependency computation.  They define no data dependency.
1569         * trans-array.c (conv_array_index_offset): The stride can not be set
1570         here, prevent fail.
1571         * trans-intrinsic.c (conv_caf_send): Add creation of temporary array
1572         for caf_get's result and copying to the array with vectorial
1573         indexing.
1575 2018-04-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
1577         PR fortran/85387
1578         * frontend-passes.c (traverse_io_block): Check for start, end or
1579         stride being defined by an outer implied DO loop.
1581 2018-04-12  Thomas Koenig  <tkoenig@gcc.gnu.org>
1583         PR fortran/83064
1584         PR testsuite/85346
1585         * trans-stmt.c (gfc_trans_forall_loop): Use annot_expr_ivdep_kind
1586         for annotation and remove dependence on -ftree-parallelize-loops.
1588 2018-04-10  Jakub Jelinek  <jakub@redhat.com>
1590         PR fortran/85313
1591         * openmp.c (resolve_omp_do): Remove bogus if (j < i) break;.
1592         (resolve_oacc_nested_loops): Likewise.  Formatting fix.
1594 2018-04-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
1596         PR fortran/83064
1597         * trans-stmt.c (gfc_trans_forall_loop): Remove annotation for
1598         parallell processing of DO CONCURRENT -ftree-parallelize-loops
1599         is set.
1601 2018-04-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
1603         PR fortran/51260
1604         * resolve.c (resolve_variable): Simplify cases where access to a
1605         parameter array results in a single constant.
1607 2018-04-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
1609         PR fortran/85102
1610         * decl.c (variable_decl): If upper or lower bounds simplify
1611         to a constant, use that.
1613 2018-03-30  Paul Thomas  <pault@gcc.gnu.org>
1615         PR fortran/84931
1616         * simplify.c (gfc_convert_constant): Handle case of array
1617         constructors within an array that has no iterator and improve
1618         the conciseness of this section of code.
1620 2017-03-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
1622         PR fortran/85111
1623         * array.c (gfc_resolve_character_array_constructor): Early
1624         exit for zero-size arrays.
1625         * simplify.c (simplify_transformation_to_array): Exit early
1626         if the result size is zero.
1627         (simplify_minmaxloc_to_array): Likewise.
1629 2018-03-28  Mikael Morin  <mikael@gcc.gnu.org>
1631         PR fortran/69497
1632         * symbol.c (gfc_symbol_done_2): Start freeing namespaces
1633         from the root.
1634         (gfc_free_namespace): Restore assert (revert r258839).
1636 2018-03-28  Jakub Jelinek  <jakub@redhat.com>
1638         * gfortran.h (gfc_dt): Rename default_exp field to dec_ext.
1639         * ioparm.def (IOPARM_dt_default_exp): Rename to ...
1640         (IOPARM_dt_dec_ext): ... this.
1641         * trans-io.c (build_dt): Adjust for default_exp renaming to
1642         dec_ext and IOPARM_dt_default_exp renaming to IOPARM_dt_dec_ext.
1643         * io.c (match_io): Likewise.
1645 2018-03-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
1647         PR fortran/85084
1648         * frontend-passes.c (gfc_run_passes): Do not run front-end
1649         optimizations if a previous error occurred.
1651 2018-03-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
1652         Harald Anlauf  <anlauf@gmx.de>
1654         PR fortran/85083
1655         * primary.c (gfc_convert_to_structure_constructor): Check
1656         conformance of argument types in structure constructor.
1658 2018-03-26  Thomas Koenig  <tkoenig@gcc.gnu.org>
1660         PR fortran/66709
1661         * io.c: Include constructor.h.
1662         (resolve_tag_format): For a constant character array, concatenate
1663         into a single character expression.
1665 2018-03-25  Seth Johnson <johnsonsr@ornl.gov>
1666         Dominique d'Humieres  <dominiq@gcc.gnu.org>
1668         PR fortran/84924
1669         * check.c (gfc_check_c_f_pointer): Allow scalar noninteroperable
1670         scalar derived type with -std=f2003 and -std=f2008.
1672 2018-03-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
1673             Dominique d'Humieres  <dominiq@gcc.gnu.org>
1675         PR fortran/69497
1676         * symbol.c (gfc_free_namespace): Delete the assert and only if
1677         refs count is equals zero, free the namespace. Otherwise,
1678         something is halfway and other errors will resound.
1680 2018-03-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
1682         PR fortran/70068
1683         * expr.c (find_substring_ref): Change types of start, end
1684         and length variables to gfc_charlen_t. Set length to zero
1685         for empty substring.
1687 2018-03-24  Steven G. Kargl  <kargl@gcc.gnu.org>
1689         PR fortran/42651
1690         * decl.c (check_function_name): Improved error message
1691         (gfc_match_volatile, gfc_match_asynchronous) Use check_function_name.
1693 2018-03-22  Steven G. Kargl  <kargl@gcc.gnu.org>
1695         PR fortran/84922
1696         * decl.c (get_proc_name): If the MODULE prefix appears in interface
1697         body, then it must appear on the contained subroutine or function.
1698         While here, fix nearby mis-indented code.
1700 2018-03-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
1701         Harald Anlauf  <anlauf@gmx.de>
1703         PR fortran/84957
1704         * trans-types.c (gfc_sym_type): Do not dereference NULL pointer.
1706 2018-03-21  Janne Blomqvist  <jb@gcc.gnu.org>
1708         PR fortran/84615
1709         * trans-expr.c (gfc_conv_procedure_call): Convert charlen to
1710         gfc_charlen_type_node when calling procedure.
1712 2018-03-20  Steven G. Kargl  <kargl@gcc.gnu.org>
1714         PR fortran/85001
1715         * interface.c (symbol_rank): Remove bogus null pointer check that
1716         crept in when translating a ternary operator into an if-else
1717         constructor.
1719 2018-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
1721         PR fortran/84931
1722         * simplify.c (gfc_convert_constant): Correctly handle iterators
1723         for type conversion.
1725 2018-03-18  Steven G. Kargl  <kargl@gcc.gnu.org>
1727         PR fortran/77414
1728         * decl.c (get_proc_name):  Check for a subroutine re-defined in
1729         the contain portion of a subroutine.  Change language of existing
1730         error message to better describe the issue. While here fix whitespace
1731         issues.
1733 2018-03-18  Steven G. Kargl  <kargl@gcc.gnu.org>
1735         PR fortran/65453
1736         * decl.c (get_proc_name): Catch clash between a procedure statement
1737         and a contained subprogram
1739 2018-03-16  Steven G. Kargl  <kargl@gcc.gnu.org>
1741         PR fortran/69395
1742         * decl.c (merge_array_spec): Correct the error condition.
1744 2018-03-15  Steven G. Kargl  <kargl@gcc.gnu.org>
1746         PR fortran/78741
1747         * decl.c (get_proc_name):  Check for clash of entry name with
1748         subroutine name.
1750 2018-03-15  Steven G. Kargl  <kargl@gcc.gnu.org>
1752         PR fortran/69395
1753         * decl.c (merge_array_spec): Limit the merging to maximum allowed
1754         dimensions, and issue error message if limit is exceeded.
1756 2018-03-13  Steven G. Kargl  <kargl@gcc.gnu.org>
1758         * check.c (gfc_check_kill_sub):  Remove check for INTEGER(4) or (8).
1759         * intrinsic.c (add_functions): Remove reference to gfc_resolve_kill.
1760         (add_subroutines): Remove reference to gfc_resolve_kill_sub.
1761         * intrinsic.texi: Update documentation.
1762         * iresolve.c (gfc_resolve_kill, gfc_resolve_kill_sub): Remove.
1763         * trans-decl.c (gfc_build_intrinsic_function_decls):  Add
1764         gfor_fndecl_kill and gfor_fndecl_kill_sub
1765         * trans-intrinsic.c (conv_intrinsic_kill, conv_intrinsic_kill_sub): new
1766         functions.
1767         (gfc_conv_intrinsic_function): Use conv_intrinsic_kill.
1768         (gfc_conv_intrinsic_subroutine): Use conv_intrinsic_kill_sub.
1769         * trans.h: Declare gfor_fndecl_kill and gfor_fndecl_kill_sub.
1771 2018-03-11  Paul Thomas  <pault@gcc.gnu.org>
1773         PR fortran/84546
1774         * trans-array.c (structure_alloc_comps): Make sure that the
1775         vptr is copied and that the unlimited polymorphic _len is used
1776         to compute the size to be allocated.
1777         * trans-expr.c (gfc_get_class_array_ref): If unlimited, use the
1778         unlimited polymorphic _len for the offset to the element.
1779         (gfc_copy_class_to_class): Set the new 'unlimited' argument.
1780         * trans.h : Add the boolean 'unlimited' to the prototype.
1782 2018-03-11  Steven G. Kargl  <kargl@gcc.gnu.org>
1784         PR fortran/83939
1785         * resolve.c (resolve_fl_procedure): Enforce F2018:C15100.
1787 2018-03-11  Steven G. Kargl  <kargls@gcc.gnu.org>
1789         * check.c (gfc_check_kill):  Check pid and sig are scalar.
1790         (gfc_check_kill_sub): Restrict kind to 4 and 8.
1791         * intrinsic.c (add_function): Sort keyword list.  Add pid and sig
1792         keywords for KILL.  Remove redundant *back="back" in favor of the
1793         original *bck="back".
1794         (add_subroutines): Sort keyword list.  Add pid and sig keywords
1795         for KILL.
1796         * intrinsic.texi: Fix documentation to consistently use pid and sig.
1797         * iresolve.c (gfc_resolve_kill): Kind can only be 4 or 8.  Choose the
1798         correct function.
1799         (gfc_resolve_rename_sub): Add comment.
1801 2018-03-11  Thomas Koenig  <tkoenig@gcc.gnu.org>
1803         PR fortran/66128
1804         * simplify.c (simplify_transformation): Return default result for
1805         empty array argument.
1806         (gfc_simplify_all): Remove special-case handling for zerosize.
1807         (gfc_simplify_any): Likewise.
1808         (gfc_simplify_count): Likewise.
1809         (gfc_simplify_iall): Likewise.
1810         (gfc_simplify_iany): Likewise.
1811         (gfc_simplify_iparity): Likewise.
1812         (gfc_simplify_minval): Likewise.
1813         (gfc_simplify_maxval): Likewise.
1814         (gfc_simplify_norm2): Likewise.
1815         (gfc_simplify_product): Likewise.
1816         (gfc_simplify_sum): Likewise.
1818 2018-03-10  Steven G. Kargl  <kargl@gcc.gnu.org>
1820         PR fortran/84734
1821         * arith.c (check_result, eval_intrinsic):  If result overflows, pass
1822         the expression up the chain instead of a NULL pointer.
1824 2018-03-07  Steven G. Kargl  <kargl@gcc.gnu.org>
1826         PR fortran/64124
1827         PR fortran/70409
1828         * decl.c (gfc_match_char_spec): Try to reduce a charlen to a constant.
1830 2017-03-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
1832         PR fortran/84697
1833         PR fortran/66128
1834         * expr.c (simplify_parameter_variable): If p is a size zero array
1835         and not an ARRAY_EXPR insert an empty array constructor and
1836         return.
1837         * gfortran.h: Add prototype for gfc_is_size_zero_array.
1838         * simplify.c (is_size_zero_array): Make non-static and rename into
1839         (gfc_is_size_zero_array):  Check for parameter arrays of zero
1840         size by comparing shape and absence of constructor.
1841         (gfc_simplify_all): Use gfc_is_size_zero_array instead of
1842         is_size_zero_array.
1843         (gfc_simplify_count): Likewise.
1844         (gfc_simplify_iall): Likewise.
1845         (gfc_simplify_iany): Likewise.
1846         (gfc_simplify_iparity): Likewise.
1847         (gfc_simplify_minval): Likewise.
1848         (gfc_simplify_maxval): Likewise.
1849         (gfc_simplify_product): Likewise.
1850         (gfc_simplify_sum): Likewise.
1852 2018-03-06  Steven G. Kargl  <kargl@gcc.gnu.org>
1854         PR fortran/56667
1855         * primary.c (match_sym_complex_part): Give the matcher for an implied
1856         do-loop a chance to run.
1858 2018-03-03  Harald Anlauf  <anlauf@gmx.de>
1860         PR fortran/71085
1861         * trans-expr.c (gfc_apply_interface_mapping_to_expr): Do not
1862         dereference NULL pointer.
1864 2018-03-03  Steven G. Kargl  <kargl@gcc.gnu.org>
1866         PR fortran/66128
1867         * simplify.c (is_size_zero_array): New function to check for size
1868         zero array.
1869         (gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
1870          gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
1871          gfc_simplify_minval, gfc_simplify_maxval, gfc_simplify_norm2,
1872          gfc_simplify_product, gfc_simplify_sum): Use it, and implement
1873         requirements from F2018.
1875 2018-03-03  Steven G. Kargl  <kargl@gcc.gnu.org>
1877         PR fortran/51434
1878         * simplify.c (gfc_simplify_transfer): Resolve mold.
1880 2018-03-03  Paul Thomas  <pault@gcc.gnu.org>
1882         PR fortran/80965
1883         * resolve.c (build_loc_call): Change symtree name from 'loc' to
1884         '_loc'.
1886 2018-03-01  Paul Thomas  <pault@gcc.gnu.org>
1888         PR fortran/84219
1889         * target-memory.c (gfc_interpret_derived): Assert that BT_VOID
1890         components are caf tokens.
1891         (gfc_target_interpret_expr): Treat BT_VOID expressions as
1892         integers.
1894 2018-03-01  Paul Thomas  <pault@gcc.gnu.org>
1896         PR fortran/84538
1897         * class.c (class_array_ref_detected): Remove the condition that
1898         there be no reference after the array reference.
1899         (find_intrinsic_vtab): Remove excess whitespace.
1900         * trans-array.c (gfc_conv_scalarized_array_ref): Rename 'tmp'
1901         as 'base and call build_class_array_ref earlier.
1903 2018-02-28  Paul Thomas  <pault@gcc.gnu.org>
1905         PR fortran/83901
1906         * trans-stmt.c (trans_associate_var): Make sure that the se
1907         expression is a pointer type before converting it to the symbol
1908         backend_decl type.
1910 2018-02-25  Steven G. Kargl  <kargl@gcc.gnu.org>
1912         PR fortran/83633
1913         * decl.c (variable_decl): Check that an explicit-shape-array with
1914         nonconstant bounds is allowed.
1916 2018-02-25  Paul Thomas  <pault@gcc.gnu.org>
1918         PR fortran/84523
1919         * trans-intrinsic.c (gfc_conv_allocated): If the argument se
1920         has a pre block, add it to the expression pre block.
1922 2018-02-25  Thomas Koenig  <tkoenig@gcc.gnu.org>
1924         PR fortran/78238
1925         * gfortran.h (gfc_integer_4_kind): Define.
1926         * resolve.c (resolve_select_type): Make sure that the
1927         kind of c->high is gfc_integer_4_kind.
1929 2018-02-24  Steven G. Kargl <kargl@gcc.gnu.org>
1931         PR fortran/30792
1932         * decl.c (gfc_match_data): Check for invalid substring in
1933         data-implied-do
1935 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
1937         * intrinsic.texi: Arguments to MATMUL cannot both be rank one.
1939 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
1941         PR fortran/84511
1942         * trans-io.c (transfer_expr): Deal with C_LOC in transfer statement.
1944 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
1946         PR fortran/84346
1947         * interface.c (compare_actual_formal): Issue error if keyword is
1948         used in a statement function.
1950 2018-02-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
1952         PR fortran/84506
1953         * trans-io.c (set_parameter_value_inquire): Adjust range check of
1954         negative unit values for kind=8 units to the kind=4 negative limit.
1956 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
1958         PR fortran/83149
1959         * trans-types.c (gfc_sym_type): Test sym->ns->proc_name before
1960         accessing its components.
1962 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
1964         PR fortran/83149
1965         * trans-decl.c (gfc_finish_var_decl): Test sym->ns->proc_name
1966         before accessing its components.
1968 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
1970         PR fortran/83148
1971         * trans-const.c : Clean up some whitespace issues.
1972         * trans-expr.c (gfc_conv_initializer): If an iso_c_binding
1973         derived type has a kind value of zero, set it to the default
1974         integer kind.
1976 2018-02-23  Janne Blomqvist  <jb@gcc.gnu.org>
1978         PR fortran/84519
1979         * trans-decl.c (gfc_build_builtin_function_decls): Add bool
1980         argument to stop and error stop decls.
1981         * trans-stmt.c (gfc_trans_stop): Add false value to argument
1982         lists.
1984 2018-02-22  Janne Blomqvist  <jb@gcc.gnu.org>
1986         PR 78534
1987         PR 84509
1988         * trans-decl.c (gfc_build_builtin_function_decls): Pass
1989         gfc_int8_type node to pause_numeric, size_type_node to
1990         pause_string.
1991         * trans-stmt.c (gfc_trans_pause): Likewise.
1993 2018-02-22  Janne Blomqvist  <jb@gcc.gnu.org>
1995         * gfortran.texi: Update Coarray API description.
1996         * trans-decl.c (gfc_build_builtin_function_decls): Use size_t for
1997         character lengths, int for exit codes.
1998         (generate_coarray_sym_init): Use size_t for character length.
1999         * trans-intrinsic.c (conv_co_collective): Likewise.
2000         * trans-stmt.c (gfc_trans_lock_unlock): Likewise.
2001         (gfc_trans_event_post_wait): Likewise.
2002         (gfc_trans_sync): Likewise.
2003         (gfc_trans_stop): Use size_t for character lengths, int for exit
2004         codes.
2006 2018-02-20  Thomas Koenig  <tkoenig@gcc.gnu.org>
2008         PR fortran/48890
2009         PR fortran/83823
2010         * primary.c (gfc_convert_to_structure_constructor):
2011         For a constant string constructor, make sure the length
2012         is correct.
2014 2018-02-19  Paul Thomas  <pault@gcc.gnu.org>
2016         PR fortran/83344
2017         PR fortran/83975
2018         * resolve.c (resolve_assoc_var): Rearrange the logic for the
2019         determination of the character length of associate names. If
2020         the associate name is missing a length expression or the length
2021         expression is not a constant and the target is not a variable,
2022         make the associate name allocatable and deferred length.
2023         * trans-decl.c (gfc_get_symbol_decl): Null the character length
2024         backend_decl for deferred length associate names that are not
2025         variables. Set 'length' to gfc_index_zero_node for character
2026         associate names, whose character length is a PARM_DECL.
2028 2018-02-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
2030         PR fortran/35339
2031         * frontend-passes.c (traverse_io_block): Remove workaround for
2032         PR 80945.
2034 2018-02-19  Andre Vehreschild  <vehre@gcc.gnu.org>
2036         * gfortran.texi: Document additional src/dst_type.  Fix some typos.
2037         * trans-decl.c (gfc_build_builtin_function_decls): Declare the new
2038         argument of _caf_*_by_ref () with * e { get, send, sendget }.
2039         * trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Add the type of the
2040         data referenced when generating a call to caf_get_by_ref ().
2041         (conv_caf_send): Same but for caf_send_by_ref () and
2042         caf_sendget_by_ref ().
2044 2018-02-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
2046         PR fortran/84389
2047         * io.c (check_format): Allow FMT_COLON.
2049 2018-02-18  Paul Thomas  <pault@gcc.gnu.org>
2051         PR fortran/80945
2052         * trans-array.c (gfc_conv_expr_descriptor): Set parmtype from
2053         the typenode in the case of deferred length characters.
2055 2018-02-17  Thomas Koenig  <tkoenig@gcc.gnu.org>
2057         PR fortran/84270
2058         * frontend-passes (scalarized_expr):  If the expression
2059         is an assumed size array, leave in the last reference
2060         and pass AR_SECTION instead of AR_FULL to gfc_resolve
2061         in order to avoid an error.
2063 2018-02-17  Paul Thomas  <pault@gcc.gnu.org>
2065         PR fortran/84115
2066         * resolve.c (resolve_assoc_var): If a non-constant target expr.
2067         has no string length expression, make the associate variable
2068         into a deferred length, allocatable symbol.
2069         * trans-decl.c (gfc_is_reallocatable_lhs): Add and use a ptr to
2070         the symbol.
2071         * trans-stmt.c (trans_associate_var): Null and free scalar
2072         associate names that are allocatable. After assignment, remove
2073         the allocatable attribute to prevent reallocation.
2075 2018-02-16  Jakub Jelinek  <jakub@redhat.com>
2077         PR fortran/84418
2078         * trans-openmp.c (gfc_trans_omp_clauses): For OMP_CLAUSE_LINEAR_REF
2079         kind set OMP_CLAUSE_LINEAR_STEP to TYPE_SIZE_UNIT times last_step.
2081 2018-02-16  Dominique d'Humieres  <dominiq@gcc.gnu.org>
2083         PR fortran/84354
2084         * decl.c (gfc_get_pdt_instance): Replace '%qs' with %qs.
2086 2018-02-15  Janus Weil  <janus@gcc.gnu.org>
2088         PR fortran/84409
2089         * interface.c (check_dtio_arg_TKR_intent): Add a check for character
2090         length.
2092 2018-02-14  Janus Weil  <janus@gcc.gnu.org>
2094         PR fortran/84385
2095         * match.c (gfc_match_select_type): Fix check for selector in
2096         SELECT TYPE statement.
2098 2018-02-13  Janus Weil  <janus@gcc.gnu.org>
2100         PR fortran/84313
2101         * symbol.c (check_conflict): Reject procedure pointers in common blocks.
2103 2018-02-13  Alastair McKinstry  <alastair.mckinstry@sceal.ie>
2104             Janne Blomqvist  <jb@gcc.gnu.org>
2106         * module.c (dump_module): Use lbasename to ensure that module
2107         files are reproducible.
2109 2018-02-12  Janus Weil  <janus@gcc.gnu.org>
2111         PR fortran/84273
2112         * resolve.c (resolve_component): Fix checks of passed argument in
2113         procedure-pointer components.
2115 2018-02-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2117         PR fortran/35299
2118         * resolve.c (resolve_formal_arglist): Update error message.
2120 2018-02-11  Andre Vehreschild  <vehre@gcc.gnu.org>
2122         * gfortran.texi: Fix typos in documentation of caf_register ().
2123         * trans-array.c (structure_alloc_comps): Only register a component of
2124         a derived typed corray, not of an ultimate component coarray.
2126 2018-02-11  Steven G. Kargl  <kargl@gcc.gnu.org>
2128         PR fortran/54223
2129         PR fortran/84276
2130         * interface.c (compare_actual_formal): Add in_statement_function
2131         bool parameter.  Skip check of INTENT attribute for statement
2132         functions.  Arguments to a statement function cannot be optional,
2133         issue error for missing argument.
2134         (gfc_procedure_use, gfc_ppc_use, gfc_arglist_matches_symbol): Use
2135          in_statement_function.
2137 2018-02-11  Paul Thomas  <pault@gcc.gnu.org>
2139         PR fortran/84074
2140         * trans-expr.c (gfc_conv_derived_to_class): Set the use_offset
2141         flag. If the is a vector subscript or the expression is not a
2142         variable, make the descriptor one-based.
2144 2018-02-10  Paul Thomas  <pault@gcc.gnu.org>
2146         PR fortran/84141
2147         PR fortran/84155
2148         * trans-array.c (gfc_array_init_size): Revert the change made
2149         in revision 257356 setting the dtype.
2150         * trans-types.c (gfc_get_dtype): Do not use the cached dtype.
2151         Call gfc_get_dtype_rank_type every time.
2153         PR fortran/56691
2154         * trans-array.c (gfc_conv_expr_descriptor): If the source array
2155         is a descriptor type, use its offset, removing the condition
2156         that is be a class expression.
2158 2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>
2160         PR fortran/82994
2161         * match.c (gfc_match_deallocate): Check for NULL pointer.
2163 2018-02-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
2165         PR fortran/68560
2166         * trans-intrinsic.c (gfc_conv_intrinsic_shape): New function.
2167         (gfc_conv_intrinsic_function): Call it.
2169 2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>
2171         PR fortran/82049
2172         * match.c (gfc_match_type_spec): If the charlen is non-NULL, then
2173         try to resolve it.  While here return early if possible.
2175 2018-02-04  Paul Thomas  <pault@gcc.gnu.org>
2177         PR fortran/84115
2178         * trans-decl.c (gfc_get_symbol_decl): Do not finish the decl of
2179         'length' if the symbol charlen backend_decl is an indirect ref.
2181 2018-02-03  Paul Thomas  <pault@gcc.gnu.org>
2183         PR fortran/84141
2184         PR fortran/84155
2185         * trans-array.c (gfc_array_init_size): Instead of gfc_get_dtype
2186         use gfc_get_dtype_rank_type.
2188 2018-02-01  Janne Blomqvist  <jb@gcc.gnu.org>
2190         PR 83975
2191         PR 83344
2192         * resolve.c (resolve_assoc_var): Generate an error if
2193         target length unknown.
2195 2018-02-01  Janne Blomqvist  <jb@gcc.gnu.org>
2197         PR fortran/83705
2198         * simplify.c (gfc_simplify_repeat): Increase limit for deferring
2199         to runtime, print a warning message.
2201 2018-01-31  Jakub Jelinek  <jakub@redhat.com>
2203         PR fortran/84116
2204         * openmp.c (gfc_match_omp_clauses): If all the linear
2205         gfc_match_omp_variable_list calls failed, don't gfc_free_omp_namelist
2206         nor set *head = NULL.  Formatting fixes.
2208 2018-01-31  Paul Thomas  <pault@gcc.gnu.org>
2210         PR fortran/84088
2211         * trans-expr.c (gfc_conv_procedure_call): If the parm expr is
2212         an address expression passed to an assumed rank dummy, convert
2213         to an indirect reference.
2215 2018-01-31  Thomas Koenig  <tkoenig@gcc.gnu.org>
2217         * dump-parse-tree.c (write_proc): Use sym_name (which may
2218         be sym->binding_label) instead of sym->name.
2220 2018-01-31  Janne Blomqvist  <jb@gcc.gnu.org>
2222         * trans-const.c (gfc_conv_string_init): Use gfc_charlen_t instead
2223         of int for slen.
2225 2018-01-31  Janne Blomqvist  <jb@gcc.gnu.org>
2227         PR fortran/78534
2228         * trans-expr.c (fill_with_spaces): Use memset instead of
2229         generating loop.
2230         (gfc_trans_string_copy): Improve opportunity to use builtins with
2231         constant lengths.
2233 2018-01-30  Jakub Jelinek  <jakub@redhat.com>
2235         PR debug/84131
2236         * trans-array.c (gfc_get_descriptor_offsets_for_info): Set *data_off
2237         to DATA_FIELD's offset rather than OFFSET_FIELD's offset.
2239 2018-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
2241         PR fortran/84134
2242         * array.c (gfc_ref_dimen_size): Whitespace fixes.  If stride is
2243         zero, return false.
2245 2018-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
2247         PR fortran/84133
2248         * frontend-passes (matmul_to_var_expr): Return early if
2249         in association list.
2250         (inline_matmul_assign): Likewise.
2252 2017-01-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
2254         PR fortran/84073
2255         * resolve.c (resolve_component): Ensure BIND(C) character
2256         components have length one.
2257         (resolve_symbol): Likewise for variables.
2259 2018-01-27  Jakub Jelinek  <jakub@redhat.com>
2261         PR fortran/84065
2262         * decl.c (add_init_expr_to_sym): Ignore initializers for too large
2263         lengths.
2265 2018-01-26  Damian Rouson  <damian@sourceryinstitute.org>
2266             Alessandro Fanfarillo  <fanfarillo.gcc@gmail.com>
2267             Soren Rasmussen  <s.c.rasmussen@gmail.com>
2269         Partial support for Fortran 2018 teams features.
2271         * array.c (gfc_match_array_ref): add team attribute in coarray
2272         transfers.
2273         * check.c (gfc_check_get_team, gfc_check_team_number): add new
2274         functions for get_team and team_number.
2275         * dump-parse-tree.c (show_code_node): add new statements: form team,
2276         change team, end team, and sync team.
2277         * expr.c (gfc_find_team_co): add new function.
2278         * gfortran.h: add new statements.
2279         * intrinsic.c (add_functions): add get_team and team_number functions.
2280         * intrinsic.h: add get_team and team_number prototypes for check,
2281         simplify, and resolve.
2282         * iresolve.c (gfc_resolve_get_team, gfc_resolve_team_number): add new
2283         functions.
2284         * iso-fortran-env.def: add the team_type derived type.
2285         * match.c (gfc_match_if, gfc_match_form_team, gfc_match_team_number)
2286         (gfc_match_end_team, gfc_match_sync_team, gfc_match_change_team):
2287         add change team, end team, form team, sync team match and functions.
2288         * match.h: add new prototypes for change team, end team, form team,
2289         and sync team.
2290         * parse.c (decode_statement): add cases for change team, end team,
2291         form team, and sync team.
2292         * resolve.c: add cases for exec form team, change team, end team, and
2293         sync team.
2294         * simplify.c (gfc_simplify_get_team): add new function for get team.
2295         * st.c (gfc_free_statement): add cases exec for change team, end team,
2296         form team, sync team.
2297         * trans-decl.c (gfor_fndecl_caf_form_team)
2298         (gfor_fndecl_caf_change_team, gfor_fndecl_caf_end_team)
2299         (gfor_fndecl_caf_sync_team, gfor_fndecl_caf_get_team)
2300         (gfor_fndecl_caf_team_number): add functions and definitions.
2301         * trans-intrinsic.c (conv_caf_send, conv_intrinsic_team_number): add
2302         new function and team_type argument support.
2303         * trans-stmt.c (gfc_trans_form_team, gfc_trans_change_team)
2304         (gfc_trans_end_team, gfc_trans_sync_team): add new functions.
2305         * trans-stmt.h: add new prototypes.
2306         * trans-types.c (gfc_get_derived_type): check condition for team_type.
2307         * trans.c (trans_code): new exec cases for form team, change team, end
2308         team, and sync team.
2309         * trans.h: add new prototypes.
2311 2018-01-26  Steven G. Kargl  <kargl@gcc.gnu.org>
2313         PR fortran/83998
2314         * simplify.c (compute_dot_product):  Initialize result to INTEGER(1) 0
2315         or .false.  The summation does the correct type conversion.
2316         (gfc_simplify_dot_product): Special case zero-sized arrays.
2318 2018-25-01  Paul Thomas  <pault@gcc.gnu.org>
2320         PR fortran/37577
2321         * array.c (gfc_match_array_ref): If standard earlier than F2008
2322         it is an error if the reference dimension is greater than 7.
2323         libgfortran.h : Increase GFC_MAX_DIMENSIONS to 15. Change the
2324         dtype masks and shifts accordingly.
2325         * trans-array.c (gfc_conv_descriptor_dtype): Use the dtype
2326         type node to check the field.
2327         (gfc_conv_descriptor_dtype): Access the rank field of dtype.
2328         (duplicate_allocatable_coarray): Access the rank field of the
2329         dtype descriptor rather than the dtype itself.
2330         * trans-expr.c (get_scalar_to_descriptor_type): Store the type
2331         of 'scalar' on entry and use its TREE_TYPE if it is ARRAY_TYPE
2332         (ie. a character).
2333         (gfc_conv_procedure_call): Pass TREE_OPERAND (tmp,0) to
2334         get_scalar_to_descriptor_type if the actual expression is a
2335         constant.
2336         (gfc_trans_structure_assign): Assign the rank directly to the
2337         dtype rank field.
2338         * trans-intrinsic.c (gfc_conv_intrinsic_rank): Cast the result
2339         to default integer kind.
2340         (gfc_conv_intrinsic_sizeof): Obtain the element size from the
2341         'elem_len' field of the dtype.
2342         * trans-io.c (gfc_build_io_library_fndecls): Replace
2343         gfc_int4_type_node with dtype_type_node where necessary.
2344         (transfer_namelist_element): Use gfc_get_dtype_rank_type for
2345         scalars.
2346         * trans-types.c : Provide 'get_dtype_type_node' to acces the
2347         dtype_type_node and, if necessary, build it.
2348         The maximum size of an array element is now determined by the
2349         maximum value of size_t.
2350         Update the description of the array descriptor, including the
2351         type def for the dtype_type.
2352         (gfc_get_dtype_rank_type): Build a constructor for the dtype.
2353         Distinguish RECORD_TYPEs that are BT_DERIVED or BT_CLASS.
2354         (gfc_get_array_descriptor_base): Change the type of the dtype
2355         field to dtype_type_node.
2356         (gfc_get_array_descr_info): Get the offset to the rank field of
2357         the dtype.
2358         * trans-types.h : Add a prototype for 'get_dtype_type_node ()'.
2359         * trans.h : Define the indices of the dtype fields.
2361 2018-23-01  Paul Thomas  <pault@gcc.gnu.org>
2363         PR fortran/83866
2364         * decl.c (gfc_match_derived_decl): If eos not matched, recover
2365         and emit error about garbage after declaration.
2367 2018-23-01  Paul Thomas  <pault@gcc.gnu.org>
2369         PR fortran/83898
2370         * trans-stmt.c (trans_associate_var): Do not set cst_array_ctor
2371         for characters.
2373 2018-01-22  Janne Blomqvist  <jb@gcc.gnu.org>
2375         PR 78534
2376         PR 83704
2377         * arith.c (gfc_arith_concat): Use size_t for string length.
2378         (gfc_compare_string): Likewise.
2379         (gfc_compare_with_Cstring): Likewise.
2380         * array.c (gfc_resolve_character_array_constructor): Use
2381         HOST_WIDE_INT, gfc_mpz_get_hwi.
2382         * check.c (gfc_check_fe_runtime_error): Use size_t.
2383         * data.c (create_character_initializer): Use HOST_WIDE_INT,
2384         gfc_extract_hwi.
2385         * decl.c (gfc_set_constant_character_len): Use gfc_charlen_t.
2386         (add_init_expr_to_sym): Use HOST_WIDE_INT.
2387         * expr.c (gfc_build_init_expr): Use HOST_WIDE_INT,
2388         gfc_extract_hwi.
2389         (gfc_apply_init): Likewise.
2390         * match.h (gfc_set_constant_character_len): Update prototype.
2391         * primary.c (match_string_constant): Use size_t.
2392         * resolve.c (resolve_ordinary_assign): Use HOST_WIDE_INT,
2393         gfc_mpz_get_hwi.
2394         * simplify.c (init_result_expr): Likewise.
2395         (gfc_simplify_len_trim): Use size_t.
2396         * target-memory.c (gfc_encode_character): Use size_t.
2397         (gfc_target_encode_expr): Use HOST_WIDE_INT, gfc_mpz_get_hwi.
2398         (interpret_array): Use size_t.
2399         (gfc_interpret_character): Likewise.
2400         * target-memory.h (gfc_encode_character): Update prototype.
2401         (gfc_interpret_character): Likewise.
2402         (gfc_target_interpret_expr): Likewise.
2403         * trans-const.c (gfc_build_string_const): Use size_t for length
2404         argument.
2405         (gfc_build_wide_string_const): Likewise.
2406         * trans-const.h (gfc_build_string_const): Likewise.
2407         (gfc_build_wide_string_const): Likewise.
2409 2018-01-20  Steven G. Kargl  <kargl@gcc.gnu.org>
2411         PR fortran/83900
2412     * simplify.c (gfc_simplify_matmul): Set return type correctly.
2414 2018-01-19  Steven G. Kargl  <kargl@gcc.gnu.org>
2416         PR fortran/83900
2417         * simplify.c (gfc_simplify_matmul): Delete bogus assertion.
2419 2018-01-17  Harald Anlauf  <anlauf@gmx.de>
2421         PR fortran/83864
2422         * expr.c (add_init_expr_to_sym): Do not dereference NULL pointer.
2424 2018-01-17  Harald Anlauf  <anlauf@gmx.de>
2426         PR fortran/83874
2427         * decl.c (add_init_expr_to_sym): Do not dereference NULL pointer.
2429 2018-01-15  Louis Krupp  <louis.krupp@zoho.com>
2431         PR fortran/82257
2432         * interface.c (compare_rank): Don't try to retrieve CLASS_DATA
2433         from symbol marked unlimited polymorphic.
2434         * resolve.c (resolve_structure_cons): Likewise.
2435         * misc.c (gfc_typename): Don't dereference derived->components
2436         if it's NULL.
2438 2018-01-15  Thomas Koenig  <tkoenig@gcc.gnu.org>
2440         PR fortran/54613
2441         * gfortran.h (gfc_check_f): Rename f4ml to f5ml.
2442         (gfc_logical_4_kind): New macro
2443         * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument.
2444         (gfc_simplify_maxloc): Likewise.
2445         (gfc_resolve_maxloc): Likewise.
2446         (gfc_resolve_minloc): Likewise.
2447         * check.c (gfc_check_minloc_maxloc): Add checking for "back"
2448         argument; also raise error if it is used (for now). Add it
2449         if it isn't present.
2450         * intrinsic.c (add_sym_4ml): Rename to
2451         (add_sym_5ml), adjust for extra argument.
2452         (add_functions): Add "back" constant. Adjust maxloc and minloc
2453         for back argument.
2454         * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is
2455         not of gfc_logical_4_kind, convert.
2456         (gfc_resolve_minloc): Likewise.
2457         * simplify.c (gfc_simplify_minloc): Add back argument.
2458         (gfc_simplify_maxloc): Likewise.
2459         * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last
2460         argument to %VAL to ensure passing by value.
2461         (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc
2462         also for library calls.
2464 2018-01-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
2466         PR fortran/82007
2467         * resolve.c (resolve_transfer): Delete code looking for 'DT'
2468         format specifiers in format strings. Set formatted to true if a
2469         format string or format label is present.
2470         * trans-io.c (get_dtio_proc): Likewise. (transfer_expr): Fix
2471         whitespace.
2473 2018-01-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
2475         PR fortran/83744
2476         * dump-parse-tree.c (get_c_type_name): Remove extra line.
2477         Change for loop to use declaration in for loop. Handle BT_LOGICAL
2478         and BT_CHARACTER.
2479         (write_decl): Add where argument. Fix indentation. Replace
2480         assert with error message. Add typename to warning
2481         in comment.
2482         (write_type): Adjust locus to call of write_decl.
2483         (write_variable): Likewise.
2484         (write_proc): Likewise. Replace assert with error message.
2486 2018-01-13  Paul Thomas  <pault@gcc.gnu.org>
2488         PR fortran/52162
2489         * trans-expr.c (gfc_trans_scalar_assign): Flag is_alloc_lhs if
2490         the rhs expression is neither an elemental nor a conversion
2491         function.
2493         PR fortran/83622
2494         * trans-array.c (is_pointer_array): Remove unconditional return
2495         of false for -fopenmp.
2497 2018-01-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
2498         <emsr@gcc.gnu.org>
2500         PR fortran/83803
2501         * dump-parse-tree.c (write_proc): Always emit closing parenthesis
2502         for functions.
2504 2018-01-10  Steven G. Kargl  <kargl@gcc.gnu.org>
2506         PR fortran/82367
2507         * resolve.c (resolve_allocate_expr): Check for NULL pointer.
2509 2018-01-10  Steven G. Kargl  <kargl@gcc.gnu.org>
2511         PR fortran/83093
2512         * resolve.c (resolve_charlen): Check the type of cl->length
2513         after resolution.
2515 2018-01-10  Janne Blomqvist  <jb@gcc.gnu.org>
2517         PR fortran/83740
2518         * trans-array.c (gfc_trans_array_ctor_element): Fix formatting.
2520 2018-01-10  Janne Blomqvist  <jb@gcc.gnu.org>
2522         PR fortran/83740
2523         * trans-array.c (gfc_trans_array_ctor_element): Convert RHS to the
2524         LHS type when assigning.
2526 2018-01-09  Steven G. Kargl  <kargl@gcc.gnu.org>
2528         PR fortran/83742
2529         * expr.c (gfc_is_simply_contiguous): Check for NULL pointer.
2531 2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>
2533         * match.c (gfc_match_allocate): Check for NULL pointer.
2535 2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>
2537         * expr.c (gfc_check_pointer_assign): Fix typo in comment.
2539 2018-01-08  Paul Thomas  <pault@gcc.gnu.org>
2541         PR fortran/83611
2542         * decl.c (gfc_get_pdt_instance): If parameterized arrays have
2543         an initializer, convert the kind parameters and add to the
2544         component if the instance.
2545         * trans-array.c (structure_alloc_comps): Add 'is_pdt_type' and
2546         use it with case COPY_ALLOC_COMP. Call 'duplicate_allocatable'
2547         for parameterized arrays. Clean up typos in comments. Convert
2548         parameterized array initializers and copy into the array.
2549         * trans-expr.c (gfc_trans_scalar_assign): Do a deep copy for
2550         parameterized types.
2551         *trans-stmt.c (trans_associate_var): Deallocate associate vars
2552         as necessary, when they are PDT function results for example.
2554         PR fortran/83731
2555         * trans-array.c (structure_alloc_comps): Only compare len parms
2556         when they are declared explicitly.
2558 2018-01-06  Janne Blomqvist  <jb@gcc.gnu.org>
2560         PR fortran/50892
2561         * trans-expr.c (gfc_trans_pointer_assignment): fold_convert rhs to
2562         lhs type.
2564 2018-01-05  Janne Blomqvist  <jb@gcc.gnu.org>
2566         PR fortran/78534
2567         PR fortran/66310
2568         * array.c (got_charlen): Use gfc_charlen_int_kind.
2569         * class.c (gfc_find_derived_vtab): Use gfc_size_kind instead of
2570         hardcoded kind.
2571         (find_intrinsic_vtab): Likewise.
2572         * decl.c (match_char_length): Use gfc_charlen_int_kind.
2573         (add_init_expr_to_sym): Use gfc_charlen_t and gfc_charlen_int_kind.
2574         (gfc_match_implicit): Use gfc_charlen_int_kind.
2575         * dump-parse-tree.c (show_char_const): Use gfc_charlen_t and size_t.
2576         (show_expr): Use HOST_WIDE_INT_PRINT_DEC.
2577         * expr.c (gfc_get_character_expr): Length parameter of type
2578         gfc_charlen_t.
2579         (gfc_get_int_expr): Value argument of type HOST_WIDE_INT.
2580         (gfc_extract_hwi): New function.
2581         (simplify_const_ref): Make string_len of type gfc_charlen_t.
2582         (gfc_simplify_expr): Use HOST_WIDE_INT for substring refs.
2583         * frontend-passes.c (optimize_trim): Use gfc_charlen_int_kind.
2584         * gfortran.h (gfc_mpz_get_hwi): New prototype.
2585         (gfc_mpz_set_hwi): Likewise.
2586         (gfc_charlen_t): New typedef.
2587         (gfc_expr): Use gfc_charlen_t for character lengths.
2588         (gfc_size_kind): New extern variable.
2589         (gfc_extract_hwi): New prototype.
2590         (gfc_get_character_expr): Use gfc_charlen_t for character length.
2591         (gfc_get_int_expr): Use HOST_WIDE_INT type for value argument.
2592         * gfortran.texi: Update description of hidden string length argument.
2593         * iresolve.c (check_charlen_present): Use gfc_charlen_int_kind.
2594         (gfc_resolve_char_achar): Likewise.
2595         (gfc_resolve_repeat): Pass string length directly without
2596         temporary, use gfc_charlen_int_kind.
2597         (gfc_resolve_transfer): Use gfc_charlen_int_kind.
2598         * match.c (select_intrinsic_set_tmp): Use HOST_WIDE_INT for charlen.
2599         * misc.c (gfc_mpz_get_hwi): New function.
2600         (gfc_mpz_set_hwi): New function.
2601         * module.c (atom_int): Change type from int to HOST_WIDE_INT.
2602         (parse_integer): Don't complain about large integers.
2603         (write_atom): Use HOST_WIDE_INT for integers.
2604         (mio_integer): Handle integer type mismatch.
2605         (mio_hwi): New function.
2606         (mio_intrinsic_op): Use HOST_WIDE_INT.
2607         (mio_array_ref): Likewise.
2608         (mio_expr): Likewise.
2609         * primary.c (match_substring): Use gfc_charlen_int_kind.
2610         * resolve.c (resolve_substring_charlen): Use gfc_charlen_int_kind.
2611         (resolve_character_operator): Likewise.
2612         (resolve_assoc_var): Likewise.
2613         (resolve_select_type): Use HOST_WIDE_INT for charlen, use snprintf.
2614         (resolve_charlen): Use mpz_sgn to determine sign.
2615         * simplify.c (gfc_simplify_repeat): Use HOST_WIDE_INT/gfc_charlen_t
2616         instead of long.
2617         * symbol.c (generate_isocbinding_symbol): Use gfc_charlen_int_kind.
2618         * target-memory.c (size_character): Length argument of type
2619         gfc_charlen_t.
2620         (gfc_encode_character): Likewise.
2621         (gfc_interpret_character): Use gfc_charlen_t.
2622         * target-memory.h (gfc_encode_character): Modify prototype.
2623         * trans-array.c (gfc_trans_array_ctor_element): Use existing type.
2624         (get_array_ctor_var_strlen): Use gfc_conv_mpz_to_tree_type.
2625         (trans_array_constructor): Use existing type.
2626         (get_array_charlen): Likewise.
2627         * trans-const.c (gfc_conv_mpz_to_tree_type): New function.
2628         * trans-const.h (gfc_conv_mpz_to_tree_type): New prototype.
2629         * trans-decl.c (gfc_trans_deferred_vars): Use existing type.
2630         (add_argument_checking): Likewise.
2631         * trans-expr.c (gfc_class_len_or_zero_get): Build const of type
2632         gfc_charlen_type_node.
2633         (gfc_conv_intrinsic_to_class): Use gfc_charlen_int_kind instead of
2634         4, fold_convert to correct type.
2635         (gfc_conv_class_to_class): Build const of type size_type_node for
2636         size.
2637         (gfc_copy_class_to_class): Likewise.
2638         (gfc_conv_string_length): Use same type in expression.
2639         (gfc_conv_substring): Likewise, use HOST_WIDE_INT for charlen.
2640         (gfc_conv_string_tmp): Make sure len is of the right type.
2641         (gfc_conv_concat_op): Use same type in expression.
2642         (gfc_conv_procedure_call): Likewise.
2643         (fill_with_spaces): Comment out memset() block due to spurious
2644         -Wstringop-overflow warnings.
2645         (gfc_trans_string_copy): Use gfc_charlen_type_node.
2646         (alloc_scalar_allocatable_for_subcomponent_assignment):
2647         fold_convert to right type.
2648         (gfc_trans_subcomponent_assign): Likewise.
2649         (trans_class_vptr_len_assignment): Build const of correct type.
2650         (gfc_trans_pointer_assignment): Likewise.
2651         (alloc_scalar_allocatable_for_assignment): fold_convert to right
2652         type in expr.
2653         (trans_class_assignment): Build const of correct type.
2654         * trans-intrinsic.c (gfc_conv_associated): Likewise.
2655         (gfc_conv_intrinsic_repeat): Do calculation in sizetype.
2656         * trans-io.c (gfc_build_io_library_fndecls): Use
2657         gfc_charlen_type_node for character lengths.
2658         (set_string): Convert to right type in assignment.
2659         * trans-stmt.c (gfc_trans_label_assign): Build const of
2660         gfc_charlen_type_node.
2661         (trans_associate_var): Likewise.
2662         (gfc_trans_character_select): Likewise.
2663         (gfc_trans_allocate): Likewise, don't typecast strlen result.
2664         (gfc_trans_deallocate): Don't typecast strlen result.
2665         * trans-types.c (gfc_size_kind): New variable.
2666         (gfc_init_types): Determine gfc_charlen_int_kind and gfc_size_kind
2667         from size_type_node.
2668         * trans-types.h: Fix comment.
2670 2018-01-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
2672         PR fortran/83683
2673         PR fortran/45689
2674         * check.c (gfc_check_eoshift): Check for string length and
2675         for conformance of boundary.
2676         * intrinsic.c (add_functions): Add gfc_simplify_eoshift.
2677         * intrinsic.h: Add prototype for gfc_simplify_eoshift.
2678         * simplify.c (gfc_simplify_eoshift): New function.
2680 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2681             Alan Hayward  <alan.hayward@arm.com>
2682             David Sherwood  <david.sherwood@arm.com>
2684         * trans-types.c (gfc_type_for_mode): Handle MODE_VECTOR_BOOL.
2686 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2687             Alan Hayward  <alan.hayward@arm.com>
2688             David Sherwood  <david.sherwood@arm.com>
2690         * trans-types.c (gfc_type_for_mode): Check valid_vector_subparts_p.
2692 2018-01-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
2694         PR fortran/83664
2695         * check.c (gfc_check_eoshift): Error for missing boundary if array
2696         is not one of the standard types.
2698 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
2700         Update copyright years.
2702         * gfortranspec.c (lang_specific_driver): Update copyright notice
2703         dates.
2704         * gfc-internals.texi: Bump @copying's copyright year.
2705         * gfortran.texi: Ditto.
2706         * intrinsic.texi: Ditto.
2707         * invoke.texi: Ditto.
2709 2017-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
2711         PR fortran/45689
2712         * intrinsic.c (add_function): Add gfc_simplify_maxloc and
2713         gfc_simplify_minloc to maxloc and minloc, respectively.
2714         * intrinsic.h: Add prototypes for gfc_simplify_minloc
2715         and gfc_simplify_maxloc.
2716         * simplify.c (min_max_chose): Adjust prototype.  Modify function
2717         to have a return value which indicates if the extremum was found.
2718         (is_constant_array_expr): Fix typo in comment.
2719         (simplify_minmaxloc_to_scalar): New function.
2720         (simplify_minmaxloc_nodim): New function.
2721         (new_array): New function.
2722         (simplify_minmaxloc_to_array): New function.
2723         (gfc_simplify_minmaxloc): New function.
2724         (simplify_minloc): New function.
2725         (simplify_maxloc): New function.
2727 2018-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
2729         PR fortran/45689
2730         PR fortran/83650
2731         * simplify.c (gfc_simplify_cshift): Re-implement to allow full
2732         range of arguments.
2734 2018-01-01  Paul Thomas  <pault@gcc.gnu.org>
2736         PR fortran/83076
2737         * resolve.c (resolve_fl_derived0): Add caf_token fields for
2738         allocatable and pointer scalars, when -fcoarray selected.
2739         * trans-types.c (gfc_copy_dt_decls_ifequal): Copy the token
2740         field as well as the backend_decl.
2741         (gfc_get_derived_type): Flag GFC_FCOARRAY_LIB for module
2742         derived types that are not vtypes. Components with caf_token
2743         attribute are pvoid types. For a component requiring it, find
2744         the caf_token field and have the component token field point to
2745         its backend_decl.
2747         PR fortran/83319
2748         *trans-types.c (gfc_get_array_descriptor_base): Add the token
2749         field to the descriptor even when codimen not set.
2751 Copyright (C) 2018 Free Software Foundation, Inc.
2753 Copying and distribution of this file, with or without modification,
2754 are permitted in any medium without royalty provided the copyright
2755 notice and this notice are preserved.
2757         PR fortran/87945
2758         * decl.c (var_element): Inquiry parameters cannit be data objects.
2760 2018-12-08  Steven G. Kargl  <kargl@gcc.gnu.org>
2762         PR fortran/88025
2763         * expr.c (gfc_apply_init):  Remove asserts that cannot trigger.
2764         Check for a NULL pointer.
2766 2018-12-08  Steven G. Kargl  <kargl@gcc.gnu.org>
2768         PR fortran/88357
2769         * class.c (insert_component_ref): Check for NULL pointer and 
2770         previous error message issued.
2771         * parse.c (parse_associate): Check for NULL pointer.
2772         * resolve.c (resolve_assoc_var): Check for NULL pointer.
2774 2018-12-07  Jakub Jelinek  <jakub@redhat.com>
2776         PR fortran/88377
2777         * trans-openmp.c (gfc_omp_clause_default_ctor,
2778         gfc_omp_clause_copy_ctor, gfc_omp_clause_assign_op,
2779         gfc_omp_clause_linear_ctor, gfc_omp_clause_dtor): Only consider
2780         GFC_DECL_GET_SCALAR_ALLOCATABLE vars as scalar allocatables if they
2781         have pointer type.
2783 2018-12-03  Fritz Reese  <fritzoreese@gmail.com>
2784             Mark Eggleston  <mark.eggleston@codethink.co.uk>
2786         PR fortran/87919
2787         * options.c (SET_FLAG, SET_BITFLAG, SET_BITFLAG2): New macros.
2788         (set_dec_flags): Set/unset DEC and std flags according to value.
2789         (post_dec_flags, set_init_local_zero): New functions.
2790         (gfc_init_options): Use set_init_local_zero and post_dec_flags.
2791         (gfc_handle_options) <case OPT_fcheck_array_temporaries>: Use
2792         SET_BITFLAG.
2793         <case OPT_finit_local_zero>: Use set_init_local_zero.
2794         <case OPT_fdec>: Pass value to set_dec_flags.
2795         <case OPT_fdec_structure>: Remove.
2797 2018-11-30  Thomas Schwinge  <thomas@codesourcery.com>
2799         * gfortran.h (struct gfc_omp_clauses): Remove "wait".  Adjust all
2800         users.
2802         * openmp.c (gfc_match_omp_clauses): Support multiple OpenACC wait
2803         clauses.
2805 2018-11-27  Martin Liska  <mliska@suse.cz>
2807         * decl.c (gfc_match_gcc_builtin): New function.
2808         * gfortran.h (struct vect_builtin_tuple): New.
2809         (gfc_adjust_builtins): Likewise.
2810         * lang-specs.h (TARGET_F951_OPTIONS): New.
2811         (F951_OPTIONS): Use it.
2812         * lang.opt: Add new option -fpre-include.
2813         * match.h (gfc_match_gcc_builtin): Declare new function.
2814         * parse.c (decode_gcc_attribute): Handle builtin.
2815         (parse_progunit): Call gfc_adjust_builtins.
2816         * scanner.c (gfc_new_file): Load pre-included header file
2817         when provided.
2818         * trans-intrinsic.c (add_simd_flag_for_built_in): New.
2819         (gfc_adjust_builtins): Likewise.
2821 2018-11-24  Paul Thomas  <pault@gcc.gnu.org>
2823         PR fortran/88143
2824         * resolve.c (resolve_variable): Check for associate names with
2825         NULL target.
2827 2018-11-23  Jakub Jelinek  <jakub@redhat.com>
2829         * lang.opt (fpad-source): New option.
2830         * scanner.c (load_line): Don't pad fixed form lines if
2831         !flag_pad_source.
2832         * invoke.texi (-fno-pad-source): Document.
2834 2018-11-21  Jakub Jelinek  <jakub@redhat.com>
2836         * invoke.texi (-fdec-include): Document.
2838 2018-11-21  Jakub Jelinek  <jakub@redhat.com>
2839             Mark Eggleston  <mark.eggleston@codethink.com>
2841         * lang.opt (fdec-include): New option.
2842         * options.c (set_dec_flags): Set also flag_dec_include.
2843         * scanner.c (include_line): Change return type from bool to int.
2844         In fixed form allow spaces in between include keyword letters.
2845         For -fdec-include, allow in fixed form 0 in column 6.  With
2846         -fdec-include return -1 if the parsed line is not full include
2847         statement and it could be successfully completed on continuation
2848         lines.
2849         (include_stmt): New function.
2850         (load_file): Adjust include_line caller.  If it returns -1, keep
2851         trying include_stmt until it stops returning -1 whenever adding
2852         further line of input.
2854 2018-11-18  Thomas Koenig  <tkoenig@gcc.gnu.org>
2856         PR fortran/88073
2857         * frontend-passes.c (combine_array_constructor): Do not do
2858         anything if in a WHERE statement.
2860 2018-11-18  Thomas Koenig  <tkoenig@gcc.gnu.org>
2862         PR fortran/70260
2863         * expr.c (gfc_check_assign): Reject assigning to an external
2864         symbol.
2865         (gfc_check_pointer_assign): Add suppress_type_test
2866         argument. Insert line after if. A non-proc pointer can not point
2867         to a constant.  Only check types if suppress_type_test is false.
2868         * gfortran.h (gfc_check_pointer_assign): Add optional
2869         suppress_type_test argument.
2870         * resolve.c (gfc_resolve_code):  Move up gfc_check_pointer_assign
2871         and give it the extra argument.
2872         (resolve_fl_procedure): Set error on value for a function with
2873         an inizializer.
2875 2018-11-15  David Malcolm  <dmalcolm@redhat.com>
2877         PR other/19165
2878         * error.c (gfc_diagnostic_finalizer): Add diagnostic_t param.
2880 2018-11-13  David Malcolm  <dmalcolm@redhat.com>
2882         * cpp.c: Replace "source_location" with "location_t".
2883         * gfortran.h: Likewise.
2885 2018-11-08  Jakub Jelinek  <jakub@redhat.com>
2887         * trans-openmp.c (gfc_trans_omp_clauses): Use
2888         OMP_CLAUSE_DEFAULTMAP_SET_KIND.
2889         (gfc_trans_omp_atomic): Set OMP_ATOMIC_MEMORY_ORDER
2890         rather than OMP_ATOMIC_SEQ_CST.
2891         (gfc_trans_omp_taskgroup): Build OMP_TASKGROUP using
2892         make_node instead of build1_loc.
2893         * types.def (BT_FN_VOID_BOOL, BT_FN_VOID_SIZE_SIZE_PTR,
2894         BT_FN_UINT_UINT_PTR_PTR, BT_FN_UINT_OMPFN_PTR_UINT_UINT,
2895         BT_FN_BOOL_UINT_LONGPTR_LONG_LONG_LONGPTR_LONGPTR_PTR_PTR,
2896         BT_FN_BOOL_UINT_ULLPTR_LONG_ULL_ULLPTR_ULLPTR_PTR_PTR,
2897         BT_FN_BOOL_LONG_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR_PTR_PTR,
2898         BT_FN_BOOL_BOOL_ULL_ULL_ULL_LONG_ULL_ULLPTR_ULLPTR_PTR_PTR): New.
2899         (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_PTR): Formatting fix.
2901 2018-11-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
2903         PR fortran/46020
2904         * decl.c (verify_bind_c_sym): Remove unnecessary space
2905         in error message.
2907 2018-11-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
2909         PR fortran/87782
2910         * frontend-passes.c (constant_string_length): If there is a
2911         substring with a length which cannot be reduced to a constant,
2912         return NULL.
2914 2018-11-01  Paul Thomas  <pault@gcc.gnu.org>
2916         PR fortran/40196
2917         * dependency.c (are_identical_variables): Return false if the
2918         inquiry refs are not the same.
2919         (gfc_ref_needs_temporary_p): Break on an inquiry ref.
2920         * dump_parse_tree.c (show_ref): Show the inquiry ref type.
2921         * expr.c (gfc_free_ref_list): Break on an inquiry ref.
2922         (gfc_copy_ref): Copy the inquiry ref types.
2923         (find_inquiry_ref): New function.
2924         (simplify_const_ref, simplify_ref_chain): Call it. Add new arg
2925         to simplify_ref_chain.
2926         (gfc_simplify_expr): Use the new arg in call to
2927         simplify_ref_chain.
2928         (gfc_get_full_arrayspec_from_expr, gfc_is_coarray): Break on
2929         inquiry ref.
2930         (gfc_traverse_expr): Return true for inquiry ref.
2931         * frontend-passes.c (gfc_expr_walker): Break on inquiry ref.
2932         * gfortran.h : Add enums and union member in gfc_ref to
2933         implement inquiry refs.
2934         * intrinsic.c : Fix white nois.
2935         * match.c (gfc_match_assignment): A constant lavlue is an
2936         error.
2937         * module.c : Add DECL_MIO_NAME for inquiry_type and the mstring
2938         for inquiry_types.
2939         (mio_ref): Handle inquiry refs.
2940         * primary.c (is_inquiry_ref): New function.
2941         (gfc_match_varspec): Handle inquiry refs calling new function.
2942         (gfc_variable_attr): Detect inquiry ref for disambiguation
2943         with components.
2944         (caf_variable_attr): Treat inquiry and substring refs in the
2945         same way.
2946         * resolve.c (find_array_spec): ditto.
2947         (gfc_resolve_substring_charlen): If there is neither a charlen
2948         ref not an inquiry ref, return.
2949         (resolve_ref): Handle inqiry refs as appropriate.
2950         (resolve_allocate_expr): Entities with an inquiry ref cannot be
2951         allocated.
2952         * simplify.c (simplify_bound, simplify_cobound): Punt on
2953         inquiry refs.
2954         * trans-array.c (get_array_ctor_var_strlen): Break on inquiry
2955         ref.
2956         *trans-expr.c (conv_inquiry): New function.
2957         (gfc_conv_variable): Retain the last typespec to pass to
2958         conv_inquiry on detecting an inquiry ref.
2960 2018-11-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
2962         PR fortran/46020
2963         * decl.c (verify_bind_c_sym): Improve error message.
2965 2018-11-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
2967         PR fortran/54613
2968         * gfortran.texi (File format of unformatted sequential files):
2969         Replace random comma with period.
2970         * intrinsic.texi (Intrinsic Procedures): Add FINDLOC to menu.
2971         (FINDLOC): Document.
2972         (MAXLOC): Add refrence to FINDLOC.
2973         (MINLOC): Likewise.
2975 2018-10-31  Nathan Sidwell  <nathan@acm.org>
2977         * cpp.c (gfc_cpp_init): Adjust cpp_force_token_locations call.
2979 2018-10-31  Martin Liska  <mliska@suse.cz>
2981         * trans-decl.c (struct module_hasher): Call htab_hash_string
2982         for s->name and not for s.
2984 2018-10-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
2986         PR fortran/85896
2987         * simplify.c (simplify_min_max): Do not convert the type of the
2988         return expression.
2990 2017-10-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
2992         PR fortran/54613
2993         * gfortran.h (gfc_isym_id): Add GFC_ISYM_FINDLOC.
2994         (gfc_check_f): Add f6fl field.
2995         (gfc_simplify_f): Add f6 field.
2996         (gfc_resolve_f): Likewise.
2997         (gfc_type_letter): Add optional logical_equas_int flag.
2998         * check.c (intrinsic_type_check): New function.
2999         (gfc_check_findloc): New function.
3000         * intrinsics.c (gfc_type_letter): If logical_equals_int is
3001         set, act accordingly.
3002         (add_sym_5ml):  Reformat comment.
3003         (add_sym_6fl): New function.
3004         (add_functions): Add findloc.
3005         (check_arglist): Add sixth argument, handle it.
3006         (resolve_intrinsic): Likewise.
3007         (check_specific): Handle findloc.
3008         * intrinsic.h (gfc_check_findloc): Add prototype.
3009         (gfc_simplify_findloc): Likewise.
3010         (gfc_resolve_findloc): Likewise.
3011         (MAX_INTRINSIC_ARGS): Adjust.
3012         * iresolve.c (gfc_resolve_findloc): New function.
3013         * simplify.c (gfc_simplify_minmaxloc): Make static.
3014         (simplify_findloc_to_scalar): New function.
3015         (simplify_findloc_nodim): New function.
3016         (simplify_findloc_to_array): New function.
3017         (gfc_simplify_findloc): New function.
3018         (gfc_conv_intrinsic_findloc): New function.
3019         (gfc_conv_intrinsic_function): Handle GFC_ISYM_FINDLOC.
3020         (gfc_is_intrinsic_libcall): Likewise.
3022 2018-10-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
3024         PR fortran/86907
3025         * frontend-passes.c (check_locus_code): Add information that
3026         warning about missing location information points to an
3027         inconsisten internal state.
3028         (check_locus_expr): Likewise.
3030 2018-10-25  Jakub Jelinek  <jakub@redhat.com>
3032         PR fortran/87725
3033         * openmp.c (gfc_match_omp_clauses): Parse simd, monotonic and
3034         nonmonotonic modifiers regardless of if they have been parsed
3035         already or if the opposite one has.  Fix up check whether
3036         comma after modifier should be parsed.
3037         (resolve_omp_clauses): Diagnose schedule modifier restrictions.
3039 2018-10-23  Paul Thomas  <pault@gcc.gnu.org>
3041         PR fortran/85603
3042         * frontend-passes.c (get_len_call): New function to generate a
3043         call to intrinsic LEN.
3044         (create_var): Use this to make length expressions for variable
3045         rhs string lengths.
3046         Clean up some white space issues.
3048 2018-10-21  Paul Thomas  <pault@gcc.gnu.org>
3050         PR fortran/71880
3051         * trans-expr.c (gfc_trans_pointer_assignment): Set the string
3052         length for array valued deferred length lhs.
3054 2018-10-18  Tobias Burnus  <burnus@net-b.de>
3056         PR fortran/87625
3057         * trans-array.c (gfc_is_reallocatable_lhs): Detect allocatable
3058         polymorphic arrays.
3060 2018-10-18  Paul Thomas  <pault@gcc.gnu.org>
3062         PR fortran/58618
3063         * trans-stmt.c (trans_associate_var): All strings that return
3064         as pointer types can be assigned directly to the associate
3065         name so remove 'attr' and the condition that uses it.
3067 2018-10-18  Paul Thomas  <pault@gcc.gnu.org>
3069         PR fortran/58618
3070         * trans-decl.c (gfc_get_symbol_decl): Deal correctly with the
3071         initialization with NULL() of a deferred length pointer.
3073 2018-10-17  Tobias Burnus  <burnus@net-b.de>
3075         PR fortran/87632
3076         * resolve.c (resolve_select_type): Use correct variable.
3078 2018-10-17  David Malcolm  <dmalcolm@redhat.com>
3080         * Make-lang.in (selftest-fortran): New.
3082 2018-10-17  Paul Thomas  <pault@gcc.gnu.org>
3084         PR fortran/56386
3085         PR fortran/58906
3086         PR fortran/77385
3087         PR fortran/80260
3088         PR fortran/82077
3089         * resolve.c (resolve_variable): Fix up expressions with array
3090         associate names, where the parser did not detect that this is
3091         array and there was no array part_ref in the expression.
3093 2018-10-16  Tobias Burnus  <burnus@net-b.de>
3095         PR fortran/67125
3096         * trans-array.c (gfc_array_init_size, gfc_array_allocate):
3097         Rename argument e3_is_array_constr to e3_has_nodescriptor
3098         and update comments.
3099         * trans-stmt.c (gfc_trans_allocate): Also fix lower bound
3100         to 1 for nonalloc/nonpointer func results/vars besides
3101         array constructors.
3103 2018-10-16  Tobias Burnus  <burnus@net-b.de>
3105         PR fortran/87556
3106         * trans-stmt.c (form_team, change_team, sync_team):
3107         Don't ignore argse.pre/argse.post.
3109 2018-10-15  Paul Thomas  <pault@gcc.gnu.org>
3110         Tobias Burnus  <burnus@gcc.gnu.org>
3112         PR fortran/87566
3113         * resolve.c (resolve_assoc_var): Add missing array spec for
3114         class associate names.
3115         (resolve_select_type): Handle case where last typed component
3116         of the selector has a different type to the expression.
3117         * trans-expr.c (gfc_find_and_cut_at_last_class_ref): Replace
3118         call to gfc_expr_to_initialize with call to gfc_copy_expr.
3119         (gfc_conv_class_to_class): Guard assignment to 'len' field
3120         against case where zero constant is supplied.
3122 2018-10-12  Tobias Burnus  <burnus@net-b.de>
3124         PR fortran/87597
3125         * expr.c (gfc_simplify_expr): Avoid simplifying
3126         the 'array' argument to lbound/ubound/lcobound/
3127         ucobound.
3129 2018-10-12  Tobias Burnus <burnus@net-b.de>
3131         PR fortran/58787
3132         * decl.c (get_proc_name): Return with error before
3133         creating sym_tree.
3135 2018-10-11  Tobias Burnus <burnus@net-b.de>
3137         Revert:
3138         2018-10-09  Tobias Burnus <burnus@net-b.de>
3140         PR fortran/83522
3141         * resolve.c (resolve_ref): Reject nonscalar
3142         substring references.
3144 2018-10-09  David Malcolm  <dmalcolm@redhat.com>
3146         * cpp.c (gfc_cpp_init_0): Update for renamings.
3147         (cb_cpp_error): Rename to...
3148         (cb_cpp_diagnostic): ...this, converting level and reason to
3149         enums.
3151 2018-10-09  Tobias Burnus <burnus@net-b.de>
3153         PR fortran/83522
3154         * resolve.c (resolve_ref): Reject nonscalar
3155         substring references.
3157 2018-10-09  Paul Thomas  <pault@gcc.gnu.org>
3159         PR fortran/87151
3160         * trans-array.c (gfc_get_array_span): Deal with deferred char
3161         array components having a TYPE_MAX_VALUE of zero.
3162         (gfc_array_init_size): Use the hidden string length component
3163         to build the descriptor dtype.
3164         (gfc_array_allocate): Remove the erroneous replacement of the
3165         charlen backend decl with a temporary.
3166         (gfc_conv_expr_descriptor): Use the ss_info string length in
3167         the case of deferred character components.
3168         (gfc_alloc_allocatable_for_assignment): Actually compare the
3169         string lengths for deferred characters. Make sure that kind > 1
3170         is handled correctly. Set the span field of the descriptor.
3171         * trans-intrinsic.c (gfc_conv_intrinsic_len): Remove the stupid
3172         comment.
3174         PR fortran/80931
3175         * trans-array.c (gfc_array_allocate): Set the span field for
3176         variable length character arrays.
3178 2018-10-08  Cesar Philippidis  <cesar@codesourcery.com>
3180         * expr.c (gfc_check_pointer_assign): Demote "Assignment to
3181         contiguous pointer from non-contiguous target" to a warning.
3183 2018-10-08  Paul Thomas  <pault@gcc.gnu.org>
3185         PR fortran/86372
3186         * trans-stmt.c (trans_associate_var): Character associate names
3187         with variable string length do not have to be deferred length
3188         for the string length to be set, if variable.
3190 2018-10-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
3192         PR fortran/86111
3193         * gfortran.h (enum arith): Add ARITH_WRONGCONCAT.
3194         * arith.h (gfc_arith_error): Issue error for ARITH_WRONGCONCAT.
3195         (gfc_arith_concat):  If the types of op1 and op2 are not
3196         character of if their kinds do not match, issue ARITH_WRONGCONCAT.
3198 2018-10-06  Paul Thomas  <pault@gcc.gnu.org>
3200         PR fortran/83999
3201         * resolve.c (resolve_fl_procedure): Include class functions in
3202         the test that elemental function results be scalar.
3204 2018-10-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
3206         PR fortran/84640
3207         * simplify.c (gfc_simplify_cshift): Extend size of hs_ex and ss_ex
3208         by one. Set extents one past the array boundaries to zero to avoid
3209         warning with instrumented compiler.
3210         (gfc_simplify_eoshift): Likewise, only for ss_ex.
3212 2018-10-05  Paul Thomas  <pault@gcc.gnu.org>
3214         PR fortran/87487
3215         * trans-decl.c (gfc_get_symbol_decl): Make sure that deferred
3216         character length pointer initializer has the right type to fix
3217         problem with deferred_character_24.f90 on big endian.
3219 2018-10-03  Jeff Law  <law@redhat.comg>
3221         * trans-types.c (get_typenode_from_name): Moved into gcc/tree.c.
3223 2018-10-01  Paul Thomas  <pault@gcc.gnu.org>
3225         PR fortran/65677
3226         * trans-expr.c (gfc_trans_assignment_1): Set the 'identical'
3227         flag in the call to gfc_check_dependency.
3229 2018-09-30  Paul Thomas  <pault@gcc.gnu.org>
3231         PR fortran/87359
3232         * trans-array.c (gfc_is_reallocatable_lhs): Correct the problem
3233         introduced by r264358, which prevented components of associate
3234         names from being reallocated on assignment.
3236 2018-09-30  Paul Thomas  <pault@gcc.gnu.org>
3238         PR fortran/70752
3239         PR fortran/72709
3240         * trans-array.c (gfc_conv_scalarized_array_ref): If this is a
3241         deferred type and the info->descriptor is present, use the
3242         info->descriptor
3243         (gfc_conv_array_ref): Is the se expr is a descriptor type, pass
3244         it as 'decl' rather than the symbol backend_decl.
3245         (gfc_array_allocate): If the se string_length is a component
3246         reference, fix it and use it for the expression string length
3247         if the latter is not a variable type. If it is a variable do
3248         an assignment. Make use of component ref string lengths to set
3249         the descriptor 'span'.
3250         (gfc_conv_expr_descriptor): For pointer assignment, do not set
3251         the span field if gfc_get_array_span returns zero.
3252         * trans.c (get_array_span): If the upper bound a character type
3253         is zero, use the descriptor span if available.
3255 2018-09-30  Paul Thomas  <pault@gcc.gnu.org>
3257         PR fortran/70149
3258         * trans-decl.c (gfc_get_symbol_decl): A deferred character
3259         length pointer that is initialized needs the string length to
3260         be initialized as well.
3262 2018-09-29  Paul Thomas  <pault@gcc.gnu.org>
3264         PR fortran/65677
3265         * trans-expr.c (gfc_trans_assignment_1): If there is dependency
3266         fix the rse stringlength.
3268 2018-09-25  Martin Liska  <mliska@suse.cz>
3270         PR fortran/87394
3271         * decl.c (add_hidden_procptr_result): Simplify condition
3272         as we are in branch witch 'case1 || case2'.
3274 2018-09-25  Martin Liska  <mliska@suse.cz>
3276         * trans.c (remove_suffix): Remove
3277         unused function.
3279 2018-09-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
3281         PR fortran/87397
3282         * gfc_conv_procedure_call: Do not add clobber on INTENT(OUT)
3283         for variables in an associate statement.
3285 2018-09-24  Bernhard Reuther-Fischer  <aldot@gcc.gnu.org>
3286             Cesar Philippidis  <cesar@codesourcery.com>
3288         * openmp.c (resolve_oacc_loop_blocks):
3290 2018-09-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
3292         PR fortran/87397
3293         * gfc_conv_procedure_call: Do not add clobber on INTENT(OUT)
3294         for variables having the dimension attribute.
3296 2018-09-23  Janne Blomqvist  <jb@gcc.gnu.org>
3298         * trans-expr.c (gfc_caf_get_image_index): Do array index
3299         calculations in gfc_array_index_type.
3300         * trans-intrinsic.c (conv_intrinsic_event_query): Likewise.
3301         * trans-stmt.c (gfc_trans_lock_unlock): Likewise.
3302         (gfc_trans_event_post_wait): Likewise.
3304 2018-09-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
3306         PR fortran/87395
3307         * gfc_conv_procedure_call: Reformat comments slightly. Do not add
3308         clobber on INTENT(OUT) for saved variables.
3310 2018-09-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
3312         PR fortran/41453
3313         * trans.h (gfc_conv_expr_reference): Add optional argument
3314         add_clobber to prototype.
3315         (gfc_conv_procedure_call):  Set add_clobber argument to
3316         gfc_conv_procedure_reference to true for scalar, INTENT(OUT),
3317         non-pointer, non-allocatable, non-dummy variables whose type
3318         is neither BT_CHARACTER, BT_DERIVED or BT_CLASS, but only if
3319         the procedure is not elemental.
3320         * trans-expr.c (gfc_conv_procedure_reference): Add clobber
3321         statement before call if add_clobber is set.
3323 2018-09-22  Paul Thomas  <pault@gcc.gnu.org>
3325         PR fortran/85603
3326         * trans-array.c (gfc_alloc_allocatable_for_assignment): Test
3327         the charlen backend_decl before using the VAR_P macro.
3329 2018-09-21  Paul Thomas  <pault@gcc.gnu.org>
3331         PR fortran/77325
3332         * trans-array.c (gfc_alloc_allocatable_for_assignment): If the
3333         rhs has a charlen expression, convert that and use it.
3334         * trans-expr.c (gfc_trans_assignment_1): The rse.pre for the
3335         assignment of deferred character array vars to a realocatable
3336         lhs should not be added to the exterior block since vector
3337         indices, for example, generate temporaries indexed within the
3338         loop.
3340 2018-09-21  Paul Thomas  <pault@gcc.gnu.org>
3342         PR fortran/87359
3343         * trans-stmt.c (gfc_trans_allocate): Don't deallocate alloc
3344         components if must_finalize is set for expr3.
3346 2018-09-21  Andrew Stubbs  <ams@codesourcery.com>
3347             Kwok Cheung Yeung  <kcy@codesourcery.com>
3349         * trans-expr.c (gfc_trans_structure_assign): Ensure that the first
3350         argument of a call to _gfortran_caf_register is of size_type_node.
3351         * trans-intrinsic.c (conv_intrinsic_event_query): Convert computed
3352         index to a size_type_node type.
3353         * trans-stmt.c (gfc_trans_event_post_wait): Likewise.
3355 2018-09-20  Allan Sandfeld Jensen  <allan.jensen@qt.io>
3357         * gfortranspec.c (lang_specific_driver): Handle -r like -nostdlib.
3359 2018-09-20  Janus Weil  <janus@gcc.gnu.org>
3361         * gfortran.h (gfc_str_startswith): New macro.
3362         * decl.c (variable_decl, gfc_match_end): Use it.
3363         * iresolve.c (is_trig_resolved): Ditto.
3364         * module.c (load_omp_udrs, read_module): Ditto.
3365         * options.c (gfc_handle_runtime_check_option): Ditto.
3366         * primary.c (match_arg_list_function): Ditto.
3367         * trans-decl.c (gfc_get_symbol_decl): Ditto.
3368         * trans-expr.c (gfc_conv_procedure_call): Ditto.
3369         * interface.c (dtio_op): Replace strncmp by strcmp.
3370         * resolve.c (resolve_actual_arglist, resolve_function): Ditto.
3371         * trans-expr.c (conv_arglist_function): Ditto.
3372         * trans-intrinsic.c (gfc_conv_ieee_arithmetic_function): Replace macro
3373         STARTS_WITH by gfc_str_startswith.
3375 2018-09-20  Cesar Philippidis  <cesar@codesourcery.com>
3377         * dump-parse-tree.c (show_omp_clauses): Add missing omp list_types
3378         and reorder the switch cases to match the enum in gfortran.h.
3380 2018-09-19  Paul Thomas  <pault@gcc.gnu.org>
3382         PR fortran/84109
3383         * trans-expr.c (gfc_trans_assignment_1): The rse.pre for the
3384         assignment of deferred character intrinsic elemental function
3385         results to a realocatable lhs must not be added to the exterior
3386         block if they are array valued but must go to the loop body.
3388 2018-09-18  Thomas Koenig  <tkoenig@gcc.gnu.org>
3390         PR fortran/29550
3391         * gfortran.h (gfc_expr): Add external_blas flag.
3392         * frontend-passes.c (matrix_case): Add case A2TB2T.
3393         (optimize_namespace): Handle flag_external_blas by
3394         calling call_external_blas.
3395         (get_array_inq_function): Add argument okind. If
3396         it is nonzero, use it as the kind of argument
3397         to be used.
3398         (inline_limit_check): Remove m_case argument, add
3399         limit argument instead.  Remove assert about m_case.
3400         Set the limit for inlining from the limit argument.
3401         (matmul_lhs_realloc): Handle case A2TB2T.
3402         (inline_matmul_assign): Handle inline limit for other cases with
3403         two rank-two matrices.  Remove no-op calls to inline_limit_check.
3404         (call_external_blas): New function.
3405         * trans-intrinsic.c (gfc_conv_intrinsic_funcall): Do not add
3406         argument to external BLAS if external_blas is already set.
3408 2018-09-18  Paul Thomas  <pault@gcc.gnu.org>
3410         PR fortran/87239
3411         * trans-expr.c (gfc_trans_assignment_1): The rse.pre for the
3412         assignment of deferred character elemental function results to
3413         a realocatable lhs must not be added to the exterior block but
3414         must go to the loop body.
3416 2018-09-18  Paul Thomas  <pault@gcc.gnu.org>
3418         PR fortran/87336
3419         * trans-array.c (gfc_get_array_span): Try to get the element
3420         length of incomplete types. Return NULL_TREE otherwise.
3421         (gfc_conv_expr_descriptor): Only set the 'span' field if the
3422         above does not return NULL_TREE. Set 'span' field if possible
3423         for all new descriptors.
3425 2018-09-17  Paul Thomas  <pault@gcc.gnu.org>
3427         PR fortran/64120
3428         * trans-decl.c (gfc_get_symbol_decl): Flag allocatable, scalar
3429         characters with a variable length expression for deferred init.
3430         (gfc_trans_deferred_vars): Perform the assignment for these
3431         symbols by calling gfc_conv_string_length.
3433 2018-09-17  Paul Thomas  <pault@gcc.gnu.org>
3435         PR fortran/85954
3436         * resolve.c (resolve_assoc_var): If the target expression is a
3437         deferred charlen dummy and the associate name shares the
3438         charlen, generate a new one. Make sure that new charlens are in
3439         the namespace list so that they get cleaned up.
3440         * trans-array.c (gfc_is_reallocatable_lhs): Associate names are
3441         not reallocatable.
3442         * trans-decl.c (gfc_get_symbol_decl): Put deferred character
3443         length dummy and result arrays on the deferred initialization
3444         list so that the variable length arrays can be correctly dealt
3445         with.
3446         * trans-expr.c (gfc_conv_string_length): Return if 'expr' is
3447         NULL rather than ICEing..
3449 2018-09-16  Janus Weil  <janus@gcc.gnu.org>
3451         PR fortran/86484
3452         PR fortran/84543
3453         * match.c (gfc_match_assignment): For a polymorphic assignment,
3454         make sure that the vtab for the rhs type is generated.
3456 2018-09-16  Thomas Koenig  <tkoenig@gcc.gnu.org>
3458         PR fortran/37802
3459         * frontend-passes.c (B_ERROR): New macro for matmul bounds
3460         checking error messages.
3461         (C_ERROR): Likewise.
3462         (inline_matmul_assign): Reorganize bounds checking, use B_ERROR
3463         and C_ERROR macros.
3465 2018-09-13  Bernd Edlinger  <bernd.edlinger@hotmail.de>
3467         * trans-array.c (gfc_conv_array_initializer): Remove excess precision
3468         from overlength string initializers.
3470 2018-09-12  Paul Thomas  <pault@gcc.gnu.org>
3472         PR fortran/87284
3473         * trans-expr.c (gfc_trans_class_init_assign): Access to
3474         to array elements of the dynamic type requires that the array
3475         reference be added to the class expression and not the _data
3476         component, unlike scalar expressions.
3478 2018-09-11  Janus Weil  <janus@gcc.gnu.org>
3480         PR fortran/87172
3481         * resolve.c (resolve_fl_derived): If a type has the 'use_assoc'
3482         attribute, then it was declared in another module, so there should be
3483         no error that it has not been declared.
3485 2018-09-11  Paul Thomas  <pault@gcc.gnu.org>
3487         PR fortran/87277
3488         * expr.c (is_subref_array): Add the check of dimensionality for
3489         class, dummy, pointer arrays.
3491 2018-09-11  Janus Weil  <janus@gcc.gnu.org>
3493         PR fortran/86830
3494         * expr.c (gfc_is_simply_contiguous): Handle type-bound procedure calls
3495         with non-polymorphic objects.
3497 2018-09-10  Janus Weil  <janus@gcc.gnu.org>
3499         PR fortran/85395
3500         * decl.c (match_binding_attributes): Use correct default accessibility
3501         for procedure pointer components.
3503 2018-09-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3505         * simplify.c (gfc_simplify_modulo): Re-arrange code to test whether
3506         'P' is zero and issue an error if it is.
3508 2018-08-31  Paul Thomas  <pault@gcc.gnu.org>
3510         PR fortran/86328
3511         PR fortran/86760
3512         * trans-array.c (gfc_conv_scalarized_array_ref): Do not fix
3513         info->descriptor but pass it directly to gfc_build_array_ref.
3514         (gfc_conv_array_ref): Likewise for se->expr.
3515         * trans.c (gfc_build_array_ref): If 'decl' is a COMPONENT_REF
3516         obtain the span field directly from it.
3518 2017-08-28  Paul Thomas  <pault@gcc.gnu.org>
3520         PR fortran/80477
3521         * trans-expr.c (gfc_conv_procedure_call): Allocatable class
3522         scalar results being passed to a derived type formal argument
3523         are finalized if possible. Otherwise, rely on existing code for
3524         deallocation. Make the deallocation of allocatable result
3525         components conditional on finalization not taking place. Make
3526         the freeing of data components after finalization conditional
3527         on the data being NULL.
3528         (gfc_trans_arrayfunc_assign): Change the gcc_assert to a
3529         condition to return NULL_TREE.
3530         (gfc_trans_assignment_1): If the assignment is class to class
3531         and the rhs expression must be finalized but the assignment
3532         is not marked as a polymorphic assignment, use the vptr copy
3533         function instead of gfc_trans_scalar_assign.
3535         PR fortran/86481
3536         * trans-expr.c (gfc_conv_expr_reference): Do not add the post
3537         block to the pre block if the expression is to be finalized.
3538         * trans-stmt.c (gfc_trans_allocate): If the expr3 must be
3539         finalized, load the post block into a finalization block and
3540         add it right at the end of the allocation block.
3542 2018-08-27  David Malcolm  <dmalcolm@redhat.com>
3544         PR 87091
3545         * error.c (gfc_format_decoder): Update for conversion of
3546         show_caret_p to a tri-state.
3548 2018-08-25  Janus Weil  <janus@gcc.gnu.org>
3550         PR fortran/86545
3551         * resolve.c (resolve_transfer): Correctly determine typespec for
3552         generic function calls, in order to throw a proper error.
3554 2018-08-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
3556         PR fortran/86837
3557         * frontend-passes.c (var_in_expr_callback): New function.
3558         (var_in_expr): New function.
3559         (traverse_io_block): Use var_in_expr instead of
3560         gfc_check_dependency for checking if the variable depends on the
3561         previous interators.
3563 2018-08-23  Janne Blomqvist  <blomqvist.janne@gmail.com>
3565         * trans-intrinsic.c (gfc_conv_intrinsic_minmaxval): Delete
3566         HONOR_SIGNED_ZEROS checks.
3568 2018-08-23  Paul Thomas  <pault@gcc.gnu.org>
3570         PR fortran/86863
3571         * resolve.c (resolve_typebound_call): If the TBP is not marked
3572         as a subroutine, check the specific symbol.
3574 2018-08-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
3576         * gfortran.texi: Mention that asynchronous I/O does
3577         not work on systems which lack condition variables, such
3578         as AIX.
3580 2018-08-22  Janus Weil  <janus@gcc.gnu.org>
3582         PR fortran/86935
3583         * match.c (gfc_match_associate): Improve diagnostics for the ASSOCIATE
3584         statement.
3586 2018-08-22  Andrew Benson  <abensonca@gmail.com>
3588         * module.c (load_generic_interfaces): Move call to find_symbol()
3589         so that only occurs if actually needed.
3591 2018-08-22  Janus Weil  <janus@gcc.gnu.org>
3593         PR fortran/86888
3594         * decl.c (gfc_match_data_decl): Allow allocatable components of
3595         indirectly recursive type.
3596         * resolve.c (resolve_component): Remove two errors messages ...
3597         (resolve_fl_derived): ... and replace them by a new one.
3599 2018-08-21  Janne Blomqvist  <jb@gcc.gnu.org>
3601         * trans-intrinsic.c (gfc_conv_intrinsic_minmax): Use
3602         MAX_EXPR/MIN_EXPR unconditionally for real arguments.
3603         * gfortran.texi (Compiler Characteristics): Document MAX/MIN
3604         behavior wrt NaN.
3606 2018-08-21  Nicolas Koenig  <koenigni@gcc.gnu.org>
3607         Thomas Koenig <tkoenig@gcc.gnu.org>
3609         PR fortran/25829
3610         * gfortran.texi: Add description of asynchronous I/O.
3611         * trans-decl.c (gfc_finish_var_decl): Treat asynchronous variables
3612         as volatile.
3613         * trans-io.c (gfc_build_io_library_fndecls): Rename st_wait to
3614         st_wait_async and change argument spec from ".X" to ".w".
3615         (gfc_trans_wait): Pass ID argument via reference.
3617 2018-08-16  Nathan Sidwell  <nathan@acm.org>
3619         * cpp.c (dump_macro): Use cpp_user_macro_p.
3621 2018-08-14  Janus Weil  <janus@gcc.gnu.org>
3623         PR fortran/86116
3624         * interface.c (compare_type): Remove a CLASS/TYPE check.
3625         (compare_type_characteristics): New function that behaves like the old
3626         'compare_type'.
3627         (gfc_check_dummy_characteristics, gfc_check_result_characteristics):
3628         Call 'compare_type_characteristics' instead of 'compare_type'.
3630 2018-08-12  Paul Thomas  <pault@gcc.gnu.org>
3632         PR fortran/66679
3633         * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Class array
3634         elements are returned as references to the data element. Get
3635         the class expression by stripping back the references. Use this
3636         for the element size.
3638 2018-08-12  Paul Thomas  <pault@gcc.gnu.org>
3640         PR fortran/86906
3641         * resolve.c (resolve_fl_variable_derived): Check if the derived
3642         type is use associated before checking for the host association
3643         error.
3645 2018-08-10  Janus Weil  <janus@gcc.gnu.org>
3647         PR fortran/57160
3648         * invoke.texi (frontend-optimize): Mention short-circuiting.
3649         * options.c (gfc_post_options): Disable -ffrontend-optimize with -Og.
3650         * resolve.c (resolve_operator): Warn about short-circuiting only with
3651         -ffrontend-optimize.
3652         * trans-expr.c (gfc_conv_expr_op): Use short-circuiting operators only
3653         with -ffrontend-optimize. Without that flag, make sure that both
3654         operands are evaluated.
3656 2018-08-08  Nathan Sidwell  <nathan@acm.org>
3658         * cpp.c (cb_file_change): Use linemap_included_from.
3660 2018-08-07  Cesar Philippidis  <cesar@codesourcery.com>
3662         * trans-stmt.h: Remove stale reference to trans-openacc.c.
3664 2018-08-04  Janus Weil  <janus@gcc.gnu.org>
3666         PR fortran/45521
3667         * interface.c (gfc_compare_interfaces): Apply additional
3668         distinguishability criteria of F08 to operator interfaces.
3670 2018-07-31  Andre Vieira  <andre.simoesdiasvieira@arm.com>
3672         Revert 'AsyncI/O patch committed'
3673         2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
3674                 Thomas Koenig <tkoenig@gcc.gnu.org>
3676         PR fortran/25829
3677         * gfortran.texi: Add description of asynchronous I/O.
3678         * trans-decl.c (gfc_finish_var_decl): Treat asynchronous variables
3679         as volatile.
3680         * trans-io.c (gfc_build_io_library_fndecls): Rename st_wait to
3681         st_wait_async and change argument spec from ".X" to ".w".
3682         (gfc_trans_wait): Pass ID argument via reference.
3684 2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
3685         Thomas Koenig <tkoenig@gcc.gnu.org>
3687         PR fortran/25829
3688         * gfortran.texi: Add description of asynchronous I/O.
3689         * trans-decl.c (gfc_finish_var_decl): Treat asynchronous variables
3690         as volatile.
3691         * trans-io.c (gfc_build_io_library_fndecls): Rename st_wait to
3692         st_wait_async and change argument spec from ".X" to ".w".
3693         (gfc_trans_wait): Pass ID argument via reference.
3695 2018-07-20  Martin Sebor  <msebor@redhat.com>
3697         PR middle-end/82063
3698         * gfortran.h (gfc_handle_option): Change function argument
3699         to HOST_WIDE_INT.
3700         * options.c (gfc_handle_option): Same.
3702 2018-07-20  Andrew Benson  <abenson@carnegiescience.edu>
3704         * gfortran.h (gfc_symbol): Add pointer to next derived type.
3705         (gfc_dt_list, gfc_get_dt_list): Remove.
3706         (gfc_namespace): Replace gfc_dt_list with gfc_symbol.
3707         * parse.c (resolve_all_program_units): Replace gfc_free_dt_list() with
3708         simple nullification of gfc_derived_types.
3709         * resolve.c (resolve_global_procedure): Replace gfc_dt_list with
3710         gfc_symbol.
3711         (add_dt_to_dt_list): Change derived type linked list insertion to
3712         utilize dt_next pointers in gfc_symbol.
3713         * symbol.c (gfc_new_symbol, gfc_free_dt_list, gfc_symbol_done2)
3714         (get_iso_c_binding_dt, generate_isocbinding_symbol): Remove
3715         gfc_free_dt_list as gfc_dt_list is obsoleted. Change derived type
3716         linked list search/insertion to utilize dt_next pointers in gfc_symbol.
3717         * trans-types.c (gfc_get_derived_type): Change derived type linked
3718         list search to utilize dt_next pointers in gfc_symbol.
3720 2018-07-19  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
3722         * trans-intrinsic.c: (gfc_conv_intrinsic_minmax): Emit MIN_MAX_EXPR
3723         or IFN_FMIN/FMAX sequence to calculate the min/max when possible.
3725 2018-07-18  Janus Weil  <janus@gcc.gnu.org>
3726             Thomas Koenig  <tkoenig@gcc.gnu.org>
3728         PR fortran/85599
3729         * dump-parse-tree.c (show_attr): Add handling of implicit_pure.
3730         * frontend-passes.c (do_warn_function_elimination): Do not warn for
3731         pure functions.
3732         * gfortran.h: Add prototypes for gfc_pure_function and
3733         gfc_implicit_pure_function.
3734         * gfortran.texi: Add chapter on evaluation of logical expressions.
3735         * invoke.texi: Mention that -Wfunction-elimination is implied
3736         by -Wextra.
3737         * lang.opt: Make -Wextra imply -Wfunction-elimination.
3738         * resolve.c (pure_function): Rename to gfc_pure_function.
3739         (gfc_implicit_pure_function): New function.
3740         (check_pure_function): Use it here.
3741         (impure_function_callback): New function.
3742         (resolve_operator): Call it via gfc_expr_walker.
3744 2018-07-16  Fritz Reese  <fritzoreese@gmail.com>
3746         PR fortran/83184
3747         * decl.c (match_old_style_init): Initialize locus of variable expr when
3748         creating a data variable.
3749         (match_clist_expr): Verify array is explicit shape/size before
3750         attempting to allocate constant array constructor.
3752 2018-07-16  Fritz Reese  <fritzoreese@gmail.com>
3754         PR fortran/86417
3755         * module.c (mio_component): Set component->loc when loading from module.
3757 2018-07-10  Jakub Jelinek  <jakub@redhat.com>
3759         PR fortran/86421
3760         * module.c (omp_declare_simd_clauses): Add LINEAR with _REF, _VAL and
3761         _UVAL suffixes.
3762         (mio_omp_declare_simd): Save and restore ref, val and uval modifiers
3763         on linear clauses.  Initialize n->where to gfc_current_locus.
3765 2018-07-05  Paul Thomas  <pault@gcc.gnu.org>
3767         PR fortran/86408
3768         * resolve.c.c (resolve_contained_fntype): Reference to C418 is
3769         in F2008 and not F2003.
3770         (resolve_function): Ditto in error message. Also, exclude
3771         deferred character length results from the error.
3773 2018-07-05  Fritz Reese  <fritzoreese@gmail.com>
3775         PR fortran/83183
3776         PR fortran/86325
3777         * expr.c (class_allocatable, class_pointer, comp_allocatable,
3778         comp_pointer): New helpers.
3779         (component_initializer): Generate EXPR_NULL for allocatable or pointer
3780         components. Do not generate initializers for components within BT_CLASS.
3781         Do not assign to comp->initializer.
3782         (gfc_generate_initializer): Use new helpers; move code to generate
3783         EXPR_NULL for class allocatable components into component_initializer().
3785 2018-07-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3787         PR fortran/82009
3788         * trans-decl.c (gfc_process_block_locals): Delete assert and set
3789         saved_local_decls = NULL_TREE.
3791 2018-07-02  Richard Biener  <rguenther@suse.de>
3793         PR lto/86321
3794         * trans-types.c (gfc_get_array_type_bounds): Unshare TYPE_FIELDs
3795         for the distinct type copy.
3797 2018-07-02  Paul Thomas  <pault@gcc.gnu.org>
3799         PR fortran/82969
3800         PR fortran/86242
3801         * trans-array.c (structure_alloc_comps): Do not explicitly copy
3802         procedure pointer components.
3804 2018-07-02  Paul Thomas  <pault@gcc.gnu.org>
3806         PR fortran/45305
3807         * expr.c : Add a prototype for scalarize_intrinsic_call.
3808         (gfc_simplify_expr): Use scalarize_intrinsic_call for elemental
3809         intrinsic function calls.
3810         (scalarize_intrinsic_call): Add 'init_flag' argument. Check if
3811         the expression or any of the actual argument expressions are
3812         NULL. Before calling gfc_check_init_expr, check 'init_flag'.
3813         Only simplify the scalarized expressions if there are no errors
3814         on the stack.
3815         (gfc_check_init_expr): Set 'init_flag' true in the call to
3816         scalarize_intrinsic_call.
3818 2018-06-28  Fritz Reese  <fritzoreese@gmail.com>
3820         PR fortran/82865
3821         * decl.c (gfc_match_type): Refactor and check for PDT declarations.
3823 2018-06-28  Martin Liska  <mliska@suse.cz>
3825         * gfortranspec.c: Include opt-suggestions.h.
3827 2018-06-25  Fritz Reese  <fritzoreese@gmail.com>
3829         PR fortran/82972
3830         PR fortran/83088
3831         PR fortran/85851
3832         * expr.c (component_initializer): Assign init expr to c->initializer.
3833         (generate_isocbinding_initializer): New.
3834         (gfc_generate_initializer): Call generate_isocbinding_initializer to
3835         generate initializers for c_ptr and c_funptr with -finit-derived.
3837 2018-06-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3839         PR fortran/85983
3840         * interface.c (check_dtio_interface1): Delete assert.
3842 2018-06-22  Paul Thomas  <pault@gcc.gnu.org>
3843             Rainer Orth  <ro@gcc.gnu.org>
3845         PR fortran/86281
3846         * resolve.c (resolve_contained_fntype): Check for the charlen
3847         before testing the length.
3849 2018-06-21  Paul Thomas  <pault@gcc.gnu.org>
3851         PR fortran/49630
3852         * resolve.c (resolve_contained_fntype): Change standard ref.
3853         from F95 to F2003: C418. Correct a spelling error in a comment.
3854         It is an error for an abstract interface to have an assumed
3855         character length result.
3856         * trans-expr.c (gfc_conv_procedure_call): Likewise change the
3857         standard reference.
3859 2018-06-21  Paul Thomas  <pault@gcc.gnu.org>
3861         PR fortran/83118
3862         * resolve.c (resolve_ordinary_assign): Force the creation of a
3863         vtable for assignment of non-polymorphic expressions to an
3864         unlimited polymorphic object.
3865         * trans-array.c (gfc_alloc_allocatable_for_assignment): Use the
3866         size of the rhs type for such assignments. Set the dtype, _len
3867         and vptrs appropriately.
3868         * trans-expr.c (gfc_trans_assignment): Force the use of the
3869         _copy function for these assignments.
3871 2018-06-20  Chung-Lin Tang <cltang@codesourcery.com>
3872             Thomas Schwinge <thomas@codesourcery.com>
3873             Cesar Philippidis  <cesar@codesourcery.com>
3875         * gfortran.h (gfc_omp_clauses): Add unsigned if_present, finalize
3876         bitfields.
3877         * openmp.c (enum omp_mask2): Remove OMP_CLAUSE_PRESENT_OR_*. Add
3878         OMP_CLAUSE_{IF_PRESENT,FINALIZE}.
3879         (gfc_match_omp_clauses): Update handling of copy, copyin, copyout,
3880         create, deviceptr, present_of_*. Add support for finalize and
3881         if_present.
3882         (OACC_PARALLEL_CLAUSES): Remove PRESENT_OR_* clauses.
3883         (OACC_KERNELS_CLAUSES): Likewise.
3884         (OACC_DATA_CLAUSES): Likewise.
3885         (OACC_DECLARE_CLAUSES): Likewise.
3886         (OACC_UPDATE_CLAUSES): Add IF_PRESENT clause.
3887         (OACC_ENTER_DATA_CLAUSES): Remove PRESENT_OR_* clauses.
3888         (OACC_EXIT_DATA_CLAUSES): Add FINALIZE clause.
3889         (gfc_match_oacc_declare): Update to OpenACC 2.5 semantics.
3890         * trans-openmp.c (gfc_trans_omp_clauses): Add support for IF_PRESENT
3891         and FINALIZE.
3893 2018-06-18  Eric Botcazou  <ebotcazou@adacore.com>
3895         * trans-decl.c (gfc_get_fake_result_decl): Revert latest change.
3897 2018-06-17  Eric Botcazou  <ebotcazou@adacore.com>
3899         * trans-decl.c (nonlocal_dummy_decl_pset): Delete.
3900         (nonlocal_dummy_decls): Likewise.
3901         (gfc_nonlocal_dummy_array_decl): Likewise.
3902         (gfc_get_symbol_decl): Do not call gfc_nonlocal_dummy_array_decl.
3903         (gfc_get_fake_result_decl): Do not generate a new DECL if simply
3904         reusing the result of a recursive call.
3905         (gfc_generate_function_code): Do not create, insert and destroy
3906         nonlocal_dummy_decls.
3908 2018-06-13  Steven G. Kargl  <kargl@gcc.gnu.org>
3910         PR fortran/86110
3911         * array.c (gfc_resolve_character_array_constructor): Avoid NULL
3912         pointer dereference.
3914 2018-06-13  Cesar Philippidis  <cesar@codesourcery.com>
3916         PR fortran/85703
3917         * parse.c (decode_oacc_directive): Set gfc_matching_function
3918         to false.
3919         (decode_omp_directive): Likewise.
3921 2018-06-13  Cesar Philippidis  <cesar@codesourcery.com>
3923         PR fortran/85702
3924         * openmp.c (gfc_match_oacc_wait): Use %C to report error location.
3926 2018-06-12  David Malcolm  <dmalcolm@redhat.com>
3928         PR other/69968
3929         * misc.c (gfc_closest_fuzzy_match): Update for renaming of
3930         levenshtein_distance to get_edit_distance.
3932 2018-06-12  Steven G. Kargl  <kargl@gcc.gnu.org>
3934         PR fortran/44491
3935         * expr.c (gfc_check_assign): Select non-NULL locus.
3937 2018-06-11  Janus Weil  <janus@gcc.gnu.org>
3939         PR fortran/45521
3940         * interface.c (compare_ptr_alloc): New function.
3941         (generic_correspondence): Call it.
3943 2018-06-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
3945         * gfortran.h (gfc_expr): Add no_bounds_check field.
3946         * frontend-passes.c (get_array_inq_function): Set no_bounds_check
3947         on function and function argument.
3948         (inline_matmul_assign): Set no_bounds_check on zero expression
3949         and on lhs of zero expression.
3950         Also handle A1B2 case if realloc on assigment is active.
3951         * trans-array.c (gfc_conv_array_ref): Don't do range checking
3952         if expr has no_bounds_check set.
3953         (gfc_conv_expr_descriptor): Set no_bounds_check on ss if expr
3954         has it set.
3955         * trans-expr.c (gfc_trans_assignment_1): Set no_bounds_check
3956         on lss and lss if the corresponding expressions have it set.
3958 2018-06-10  Dominique d'Humieres  <dominiq@gcc.gnu.org>
3960         PR fortran/79854
3961         * trans-const.c: Remove include "diagnostic-core.h".
3962         (gfc_conv_constant_to_tree): Replace fatal_error with gcc_unreachable.
3964 2018-06-10  Janus Weil  <janus@gcc.gnu.org>
3966         PR fortran/85088
3967         * decl.c (match_attr_spec): Synchronize the DECL_* enum values with the
3968         INTENT_* values from the enum 'sym_intent'. Call 'match_intent_spec'
3969         and remove a TODO note.
3970         * gfortran.h: Add a comment to sym_intent.
3972 2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>
3974         PR fortran/38351
3975         * resolve.c (resolve_operator): Provide better error message for
3976         derived type entity used in an binary intrinsic numeric operator.
3978 2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>
3980         PR fortran/85138
3981         PR fortran/85996
3982         PR fortran/86051
3983         * decl.c (gfc_match_char_spec): Use private namespace in attempt to
3984         reduce a charlen to a constant.
3986 2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>
3988         PR fortran/78278
3989         * data.c (gfc_assign_data_value): Re-arrange code to allow for
3990         an error for double initialization of CHARACTER entities.
3992 2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>
3994         PR fortran/63514
3995         * symbol.c (gfc_add_volatile): Enforce F2008:C1282 and F2018:C1588.
3997 2018-06-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
3999         PR fortran/85631
4000         * trans.h (gfc_ss): Add field no_bounds_check.
4001         * trans-array.c (gfc_conv_ss_startstride): If flag_realloc_lhs and
4002         ss->no_bounds_check is set, do not use runtime checks.
4003         * trans-expr.c (gfc_trans_assignment_1): Set lss->no_bounds_check
4004         for reallocatable lhs.
4006 2018-06-08  Steven G. Kargl  <kargl@gcc.gnu.org>
4008         PR fortran/86059
4009         * array.c (match_array_cons_element): NULL() cannot be in an
4010         array constructor.
4012 2018-06-08  Steven G. Kargl  <kargl@gcc.gnu.org>
4014         PR fortran/78571
4015         * data.c (create_character_initializer): Return early if type is
4016         incompatible with CHARACTER.
4018 2018-06-07  Steven G. Kargl  <kargl@gcc.gnu.org>
4020         PR fortran/86045
4021         * simplify.c (gfc_simplify_mod): Re-arrange code to test whether
4022         'P' is zero and issue an error if it is.
4024 2018-06-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
4026         PR fortran/85641
4027         * frontend-passes.c (is_fe_temp): Add prototype.
4028         (realloc_string_callback): Early return for frontend-generated
4029         temporary.
4031 2018-06-05  Cesar Philippidis  <cesar@codesourcery.com>
4033         PR fortran/85701
4035         * openmp.c (gfc_resolve_oacc_declare): Error on functions and
4036         subroutine data clause arguments.
4038 2018-06-04  Steven G. Kargl  <kargl@gcc.gnu.org>
4040         PR fortran/85981
4041         * resolve.c (resolve_allocate_deallocate): Check errmsg is default
4042         character kind.
4044 2018-06-03  Paul Thomas  <pault@gcc.gnu.org>
4046         PR fortran/36497
4047         * decl.c (variable_decl): Use gfc_add_type for cray pointees.
4049 2018-06-01  Steven G. Kargl  <kargl@gcc.gnu.org>
4051         PR fortran/63570
4052         * check.c (gfc_check_random_init): New function. Check arguments of
4053         RANDOM_INIT.
4054         * gfortran.h (GFC_ISYM_RANDOM_INIT): New enum token.
4055         * intrinsic.c (add_subroutines): Add RANDOM_INIT to list of
4056         subroutines.
4057         (gfc_check_intrinsic_standard): Introduce Fortran 2018 check.
4058         * intrinsic.h: Add prototypes for gfc_check_random_init and
4059         gfc_resolve_random_init
4060         * intrinsic.texi: Document new intrinsic subprogram.
4061         * iresolve.c (gfc_resolve_random_init): Resolve routine name.
4062         * trans-decl.c: Declare gfor_fndecl_random_init
4063         * trans-intrinsic.c (conv_intrinsic_random_init): New function.
4064         Translate call to RANDOM_INIT.
4065         (gfc_conv_intrinsic_subroutine): Call it.
4066         * trans.h: Declare gfor_fndecl_random_init
4068 2018-05-27  Steven G. Kargl  <kargl@gcc.gnu.org>
4070         * decl.c (match_data_constant):  Fortran 2018 allows pointer
4071         initialization in a data statement.
4073 2018-05-25  Janus Weil  <janus@gcc.gnu.org>
4075         PR fortran/85839
4076         * match.c (gfc_match_block_data): Call gfc_notify_std to warn about
4077         an obsolescent feature in Fortran 2018.
4078         (gfc_match_equivalence): Ditto.
4079         * resolve.c (resolve_common_blocks): Ditto.
4080         (gfc_resolve_forall): Ditto.
4081         * symbol.c (gfc_define_st_label): Ditto.
4083 2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
4085         PR fortran/85543
4086         * resolve.c (update_current_proc_array_outer_dependency): Avoid NULL
4087         pointer dereference.
4089 2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
4091         PR fortran/85780
4092         * resolve.c (resolve_fl_procedure): Avoid NULL dereference.
4094 2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
4096         PR fortran/85779
4097         * decl.c (gfc_match_derived_decl): Fix NULL point dereference.
4099 2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
4101         PR fortran/85895
4102         * resolve.c (resolve_sync): Resolve expression before checking for
4103         an error.
4105 2018-05-22  Janus Weil  <janus@gcc.gnu.org>
4107         PR fortran/85841
4108         * libgfortran.h: Remove the macros GFC_STD_F2008_TS and
4109         GFC_STD_OPT_F08TS.
4110         * error.c (notify_std_msg): Remove GFC_STD_F2008_TS.
4111         * options.c (set_default_std_flags): Ditto.
4112         (gfc_handle_option): Make -std=f2008ts an alias for -std=f2018.
4113         * array.c (gfc_match_array_spec): Replace GFC_STD_F2008_TS by
4114         GFC_STD_F2018.
4115         * check.c (gfc_check_atomic, gfc_check_event_query,
4116         gfc_check_c_f_pointer, gfc_check_c_f_procpointer, gfc_check_c_funloc,
4117         gfc_check_c_loc, gfc_check_num_images, gfc_check_this_image): Ditto.
4118         * decl.c (gfc_verify_c_interop_param, gfc_match_decl_type_spec): Ditto.
4119         * intrinsic.c (add_functions, add_subroutines,
4120         gfc_check_intrinsic_standard): Ditto.
4121         * iso-c-binding.def: Ditto.
4122         * iso-fortran-env.def: Ditto.
4123         * match.c (gfc_match_event_post, gfc_match_event_wait,
4124         gfc_match_fail_image, gfc_match_form_team, gfc_match_change_team,
4125         gfc_match_end_team, gfc_match_sync_team): Ditto.
4126         * gfortran.texi: Remove mention of -std=f2008ts.
4127         Move TSs into F2018 section.
4128         * invoke.texi: Update documentation of -std=f2008ts.
4130 2018-05-21  Janus Weil  <janus@gcc.gnu.org>
4132         PR fortran/85841
4133         * libgfortran.h: New macros GFC_STD_OPT_*.
4134         * error.c (notify_std_msg): New function.
4135         (gfc_notify_std): Adjust such that it can handle combinations of
4136         GFC_STD_* flags in the 'std' argument, not just a single one.
4137         * match.c (match_arithmetic_if, gfc_match_if): Reject arithmetic if
4138         in Fortran 2018.
4139         (gfc_match_stopcode): Use GFC_STD_OPT_* macros.
4140         * options.c (set_default_std_flags): Warn for F2018 deleted features
4141         by default.
4142         (gfc_handle_option): F2018 deleted features are allowed in earlier
4143         standards.
4144         * symbol.c (gfc_define_st_label, gfc_reference_st_label): Reject
4145         nonblock do constructs in Fortran 2018.
4147 2018-05-20  Paul Thomas  <pault@gcc.gnu.org>
4149         PR fortran/80657
4150         * resolve.c (flag_fn_result_spec): Use the 'sym' argument to
4151         test for self refs to the function result in the character len
4152         expression. If a self reference is found, emit an error and
4153         return true.
4154         (resolve_fntype): Use the function symbol in the calls to the
4155         above.
4157 2018-05-20  Paul Thomas  <pault@gcc.gnu.org>
4159         PR fortran/49636
4160         * trans-array.c (gfc_get_array_span): Renamed from
4161         'get_array_span'.
4162         (gfc_conv_expr_descriptor): Change references to above.
4163         * trans-array.h : Add prototype for 'gfc_get_array_span'.
4164         * trans-intrinsic.c (gfc_conv_associated): Add pre and post
4165         blocks for 'arg1'.
4166         * trans-stmt.c (trans_associate_var): If the associate name is
4167         a subref array pointer, use gfc_get_array_span for the span.
4169 2018-05-20  Paul Thomas  <pault@gcc.gnu.org>
4171         PR fortran/82275
4172         * match.c (gfc_match_type_spec): Go through the array ref and
4173         decrement 'rank' for every dimension that is an element.
4175 2018-05-19  Paul Thomas  <pault@gcc.gnu.org>
4177         PR fortran/82923
4178         PR fortran/66694
4179         PR fortran/82617
4180         * trans-array.c (gfc_alloc_allocatable_for_assignment): Set the
4181         charlen backend_decl of the rhs expr to ss->info->string_length
4182         so that the value in the current scope is used.
4184 2018-05-13  Steven G. Kargl  <kargl@gcc.gnu.org>
4186         PR fortran/63529
4187         * gfortran.texi: Clarify documentation for Cray pointer and
4188         assumed-sized array.
4190 2018-05-13  Paul Thomas  <pault@gcc.gnu.org>
4192         PR fortran/85742
4193         * trans-types.c (gfc_get_dtype_rank_type): Reorder evaluation
4194         of 'size'. If the element type is a pointer use the size of the
4195         TREE_TYPE of the type, unless it is VOID_TYPE. In this latter
4196         case, set the size to zero.
4198 2018-05-13  Steven G. Kargl  <kargl@gcc.gnu.org>
4200         * gfortran.h: Remove prototype.
4201         * symbol.c (gfc_new_undo_checkpoint): Remove unused function.
4203 2018-05-11  Steven G. Kargl  <kargl@gcc.gnu.org>
4205         PR fortran/85542
4206         * expr.c (check_inquiry): Avoid NULL pointer dereference.
4208 2018-05-10  Steven G. Kargl  <kargl@gcc.gnu.org>
4210         PR fortran/85687
4211         * check.c (gfc_check_rank): Check that the argument is a data object.
4213 2018-05-10  Steven G. Kargl  <kargl@gcc.gnu.org>
4215         PR fortran/85521
4216         * array.c (gfc_resolve_character_array_constructor): Substrings
4217         with upper bound smaller than lower bound are zero length strings.
4219 2018-05-10  Steven G. Kargl  <kargl@gcc.gnu.org>
4221         PR fortran/70870
4222         * data.c (gfc_assign_data_value): Check that a data object does
4223         not also have default initialization.
4225 2018-05-10  Marek Polacek  <polacek@redhat.com>
4227         PR fortran/85735
4228         * options.c (gfc_post_options): Set main_input_filename.
4230 2018-05-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
4232         PR fortran/54613
4233         * intrinsic.texi: Document BACK for MINLOC and MAXLOC.
4235 2018-05-10  Paul Thomas  <pault@gcc.gnu.org>
4237         PR fortran/68846
4238         PR fortran/70864
4239         * resolve.c (get_temp_from_expr): The temporary must not have
4240         dummy or intent attributes.
4242 2018-05-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
4244         PR fortran/54613
4245         * check.c (gfc_check_minmaxloc): Remove error for BACK not being
4246         implemented.  Use gfc_logical_4_kind for BACK.
4247         * simplify.c (min_max_choose): Add optional argument back_val.
4248         Handle it.
4249         (simplify_minmaxloc_to_scalar): Add argument back_val. Pass
4250         back_val to min_max_choose.
4251         (simplify_minmaxloc_to_nodim): Likewise.
4252         (simplify_minmaxloc_to_array): Likewise.
4253         (gfc_simplify_minmaxloc): Add argument back, handle it.
4254         Pass back_val to specific simplification functions.
4255         (gfc_simplify_minloc): Remove ATTRIBUTE_UNUSED from argument back,
4256         pass it on to gfc_simplify_minmaxloc.
4257         (gfc_simplify_maxloc): Likewise.
4258         * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Adjust
4259         comment. If BACK is true, use greater or equal (or lesser or
4260         equal) insteal of greater (or lesser). Mark the condition of
4261         having found a value which exceeds the limit as unlikely.
4263 2018-05-07  Jeff Law  <law@redhat.comg>
4265         * scanner.c (preprocessor_line): Call linemap_add after a line
4266         directive that changes the current filename.
4268 2018-05-06  Andre Vehreschild  <vehre@gcc.gnu.org>
4270         PR fortran/85507
4271         * dependency.c (gfc_dep_resolver): Revert looking at coarray dimension
4272         introduced by r259385.
4273         * trans-intrinsic.c (conv_caf_send): Always report a dependency for
4274         same variables in coarray assignments.
4276 2018-05-02  Tom de Vries  <tom@codesourcery.com>
4278         PR libgomp/82428
4279         * f95-lang.c (DEF_GOACC_BUILTIN_ONLY): Define.
4281 2018-04-24  Steven G. Kargl  <kargl@gcc.gnu.org>
4283         PR fortran/85520
4284         * decl.c (gfc_match_char_spec): Check for negative length and set to 0.
4286 2018-04-14  Andre Vehreschild  <vehre@gcc.gnu.org>
4288         PR fortran/81773
4289         PR fortran/83606
4290         * dependency.c (gfc_dep_resolver): Coarray indexes are to be ignored
4291         during dependency computation.  They define no data dependency.
4292         * trans-array.c (conv_array_index_offset): The stride can not be set
4293         here, prevent fail.
4294         * trans-intrinsic.c (conv_caf_send): Add creation of temporary array
4295         for caf_get's result and copying to the array with vectorial
4296         indexing.
4298 2018-04-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
4300         PR fortran/85387
4301         * frontend-passes.c (traverse_io_block): Check for start, end or
4302         stride being defined by an outer implied DO loop.
4304 2018-04-12  Thomas Koenig  <tkoenig@gcc.gnu.org>
4306         PR fortran/83064
4307         PR testsuite/85346
4308         * trans-stmt.c (gfc_trans_forall_loop): Use annot_expr_ivdep_kind
4309         for annotation and remove dependence on -ftree-parallelize-loops.
4311 2018-04-10  Jakub Jelinek  <jakub@redhat.com>
4313         PR fortran/85313
4314         * openmp.c (resolve_omp_do): Remove bogus if (j < i) break;.
4315         (resolve_oacc_nested_loops): Likewise.  Formatting fix.
4317 2018-04-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
4319         PR fortran/83064
4320         * trans-stmt.c (gfc_trans_forall_loop): Remove annotation for
4321         parallell processing of DO CONCURRENT -ftree-parallelize-loops
4322         is set.
4324 2018-04-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
4326         PR fortran/51260
4327         * resolve.c (resolve_variable): Simplify cases where access to a
4328         parameter array results in a single constant.
4330 2018-04-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
4332         PR fortran/85102
4333         * decl.c (variable_decl): If upper or lower bounds simplify
4334         to a constant, use that.
4336 2018-03-30  Paul Thomas  <pault@gcc.gnu.org>
4338         PR fortran/84931
4339         * simplify.c (gfc_convert_constant): Handle case of array
4340         constructors within an array that has no iterator and improve
4341         the conciseness of this section of code.
4343 2017-03-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
4345         PR fortran/85111
4346         * array.c (gfc_resolve_character_array_constructor): Early
4347         exit for zero-size arrays.
4348         * simplify.c (simplify_transformation_to_array): Exit early
4349         if the result size is zero.
4350         (simplify_minmaxloc_to_array): Likewise.
4352 2018-03-28  Mikael Morin  <mikael@gcc.gnu.org>
4354         PR fortran/69497
4355         * symbol.c (gfc_symbol_done_2): Start freeing namespaces
4356         from the root.
4357         (gfc_free_namespace): Restore assert (revert r258839).
4359 2018-03-28  Jakub Jelinek  <jakub@redhat.com>
4361         * gfortran.h (gfc_dt): Rename default_exp field to dec_ext.
4362         * ioparm.def (IOPARM_dt_default_exp): Rename to ...
4363         (IOPARM_dt_dec_ext): ... this.
4364         * trans-io.c (build_dt): Adjust for default_exp renaming to
4365         dec_ext and IOPARM_dt_default_exp renaming to IOPARM_dt_dec_ext.
4366         * io.c (match_io): Likewise.
4368 2018-03-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
4370         PR fortran/85084
4371         * frontend-passes.c (gfc_run_passes): Do not run front-end
4372         optimizations if a previous error occurred.
4374 2018-03-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
4375         Harald Anlauf  <anlauf@gmx.de>
4377         PR fortran/85083
4378         * primary.c (gfc_convert_to_structure_constructor): Check
4379         conformance of argument types in structure constructor.
4381 2018-03-26  Thomas Koenig  <tkoenig@gcc.gnu.org>
4383         PR fortran/66709
4384         * io.c: Include constructor.h.
4385         (resolve_tag_format): For a constant character array, concatenate
4386         into a single character expression.
4388 2018-03-25  Seth Johnson <johnsonsr@ornl.gov>
4389         Dominique d'Humieres  <dominiq@gcc.gnu.org>
4391         PR fortran/84924
4392         * check.c (gfc_check_c_f_pointer): Allow scalar noninteroperable
4393         scalar derived type with -std=f2003 and -std=f2008.
4395 2018-03-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
4396             Dominique d'Humieres  <dominiq@gcc.gnu.org>
4398         PR fortran/69497
4399         * symbol.c (gfc_free_namespace): Delete the assert and only if
4400         refs count is equals zero, free the namespace. Otherwise,
4401         something is halfway and other errors will resound.
4403 2018-03-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
4405         PR fortran/70068
4406         * expr.c (find_substring_ref): Change types of start, end
4407         and length variables to gfc_charlen_t. Set length to zero
4408         for empty substring.
4410 2018-03-24  Steven G. Kargl  <kargl@gcc.gnu.org>
4412         PR fortran/42651
4413         * decl.c (check_function_name): Improved error message
4414         (gfc_match_volatile, gfc_match_asynchronous) Use check_function_name.
4416 2018-03-22  Steven G. Kargl  <kargl@gcc.gnu.org>
4418         PR fortran/84922
4419         * decl.c (get_proc_name): If the MODULE prefix appears in interface
4420         body, then it must appear on the contained subroutine or function.
4421         While here, fix nearby mis-indented code.
4423 2018-03-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
4424         Harald Anlauf  <anlauf@gmx.de>
4426         PR fortran/84957
4427         * trans-types.c (gfc_sym_type): Do not dereference NULL pointer.
4429 2018-03-21  Janne Blomqvist  <jb@gcc.gnu.org>
4431         PR fortran/84615
4432         * trans-expr.c (gfc_conv_procedure_call): Convert charlen to
4433         gfc_charlen_type_node when calling procedure.
4435 2018-03-20  Steven G. Kargl  <kargl@gcc.gnu.org>
4437         PR fortran/85001
4438         * interface.c (symbol_rank): Remove bogus null pointer check that
4439         crept in when translating a ternary operator into an if-else
4440         constructor.
4442 2018-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
4444         PR fortran/84931
4445         * simplify.c (gfc_convert_constant): Correctly handle iterators
4446         for type conversion.
4448 2018-03-18  Steven G. Kargl  <kargl@gcc.gnu.org>
4450         PR fortran/77414
4451         * decl.c (get_proc_name):  Check for a subroutine re-defined in
4452         the contain portion of a subroutine.  Change language of existing
4453         error message to better describe the issue. While here fix whitespace
4454         issues.
4456 2018-03-18  Steven G. Kargl  <kargl@gcc.gnu.org>
4458         PR fortran/65453
4459         * decl.c (get_proc_name): Catch clash between a procedure statement
4460         and a contained subprogram
4462 2018-03-16  Steven G. Kargl  <kargl@gcc.gnu.org>
4464         PR fortran/69395
4465         * decl.c (merge_array_spec): Correct the error condition.
4467 2018-03-15  Steven G. Kargl  <kargl@gcc.gnu.org>
4469         PR fortran/78741
4470         * decl.c (get_proc_name):  Check for clash of entry name with
4471         subroutine name.
4473 2018-03-15  Steven G. Kargl  <kargl@gcc.gnu.org>
4475         PR fortran/69395
4476         * decl.c (merge_array_spec): Limit the merging to maximum allowed
4477         dimensions, and issue error message if limit is exceeded.
4479 2018-03-13  Steven G. Kargl  <kargl@gcc.gnu.org>
4481         * check.c (gfc_check_kill_sub):  Remove check for INTEGER(4) or (8).
4482         * intrinsic.c (add_functions): Remove reference to gfc_resolve_kill.
4483         (add_subroutines): Remove reference to gfc_resolve_kill_sub.
4484         * intrinsic.texi: Update documentation.
4485         * iresolve.c (gfc_resolve_kill, gfc_resolve_kill_sub): Remove.
4486         * trans-decl.c (gfc_build_intrinsic_function_decls):  Add
4487         gfor_fndecl_kill and gfor_fndecl_kill_sub
4488         * trans-intrinsic.c (conv_intrinsic_kill, conv_intrinsic_kill_sub): new
4489         functions.
4490         (gfc_conv_intrinsic_function): Use conv_intrinsic_kill.
4491         (gfc_conv_intrinsic_subroutine): Use conv_intrinsic_kill_sub.
4492         * trans.h: Declare gfor_fndecl_kill and gfor_fndecl_kill_sub.
4494 2018-03-11  Paul Thomas  <pault@gcc.gnu.org>
4496         PR fortran/84546
4497         * trans-array.c (structure_alloc_comps): Make sure that the
4498         vptr is copied and that the unlimited polymorphic _len is used
4499         to compute the size to be allocated.
4500         * trans-expr.c (gfc_get_class_array_ref): If unlimited, use the
4501         unlimited polymorphic _len for the offset to the element.
4502         (gfc_copy_class_to_class): Set the new 'unlimited' argument.
4503         * trans.h : Add the boolean 'unlimited' to the prototype.
4505 2018-03-11  Steven G. Kargl  <kargl@gcc.gnu.org>
4507         PR fortran/83939
4508         * resolve.c (resolve_fl_procedure): Enforce F2018:C15100.
4510 2018-03-11  Steven G. Kargl  <kargls@gcc.gnu.org>
4512         * check.c (gfc_check_kill):  Check pid and sig are scalar.
4513         (gfc_check_kill_sub): Restrict kind to 4 and 8.
4514         * intrinsic.c (add_function): Sort keyword list.  Add pid and sig
4515         keywords for KILL.  Remove redundant *back="back" in favor of the
4516         original *bck="back".
4517         (add_subroutines): Sort keyword list.  Add pid and sig keywords
4518         for KILL.
4519         * intrinsic.texi: Fix documentation to consistently use pid and sig.
4520         * iresolve.c (gfc_resolve_kill): Kind can only be 4 or 8.  Choose the
4521         correct function.
4522         (gfc_resolve_rename_sub): Add comment.
4524 2018-03-11  Thomas Koenig  <tkoenig@gcc.gnu.org>
4526         PR fortran/66128
4527         * simplify.c (simplify_transformation): Return default result for
4528         empty array argument.
4529         (gfc_simplify_all): Remove special-case handling for zerosize.
4530         (gfc_simplify_any): Likewise.
4531         (gfc_simplify_count): Likewise.
4532         (gfc_simplify_iall): Likewise.
4533         (gfc_simplify_iany): Likewise.
4534         (gfc_simplify_iparity): Likewise.
4535         (gfc_simplify_minval): Likewise.
4536         (gfc_simplify_maxval): Likewise.
4537         (gfc_simplify_norm2): Likewise.
4538         (gfc_simplify_product): Likewise.
4539         (gfc_simplify_sum): Likewise.
4541 2018-03-10  Steven G. Kargl  <kargl@gcc.gnu.org>
4543         PR fortran/84734
4544         * arith.c (check_result, eval_intrinsic):  If result overflows, pass
4545         the expression up the chain instead of a NULL pointer.
4547 2018-03-07  Steven G. Kargl  <kargl@gcc.gnu.org>
4549         PR fortran/64124
4550         PR fortran/70409
4551         * decl.c (gfc_match_char_spec): Try to reduce a charlen to a constant.
4553 2017-03-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
4555         PR fortran/84697
4556         PR fortran/66128
4557         * expr.c (simplify_parameter_variable): If p is a size zero array
4558         and not an ARRAY_EXPR insert an empty array constructor and
4559         return.
4560         * gfortran.h: Add prototype for gfc_is_size_zero_array.
4561         * simplify.c (is_size_zero_array): Make non-static and rename into
4562         (gfc_is_size_zero_array):  Check for parameter arrays of zero
4563         size by comparing shape and absence of constructor.
4564         (gfc_simplify_all): Use gfc_is_size_zero_array instead of
4565         is_size_zero_array.
4566         (gfc_simplify_count): Likewise.
4567         (gfc_simplify_iall): Likewise.
4568         (gfc_simplify_iany): Likewise.
4569         (gfc_simplify_iparity): Likewise.
4570         (gfc_simplify_minval): Likewise.
4571         (gfc_simplify_maxval): Likewise.
4572         (gfc_simplify_product): Likewise.
4573         (gfc_simplify_sum): Likewise.
4575 2018-03-06  Steven G. Kargl  <kargl@gcc.gnu.org>
4577         PR fortran/56667
4578         * primary.c (match_sym_complex_part): Give the matcher for an implied
4579         do-loop a chance to run.
4581 2018-03-03  Harald Anlauf  <anlauf@gmx.de>
4583         PR fortran/71085
4584         * trans-expr.c (gfc_apply_interface_mapping_to_expr): Do not
4585         dereference NULL pointer.
4587 2018-03-03  Steven G. Kargl  <kargl@gcc.gnu.org>
4589         PR fortran/66128
4590         * simplify.c (is_size_zero_array): New function to check for size
4591         zero array.
4592         (gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
4593          gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
4594          gfc_simplify_minval, gfc_simplify_maxval, gfc_simplify_norm2,
4595          gfc_simplify_product, gfc_simplify_sum): Use it, and implement
4596         requirements from F2018.
4598 2018-03-03  Steven G. Kargl  <kargl@gcc.gnu.org>
4600         PR fortran/51434
4601         * simplify.c (gfc_simplify_transfer): Resolve mold.
4603 2018-03-03  Paul Thomas  <pault@gcc.gnu.org>
4605         PR fortran/80965
4606         * resolve.c (build_loc_call): Change symtree name from 'loc' to
4607         '_loc'.
4609 2018-03-01  Paul Thomas  <pault@gcc.gnu.org>
4611         PR fortran/84219
4612         * target-memory.c (gfc_interpret_derived): Assert that BT_VOID
4613         components are caf tokens.
4614         (gfc_target_interpret_expr): Treat BT_VOID expressions as
4615         integers.
4617 2018-03-01  Paul Thomas  <pault@gcc.gnu.org>
4619         PR fortran/84538
4620         * class.c (class_array_ref_detected): Remove the condition that
4621         there be no reference after the array reference.
4622         (find_intrinsic_vtab): Remove excess whitespace.
4623         * trans-array.c (gfc_conv_scalarized_array_ref): Rename 'tmp'
4624         as 'base and call build_class_array_ref earlier.
4626 2018-02-28  Paul Thomas  <pault@gcc.gnu.org>
4628         PR fortran/83901
4629         * trans-stmt.c (trans_associate_var): Make sure that the se
4630         expression is a pointer type before converting it to the symbol
4631         backend_decl type.
4633 2018-02-25  Steven G. Kargl  <kargl@gcc.gnu.org>
4635         PR fortran/83633
4636         * decl.c (variable_decl): Check that an explicit-shape-array with
4637         nonconstant bounds is allowed.
4639 2018-02-25  Paul Thomas  <pault@gcc.gnu.org>
4641         PR fortran/84523
4642         * trans-intrinsic.c (gfc_conv_allocated): If the argument se
4643         has a pre block, add it to the expression pre block.
4645 2018-02-25  Thomas Koenig  <tkoenig@gcc.gnu.org>
4647         PR fortran/78238
4648         * gfortran.h (gfc_integer_4_kind): Define.
4649         * resolve.c (resolve_select_type): Make sure that the
4650         kind of c->high is gfc_integer_4_kind.
4652 2018-02-24  Steven G. Kargl <kargl@gcc.gnu.org>
4654         PR fortran/30792
4655         * decl.c (gfc_match_data): Check for invalid substring in
4656         data-implied-do
4658 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
4660         * intrinsic.texi: Arguments to MATMUL cannot both be rank one.
4662 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
4664         PR fortran/84511
4665         * trans-io.c (transfer_expr): Deal with C_LOC in transfer statement.
4667 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
4669         PR fortran/84346
4670         * interface.c (compare_actual_formal): Issue error if keyword is
4671         used in a statement function.
4673 2018-02-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
4675         PR fortran/84506
4676         * trans-io.c (set_parameter_value_inquire): Adjust range check of
4677         negative unit values for kind=8 units to the kind=4 negative limit.
4679 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
4681         PR fortran/83149
4682         * trans-types.c (gfc_sym_type): Test sym->ns->proc_name before
4683         accessing its components.
4685 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
4687         PR fortran/83149
4688         * trans-decl.c (gfc_finish_var_decl): Test sym->ns->proc_name
4689         before accessing its components.
4691 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
4693         PR fortran/83148
4694         * trans-const.c : Clean up some whitespace issues.
4695         * trans-expr.c (gfc_conv_initializer): If an iso_c_binding
4696         derived type has a kind value of zero, set it to the default
4697         integer kind.
4699 2018-02-23  Janne Blomqvist  <jb@gcc.gnu.org>
4701         PR fortran/84519
4702         * trans-decl.c (gfc_build_builtin_function_decls): Add bool
4703         argument to stop and error stop decls.
4704         * trans-stmt.c (gfc_trans_stop): Add false value to argument
4705         lists.
4707 2018-02-22  Janne Blomqvist  <jb@gcc.gnu.org>
4709         PR 78534
4710         PR 84509
4711         * trans-decl.c (gfc_build_builtin_function_decls): Pass
4712         gfc_int8_type node to pause_numeric, size_type_node to
4713         pause_string.
4714         * trans-stmt.c (gfc_trans_pause): Likewise.
4716 2018-02-22  Janne Blomqvist  <jb@gcc.gnu.org>
4718         * gfortran.texi: Update Coarray API description.
4719         * trans-decl.c (gfc_build_builtin_function_decls): Use size_t for
4720         character lengths, int for exit codes.
4721         (generate_coarray_sym_init): Use size_t for character length.
4722         * trans-intrinsic.c (conv_co_collective): Likewise.
4723         * trans-stmt.c (gfc_trans_lock_unlock): Likewise.
4724         (gfc_trans_event_post_wait): Likewise.
4725         (gfc_trans_sync): Likewise.
4726         (gfc_trans_stop): Use size_t for character lengths, int for exit
4727         codes.
4729 2018-02-20  Thomas Koenig  <tkoenig@gcc.gnu.org>
4731         PR fortran/48890
4732         PR fortran/83823
4733         * primary.c (gfc_convert_to_structure_constructor):
4734         For a constant string constructor, make sure the length
4735         is correct.
4737 2018-02-19  Paul Thomas  <pault@gcc.gnu.org>
4739         PR fortran/83344
4740         PR fortran/83975
4741         * resolve.c (resolve_assoc_var): Rearrange the logic for the
4742         determination of the character length of associate names. If
4743         the associate name is missing a length expression or the length
4744         expression is not a constant and the target is not a variable,
4745         make the associate name allocatable and deferred length.
4746         * trans-decl.c (gfc_get_symbol_decl): Null the character length
4747         backend_decl for deferred length associate names that are not
4748         variables. Set 'length' to gfc_index_zero_node for character
4749         associate names, whose character length is a PARM_DECL.
4751 2018-02-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
4753         PR fortran/35339
4754         * frontend-passes.c (traverse_io_block): Remove workaround for
4755         PR 80945.
4757 2018-02-19  Andre Vehreschild  <vehre@gcc.gnu.org>
4759         * gfortran.texi: Document additional src/dst_type.  Fix some typos.
4760         * trans-decl.c (gfc_build_builtin_function_decls): Declare the new
4761         argument of _caf_*_by_ref () with * e { get, send, sendget }.
4762         * trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Add the type of the
4763         data referenced when generating a call to caf_get_by_ref ().
4764         (conv_caf_send): Same but for caf_send_by_ref () and
4765         caf_sendget_by_ref ().
4767 2018-02-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
4769         PR fortran/84389
4770         * io.c (check_format): Allow FMT_COLON.
4772 2018-02-18  Paul Thomas  <pault@gcc.gnu.org>
4774         PR fortran/80945
4775         * trans-array.c (gfc_conv_expr_descriptor): Set parmtype from
4776         the typenode in the case of deferred length characters.
4778 2018-02-17  Thomas Koenig  <tkoenig@gcc.gnu.org>
4780         PR fortran/84270
4781         * frontend-passes (scalarized_expr):  If the expression
4782         is an assumed size array, leave in the last reference
4783         and pass AR_SECTION instead of AR_FULL to gfc_resolve
4784         in order to avoid an error.
4786 2018-02-17  Paul Thomas  <pault@gcc.gnu.org>
4788         PR fortran/84115
4789         * resolve.c (resolve_assoc_var): If a non-constant target expr.
4790         has no string length expression, make the associate variable
4791         into a deferred length, allocatable symbol.
4792         * trans-decl.c (gfc_is_reallocatable_lhs): Add and use a ptr to
4793         the symbol.
4794         * trans-stmt.c (trans_associate_var): Null and free scalar
4795         associate names that are allocatable. After assignment, remove
4796         the allocatable attribute to prevent reallocation.
4798 2018-02-16  Jakub Jelinek  <jakub@redhat.com>
4800         PR fortran/84418
4801         * trans-openmp.c (gfc_trans_omp_clauses): For OMP_CLAUSE_LINEAR_REF
4802         kind set OMP_CLAUSE_LINEAR_STEP to TYPE_SIZE_UNIT times last_step.
4804 2018-02-16  Dominique d'Humieres  <dominiq@gcc.gnu.org>
4806         PR fortran/84354
4807         * decl.c (gfc_get_pdt_instance): Replace '%qs' with %qs.
4809 2018-02-15  Janus Weil  <janus@gcc.gnu.org>
4811         PR fortran/84409
4812         * interface.c (check_dtio_arg_TKR_intent): Add a check for character
4813         length.
4815 2018-02-14  Janus Weil  <janus@gcc.gnu.org>
4817         PR fortran/84385
4818         * match.c (gfc_match_select_type): Fix check for selector in
4819         SELECT TYPE statement.
4821 2018-02-13  Janus Weil  <janus@gcc.gnu.org>
4823         PR fortran/84313
4824         * symbol.c (check_conflict): Reject procedure pointers in common blocks.
4826 2018-02-13  Alastair McKinstry  <alastair.mckinstry@sceal.ie>
4827             Janne Blomqvist  <jb@gcc.gnu.org>
4829         * module.c (dump_module): Use lbasename to ensure that module
4830         files are reproducible.
4832 2018-02-12  Janus Weil  <janus@gcc.gnu.org>
4834         PR fortran/84273
4835         * resolve.c (resolve_component): Fix checks of passed argument in
4836         procedure-pointer components.
4838 2018-02-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
4840         PR fortran/35299
4841         * resolve.c (resolve_formal_arglist): Update error message.
4843 2018-02-11  Andre Vehreschild  <vehre@gcc.gnu.org>
4845         * gfortran.texi: Fix typos in documentation of caf_register ().
4846         * trans-array.c (structure_alloc_comps): Only register a component of
4847         a derived typed corray, not of an ultimate component coarray.
4849 2018-02-11  Steven G. Kargl  <kargl@gcc.gnu.org>
4851         PR fortran/54223
4852         PR fortran/84276
4853         * interface.c (compare_actual_formal): Add in_statement_function
4854         bool parameter.  Skip check of INTENT attribute for statement
4855         functions.  Arguments to a statement function cannot be optional,
4856         issue error for missing argument.
4857         (gfc_procedure_use, gfc_ppc_use, gfc_arglist_matches_symbol): Use
4858          in_statement_function.
4860 2018-02-11  Paul Thomas  <pault@gcc.gnu.org>
4862         PR fortran/84074
4863         * trans-expr.c (gfc_conv_derived_to_class): Set the use_offset
4864         flag. If the is a vector subscript or the expression is not a
4865         variable, make the descriptor one-based.
4867 2018-02-10  Paul Thomas  <pault@gcc.gnu.org>
4869         PR fortran/84141
4870         PR fortran/84155
4871         * trans-array.c (gfc_array_init_size): Revert the change made
4872         in revision 257356 setting the dtype.
4873         * trans-types.c (gfc_get_dtype): Do not use the cached dtype.
4874         Call gfc_get_dtype_rank_type every time.
4876         PR fortran/56691
4877         * trans-array.c (gfc_conv_expr_descriptor): If the source array
4878         is a descriptor type, use its offset, removing the condition
4879         that is be a class expression.
4881 2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>
4883         PR fortran/82994
4884         * match.c (gfc_match_deallocate): Check for NULL pointer.
4886 2018-02-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
4888         PR fortran/68560
4889         * trans-intrinsic.c (gfc_conv_intrinsic_shape): New function.
4890         (gfc_conv_intrinsic_function): Call it.
4892 2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>
4894         PR fortran/82049
4895         * match.c (gfc_match_type_spec): If the charlen is non-NULL, then
4896         try to resolve it.  While here return early if possible.
4898 2018-02-04  Paul Thomas  <pault@gcc.gnu.org>
4900         PR fortran/84115
4901         * trans-decl.c (gfc_get_symbol_decl): Do not finish the decl of
4902         'length' if the symbol charlen backend_decl is an indirect ref.
4904 2018-02-03  Paul Thomas  <pault@gcc.gnu.org>
4906         PR fortran/84141
4907         PR fortran/84155
4908         * trans-array.c (gfc_array_init_size): Instead of gfc_get_dtype
4909         use gfc_get_dtype_rank_type.
4911 2018-02-01  Janne Blomqvist  <jb@gcc.gnu.org>
4913         PR 83975
4914         PR 83344
4915         * resolve.c (resolve_assoc_var): Generate an error if
4916         target length unknown.
4918 2018-02-01  Janne Blomqvist  <jb@gcc.gnu.org>
4920         PR fortran/83705
4921         * simplify.c (gfc_simplify_repeat): Increase limit for deferring
4922         to runtime, print a warning message.
4924 2018-01-31  Jakub Jelinek  <jakub@redhat.com>
4926         PR fortran/84116
4927         * openmp.c (gfc_match_omp_clauses): If all the linear
4928         gfc_match_omp_variable_list calls failed, don't gfc_free_omp_namelist
4929         nor set *head = NULL.  Formatting fixes.
4931 2018-01-31  Paul Thomas  <pault@gcc.gnu.org>
4933         PR fortran/84088
4934         * trans-expr.c (gfc_conv_procedure_call): If the parm expr is
4935         an address expression passed to an assumed rank dummy, convert
4936         to an indirect reference.
4938 2018-01-31  Thomas Koenig  <tkoenig@gcc.gnu.org>
4940         * dump-parse-tree.c (write_proc): Use sym_name (which may
4941         be sym->binding_label) instead of sym->name.
4943 2018-01-31  Janne Blomqvist  <jb@gcc.gnu.org>
4945         * trans-const.c (gfc_conv_string_init): Use gfc_charlen_t instead
4946         of int for slen.
4948 2018-01-31  Janne Blomqvist  <jb@gcc.gnu.org>
4950         PR fortran/78534
4951         * trans-expr.c (fill_with_spaces): Use memset instead of
4952         generating loop.
4953         (gfc_trans_string_copy): Improve opportunity to use builtins with
4954         constant lengths.
4956 2018-01-30  Jakub Jelinek  <jakub@redhat.com>
4958         PR debug/84131
4959         * trans-array.c (gfc_get_descriptor_offsets_for_info): Set *data_off
4960         to DATA_FIELD's offset rather than OFFSET_FIELD's offset.
4962 2018-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
4964         PR fortran/84134
4965         * array.c (gfc_ref_dimen_size): Whitespace fixes.  If stride is
4966         zero, return false.
4968 2018-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
4970         PR fortran/84133
4971         * frontend-passes (matmul_to_var_expr): Return early if
4972         in association list.
4973         (inline_matmul_assign): Likewise.
4975 2017-01-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
4977         PR fortran/84073
4978         * resolve.c (resolve_component): Ensure BIND(C) character
4979         components have length one.
4980         (resolve_symbol): Likewise for variables.
4982 2018-01-27  Jakub Jelinek  <jakub@redhat.com>
4984         PR fortran/84065
4985         * decl.c (add_init_expr_to_sym): Ignore initializers for too large
4986         lengths.
4988 2018-01-26  Damian Rouson  <damian@sourceryinstitute.org>
4989             Alessandro Fanfarillo  <fanfarillo.gcc@gmail.com>
4990             Soren Rasmussen  <s.c.rasmussen@gmail.com>
4992         Partial support for Fortran 2018 teams features.
4994         * array.c (gfc_match_array_ref): add team attribute in coarray
4995         transfers.
4996         * check.c (gfc_check_get_team, gfc_check_team_number): add new
4997         functions for get_team and team_number.
4998         * dump-parse-tree.c (show_code_node): add new statements: form team,
4999         change team, end team, and sync team.
5000         * expr.c (gfc_find_team_co): add new function.
5001         * gfortran.h: add new statements.
5002         * intrinsic.c (add_functions): add get_team and team_number functions.
5003         * intrinsic.h: add get_team and team_number prototypes for check,
5004         simplify, and resolve.
5005         * iresolve.c (gfc_resolve_get_team, gfc_resolve_team_number): add new
5006         functions.
5007         * iso-fortran-env.def: add the team_type derived type.
5008         * match.c (gfc_match_if, gfc_match_form_team, gfc_match_team_number)
5009         (gfc_match_end_team, gfc_match_sync_team, gfc_match_change_team):
5010         add change team, end team, form team, sync team match and functions.
5011         * match.h: add new prototypes for change team, end team, form team,
5012         and sync team.
5013         * parse.c (decode_statement): add cases for change team, end team,
5014         form team, and sync team.
5015         * resolve.c: add cases for exec form team, change team, end team, and
5016         sync team.
5017         * simplify.c (gfc_simplify_get_team): add new function for get team.
5018         * st.c (gfc_free_statement): add cases exec for change team, end team,
5019         form team, sync team.
5020         * trans-decl.c (gfor_fndecl_caf_form_team)
5021         (gfor_fndecl_caf_change_team, gfor_fndecl_caf_end_team)
5022         (gfor_fndecl_caf_sync_team, gfor_fndecl_caf_get_team)
5023         (gfor_fndecl_caf_team_number): add functions and definitions.
5024         * trans-intrinsic.c (conv_caf_send, conv_intrinsic_team_number): add
5025         new function and team_type argument support.
5026         * trans-stmt.c (gfc_trans_form_team, gfc_trans_change_team)
5027         (gfc_trans_end_team, gfc_trans_sync_team): add new functions.
5028         * trans-stmt.h: add new prototypes.
5029         * trans-types.c (gfc_get_derived_type): check condition for team_type.
5030         * trans.c (trans_code): new exec cases for form team, change team, end
5031         team, and sync team.
5032         * trans.h: add new prototypes.
5034 2018-01-26  Steven G. Kargl  <kargl@gcc.gnu.org>
5036         PR fortran/83998
5037         * simplify.c (compute_dot_product):  Initialize result to INTEGER(1) 0
5038         or .false.  The summation does the correct type conversion.
5039         (gfc_simplify_dot_product): Special case zero-sized arrays.
5041 2018-25-01  Paul Thomas  <pault@gcc.gnu.org>
5043         PR fortran/37577
5044         * array.c (gfc_match_array_ref): If standard earlier than F2008
5045         it is an error if the reference dimension is greater than 7.
5046         libgfortran.h : Increase GFC_MAX_DIMENSIONS to 15. Change the
5047         dtype masks and shifts accordingly.
5048         * trans-array.c (gfc_conv_descriptor_dtype): Use the dtype
5049         type node to check the field.
5050         (gfc_conv_descriptor_dtype): Access the rank field of dtype.
5051         (duplicate_allocatable_coarray): Access the rank field of the
5052         dtype descriptor rather than the dtype itself.
5053         * trans-expr.c (get_scalar_to_descriptor_type): Store the type
5054         of 'scalar' on entry and use its TREE_TYPE if it is ARRAY_TYPE
5055         (ie. a character).
5056         (gfc_conv_procedure_call): Pass TREE_OPERAND (tmp,0) to
5057         get_scalar_to_descriptor_type if the actual expression is a
5058         constant.
5059         (gfc_trans_structure_assign): Assign the rank directly to the
5060         dtype rank field.
5061         * trans-intrinsic.c (gfc_conv_intrinsic_rank): Cast the result
5062         to default integer kind.
5063         (gfc_conv_intrinsic_sizeof): Obtain the element size from the
5064         'elem_len' field of the dtype.
5065         * trans-io.c (gfc_build_io_library_fndecls): Replace
5066         gfc_int4_type_node with dtype_type_node where necessary.
5067         (transfer_namelist_element): Use gfc_get_dtype_rank_type for
5068         scalars.
5069         * trans-types.c : Provide 'get_dtype_type_node' to acces the
5070         dtype_type_node and, if necessary, build it.
5071         The maximum size of an array element is now determined by the
5072         maximum value of size_t.
5073         Update the description of the array descriptor, including the
5074         type def for the dtype_type.
5075         (gfc_get_dtype_rank_type): Build a constructor for the dtype.
5076         Distinguish RECORD_TYPEs that are BT_DERIVED or BT_CLASS.
5077         (gfc_get_array_descriptor_base): Change the type of the dtype
5078         field to dtype_type_node.
5079         (gfc_get_array_descr_info): Get the offset to the rank field of
5080         the dtype.
5081         * trans-types.h : Add a prototype for 'get_dtype_type_node ()'.
5082         * trans.h : Define the indices of the dtype fields.
5084 2018-23-01  Paul Thomas  <pault@gcc.gnu.org>
5086         PR fortran/83866
5087         * decl.c (gfc_match_derived_decl): If eos not matched, recover
5088         and emit error about garbage after declaration.
5090 2018-23-01  Paul Thomas  <pault@gcc.gnu.org>
5092         PR fortran/83898
5093         * trans-stmt.c (trans_associate_var): Do not set cst_array_ctor
5094         for characters.
5096 2018-01-22  Janne Blomqvist  <jb@gcc.gnu.org>
5098         PR 78534
5099         PR 83704
5100         * arith.c (gfc_arith_concat): Use size_t for string length.
5101         (gfc_compare_string): Likewise.
5102         (gfc_compare_with_Cstring): Likewise.
5103         * array.c (gfc_resolve_character_array_constructor): Use
5104         HOST_WIDE_INT, gfc_mpz_get_hwi.
5105         * check.c (gfc_check_fe_runtime_error): Use size_t.
5106         * data.c (create_character_initializer): Use HOST_WIDE_INT,
5107         gfc_extract_hwi.
5108         * decl.c (gfc_set_constant_character_len): Use gfc_charlen_t.
5109         (add_init_expr_to_sym): Use HOST_WIDE_INT.
5110         * expr.c (gfc_build_init_expr): Use HOST_WIDE_INT,
5111         gfc_extract_hwi.
5112         (gfc_apply_init): Likewise.
5113         * match.h (gfc_set_constant_character_len): Update prototype.
5114         * primary.c (match_string_constant): Use size_t.
5115         * resolve.c (resolve_ordinary_assign): Use HOST_WIDE_INT,
5116         gfc_mpz_get_hwi.
5117         * simplify.c (init_result_expr): Likewise.
5118         (gfc_simplify_len_trim): Use size_t.
5119         * target-memory.c (gfc_encode_character): Use size_t.
5120         (gfc_target_encode_expr): Use HOST_WIDE_INT, gfc_mpz_get_hwi.
5121         (interpret_array): Use size_t.
5122         (gfc_interpret_character): Likewise.
5123         * target-memory.h (gfc_encode_character): Update prototype.
5124         (gfc_interpret_character): Likewise.
5125         (gfc_target_interpret_expr): Likewise.
5126         * trans-const.c (gfc_build_string_const): Use size_t for length
5127         argument.
5128         (gfc_build_wide_string_const): Likewise.
5129         * trans-const.h (gfc_build_string_const): Likewise.
5130         (gfc_build_wide_string_const): Likewise.
5132 2018-01-20  Steven G. Kargl  <kargl@gcc.gnu.org>
5134         PR fortran/83900
5135     * simplify.c (gfc_simplify_matmul): Set return type correctly.
5137 2018-01-19  Steven G. Kargl  <kargl@gcc.gnu.org>
5139         PR fortran/83900
5140         * simplify.c (gfc_simplify_matmul): Delete bogus assertion.
5142 2018-01-17  Harald Anlauf  <anlauf@gmx.de>
5144         PR fortran/83864
5145         * expr.c (add_init_expr_to_sym): Do not dereference NULL pointer.
5147 2018-01-17  Harald Anlauf  <anlauf@gmx.de>
5149         PR fortran/83874
5150         * decl.c (add_init_expr_to_sym): Do not dereference NULL pointer.
5152 2018-01-15  Louis Krupp  <louis.krupp@zoho.com>
5154         PR fortran/82257
5155         * interface.c (compare_rank): Don't try to retrieve CLASS_DATA
5156         from symbol marked unlimited polymorphic.
5157         * resolve.c (resolve_structure_cons): Likewise.
5158         * misc.c (gfc_typename): Don't dereference derived->components
5159         if it's NULL.
5161 2018-01-15  Thomas Koenig  <tkoenig@gcc.gnu.org>
5163         PR fortran/54613
5164         * gfortran.h (gfc_check_f): Rename f4ml to f5ml.
5165         (gfc_logical_4_kind): New macro
5166         * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument.
5167         (gfc_simplify_maxloc): Likewise.
5168         (gfc_resolve_maxloc): Likewise.
5169         (gfc_resolve_minloc): Likewise.
5170         * check.c (gfc_check_minloc_maxloc): Add checking for "back"
5171         argument; also raise error if it is used (for now). Add it
5172         if it isn't present.
5173         * intrinsic.c (add_sym_4ml): Rename to
5174         (add_sym_5ml), adjust for extra argument.
5175         (add_functions): Add "back" constant. Adjust maxloc and minloc
5176         for back argument.
5177         * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is
5178         not of gfc_logical_4_kind, convert.
5179         (gfc_resolve_minloc): Likewise.
5180         * simplify.c (gfc_simplify_minloc): Add back argument.
5181         (gfc_simplify_maxloc): Likewise.
5182         * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last
5183         argument to %VAL to ensure passing by value.
5184         (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc
5185         also for library calls.
5187 2018-01-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
5189         PR fortran/82007
5190         * resolve.c (resolve_transfer): Delete code looking for 'DT'
5191         format specifiers in format strings. Set formatted to true if a
5192         format string or format label is present.
5193         * trans-io.c (get_dtio_proc): Likewise. (transfer_expr): Fix
5194         whitespace.
5196 2018-01-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
5198         PR fortran/83744
5199         * dump-parse-tree.c (get_c_type_name): Remove extra line.
5200         Change for loop to use declaration in for loop. Handle BT_LOGICAL
5201         and BT_CHARACTER.
5202         (write_decl): Add where argument. Fix indentation. Replace
5203         assert with error message. Add typename to warning
5204         in comment.
5205         (write_type): Adjust locus to call of write_decl.
5206         (write_variable): Likewise.
5207         (write_proc): Likewise. Replace assert with error message.
5209 2018-01-13  Paul Thomas  <pault@gcc.gnu.org>
5211         PR fortran/52162
5212         * trans-expr.c (gfc_trans_scalar_assign): Flag is_alloc_lhs if
5213         the rhs expression is neither an elemental nor a conversion
5214         function.
5216         PR fortran/83622
5217         * trans-array.c (is_pointer_array): Remove unconditional return
5218         of false for -fopenmp.
5220 2018-01-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
5221         <emsr@gcc.gnu.org>
5223         PR fortran/83803
5224         * dump-parse-tree.c (write_proc): Always emit closing parenthesis
5225         for functions.
5227 2018-01-10  Steven G. Kargl  <kargl@gcc.gnu.org>
5229         PR fortran/82367
5230         * resolve.c (resolve_allocate_expr): Check for NULL pointer.
5232 2018-01-10  Steven G. Kargl  <kargl@gcc.gnu.org>
5234         PR fortran/83093
5235         * resolve.c (resolve_charlen): Check the type of cl->length
5236         after resolution.
5238 2018-01-10  Janne Blomqvist  <jb@gcc.gnu.org>
5240         PR fortran/83740
5241         * trans-array.c (gfc_trans_array_ctor_element): Fix formatting.
5243 2018-01-10  Janne Blomqvist  <jb@gcc.gnu.org>
5245         PR fortran/83740
5246         * trans-array.c (gfc_trans_array_ctor_element): Convert RHS to the
5247         LHS type when assigning.
5249 2018-01-09  Steven G. Kargl  <kargl@gcc.gnu.org>
5251         PR fortran/83742
5252         * expr.c (gfc_is_simply_contiguous): Check for NULL pointer.
5254 2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>
5256         * match.c (gfc_match_allocate): Check for NULL pointer.
5258 2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>
5260         * expr.c (gfc_check_pointer_assign): Fix typo in comment.
5262 2018-01-08  Paul Thomas  <pault@gcc.gnu.org>
5264         PR fortran/83611
5265         * decl.c (gfc_get_pdt_instance): If parameterized arrays have
5266         an initializer, convert the kind parameters and add to the
5267         component if the instance.
5268         * trans-array.c (structure_alloc_comps): Add 'is_pdt_type' and
5269         use it with case COPY_ALLOC_COMP. Call 'duplicate_allocatable'
5270         for parameterized arrays. Clean up typos in comments. Convert
5271         parameterized array initializers and copy into the array.
5272         * trans-expr.c (gfc_trans_scalar_assign): Do a deep copy for
5273         parameterized types.
5274         *trans-stmt.c (trans_associate_var): Deallocate associate vars
5275         as necessary, when they are PDT function results for example.
5277         PR fortran/83731
5278         * trans-array.c (structure_alloc_comps): Only compare len parms
5279         when they are declared explicitly.
5281 2018-01-06  Janne Blomqvist  <jb@gcc.gnu.org>
5283         PR fortran/50892
5284         * trans-expr.c (gfc_trans_pointer_assignment): fold_convert rhs to
5285         lhs type.
5287 2018-01-05  Janne Blomqvist  <jb@gcc.gnu.org>
5289         PR fortran/78534
5290         PR fortran/66310
5291         * array.c (got_charlen): Use gfc_charlen_int_kind.
5292         * class.c (gfc_find_derived_vtab): Use gfc_size_kind instead of
5293         hardcoded kind.
5294         (find_intrinsic_vtab): Likewise.
5295         * decl.c (match_char_length): Use gfc_charlen_int_kind.
5296         (add_init_expr_to_sym): Use gfc_charlen_t and gfc_charlen_int_kind.
5297         (gfc_match_implicit): Use gfc_charlen_int_kind.
5298         * dump-parse-tree.c (show_char_const): Use gfc_charlen_t and size_t.
5299         (show_expr): Use HOST_WIDE_INT_PRINT_DEC.
5300         * expr.c (gfc_get_character_expr): Length parameter of type
5301         gfc_charlen_t.
5302         (gfc_get_int_expr): Value argument of type HOST_WIDE_INT.
5303         (gfc_extract_hwi): New function.
5304         (simplify_const_ref): Make string_len of type gfc_charlen_t.
5305         (gfc_simplify_expr): Use HOST_WIDE_INT for substring refs.
5306         * frontend-passes.c (optimize_trim): Use gfc_charlen_int_kind.
5307         * gfortran.h (gfc_mpz_get_hwi): New prototype.
5308         (gfc_mpz_set_hwi): Likewise.
5309         (gfc_charlen_t): New typedef.
5310         (gfc_expr): Use gfc_charlen_t for character lengths.
5311         (gfc_size_kind): New extern variable.
5312         (gfc_extract_hwi): New prototype.
5313         (gfc_get_character_expr): Use gfc_charlen_t for character length.
5314         (gfc_get_int_expr): Use HOST_WIDE_INT type for value argument.
5315         * gfortran.texi: Update description of hidden string length argument.
5316         * iresolve.c (check_charlen_present): Use gfc_charlen_int_kind.
5317         (gfc_resolve_char_achar): Likewise.
5318         (gfc_resolve_repeat): Pass string length directly without
5319         temporary, use gfc_charlen_int_kind.
5320         (gfc_resolve_transfer): Use gfc_charlen_int_kind.
5321         * match.c (select_intrinsic_set_tmp): Use HOST_WIDE_INT for charlen.
5322         * misc.c (gfc_mpz_get_hwi): New function.
5323         (gfc_mpz_set_hwi): New function.
5324         * module.c (atom_int): Change type from int to HOST_WIDE_INT.
5325         (parse_integer): Don't complain about large integers.
5326         (write_atom): Use HOST_WIDE_INT for integers.
5327         (mio_integer): Handle integer type mismatch.
5328         (mio_hwi): New function.
5329         (mio_intrinsic_op): Use HOST_WIDE_INT.
5330         (mio_array_ref): Likewise.
5331         (mio_expr): Likewise.
5332         * primary.c (match_substring): Use gfc_charlen_int_kind.
5333         * resolve.c (resolve_substring_charlen): Use gfc_charlen_int_kind.
5334         (resolve_character_operator): Likewise.
5335         (resolve_assoc_var): Likewise.
5336         (resolve_select_type): Use HOST_WIDE_INT for charlen, use snprintf.
5337         (resolve_charlen): Use mpz_sgn to determine sign.
5338         * simplify.c (gfc_simplify_repeat): Use HOST_WIDE_INT/gfc_charlen_t
5339         instead of long.
5340         * symbol.c (generate_isocbinding_symbol): Use gfc_charlen_int_kind.
5341         * target-memory.c (size_character): Length argument of type
5342         gfc_charlen_t.
5343         (gfc_encode_character): Likewise.
5344         (gfc_interpret_character): Use gfc_charlen_t.
5345         * target-memory.h (gfc_encode_character): Modify prototype.
5346         * trans-array.c (gfc_trans_array_ctor_element): Use existing type.
5347         (get_array_ctor_var_strlen): Use gfc_conv_mpz_to_tree_type.
5348         (trans_array_constructor): Use existing type.
5349         (get_array_charlen): Likewise.
5350         * trans-const.c (gfc_conv_mpz_to_tree_type): New function.
5351         * trans-const.h (gfc_conv_mpz_to_tree_type): New prototype.
5352         * trans-decl.c (gfc_trans_deferred_vars): Use existing type.
5353         (add_argument_checking): Likewise.
5354         * trans-expr.c (gfc_class_len_or_zero_get): Build const of type
5355         gfc_charlen_type_node.
5356         (gfc_conv_intrinsic_to_class): Use gfc_charlen_int_kind instead of
5357         4, fold_convert to correct type.
5358         (gfc_conv_class_to_class): Build const of type size_type_node for
5359         size.
5360         (gfc_copy_class_to_class): Likewise.
5361         (gfc_conv_string_length): Use same type in expression.
5362         (gfc_conv_substring): Likewise, use HOST_WIDE_INT for charlen.
5363         (gfc_conv_string_tmp): Make sure len is of the right type.
5364         (gfc_conv_concat_op): Use same type in expression.
5365         (gfc_conv_procedure_call): Likewise.
5366         (fill_with_spaces): Comment out memset() block due to spurious
5367         -Wstringop-overflow warnings.
5368         (gfc_trans_string_copy): Use gfc_charlen_type_node.
5369         (alloc_scalar_allocatable_for_subcomponent_assignment):
5370         fold_convert to right type.
5371         (gfc_trans_subcomponent_assign): Likewise.
5372         (trans_class_vptr_len_assignment): Build const of correct type.
5373         (gfc_trans_pointer_assignment): Likewise.
5374         (alloc_scalar_allocatable_for_assignment): fold_convert to right
5375         type in expr.
5376         (trans_class_assignment): Build const of correct type.
5377         * trans-intrinsic.c (gfc_conv_associated): Likewise.
5378         (gfc_conv_intrinsic_repeat): Do calculation in sizetype.
5379         * trans-io.c (gfc_build_io_library_fndecls): Use
5380         gfc_charlen_type_node for character lengths.
5381         (set_string): Convert to right type in assignment.
5382         * trans-stmt.c (gfc_trans_label_assign): Build const of
5383         gfc_charlen_type_node.
5384         (trans_associate_var): Likewise.
5385         (gfc_trans_character_select): Likewise.
5386         (gfc_trans_allocate): Likewise, don't typecast strlen result.
5387         (gfc_trans_deallocate): Don't typecast strlen result.
5388         * trans-types.c (gfc_size_kind): New variable.
5389         (gfc_init_types): Determine gfc_charlen_int_kind and gfc_size_kind
5390         from size_type_node.
5391         * trans-types.h: Fix comment.
5393 2018-01-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
5395         PR fortran/83683
5396         PR fortran/45689
5397         * check.c (gfc_check_eoshift): Check for string length and
5398         for conformance of boundary.
5399         * intrinsic.c (add_functions): Add gfc_simplify_eoshift.
5400         * intrinsic.h: Add prototype for gfc_simplify_eoshift.
5401         * simplify.c (gfc_simplify_eoshift): New function.
5403 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5404             Alan Hayward  <alan.hayward@arm.com>
5405             David Sherwood  <david.sherwood@arm.com>
5407         * trans-types.c (gfc_type_for_mode): Handle MODE_VECTOR_BOOL.
5409 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5410             Alan Hayward  <alan.hayward@arm.com>
5411             David Sherwood  <david.sherwood@arm.com>
5413         * trans-types.c (gfc_type_for_mode): Check valid_vector_subparts_p.
5415 2018-01-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
5417         PR fortran/83664
5418         * check.c (gfc_check_eoshift): Error for missing boundary if array
5419         is not one of the standard types.
5421 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
5423         Update copyright years.
5425         * gfortranspec.c (lang_specific_driver): Update copyright notice
5426         dates.
5427         * gfc-internals.texi: Bump @copying's copyright year.
5428         * gfortran.texi: Ditto.
5429         * intrinsic.texi: Ditto.
5430         * invoke.texi: Ditto.
5432 2017-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
5434         PR fortran/45689
5435         * intrinsic.c (add_function): Add gfc_simplify_maxloc and
5436         gfc_simplify_minloc to maxloc and minloc, respectively.
5437         * intrinsic.h: Add prototypes for gfc_simplify_minloc
5438         and gfc_simplify_maxloc.
5439         * simplify.c (min_max_chose): Adjust prototype.  Modify function
5440         to have a return value which indicates if the extremum was found.
5441         (is_constant_array_expr): Fix typo in comment.
5442         (simplify_minmaxloc_to_scalar): New function.
5443         (simplify_minmaxloc_nodim): New function.
5444         (new_array): New function.
5445         (simplify_minmaxloc_to_array): New function.
5446         (gfc_simplify_minmaxloc): New function.
5447         (simplify_minloc): New function.
5448         (simplify_maxloc): New function.
5450 2018-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
5452         PR fortran/45689
5453         PR fortran/83650
5454         * simplify.c (gfc_simplify_cshift): Re-implement to allow full
5455         range of arguments.
5457 2018-01-01  Paul Thomas  <pault@gcc.gnu.org>
5459         PR fortran/83076
5460         * resolve.c (resolve_fl_derived0): Add caf_token fields for
5461         allocatable and pointer scalars, when -fcoarray selected.
5462         * trans-types.c (gfc_copy_dt_decls_ifequal): Copy the token
5463         field as well as the backend_decl.
5464         (gfc_get_derived_type): Flag GFC_FCOARRAY_LIB for module
5465         derived types that are not vtypes. Components with caf_token
5466         attribute are pvoid types. For a component requiring it, find
5467         the caf_token field and have the component token field point to
5468         its backend_decl.
5470         PR fortran/83319
5471         *trans-types.c (gfc_get_array_descriptor_base): Add the token
5472         field to the descriptor even when codimen not set.
5474 Copyright (C) 2018 Free Software Foundation, Inc.
5476 Copying and distribution of this file, with or without modification,
5477 are permitted in any medium without royalty provided the copyright
5478 notice and this notice are preserved.