Correct the reported line number in Fortran combined OpenACC directives
[official-gcc.git] / gcc / fortran / ChangeLog
blobe74bda7a1362dce345ad92a467f0e4d2eeecb834
1 2018-12-09  Cesar Philippidis  <cesar@codesourcery.com>
3         * trans-openmp.c (gfc_trans_oacc_combined_directive): Set the
4         location of combined acc loops.
6 2018-12-09  Thomas Schwinge  <thomas@codesourcery.com>
8         * openmp.c (resolve_oacc_loop_blocks): Remove checking of OpenACC
9         loop clauses.
11         PR fortran/88420
12         * openmp.c (resolve_oacc_loop_blocks): Remove "Clause SEQ
13         conflicts with INDEPENDENT" diagnostic.
15 2018-12-08  Steven G. Kargl  <kargl@gcc.gnu.org>
17         PR fortran/88048
18         * resolve.c (check_data_variable): Named constant cannot be a
19         data object.
21 2018-12-08  Steven G. Kargl  <kargl@gcc.gnu.org>
23         PR fortran/87945
24         * decl.c (var_element): Inquiry parameters cannit be data objects.
26 2018-12-08  Steven G. Kargl  <kargl@gcc.gnu.org>
28         PR fortran/88025
29         * expr.c (gfc_apply_init):  Remove asserts that cannot trigger.
30         Check for a NULL pointer.
32 2018-12-08  Steven G. Kargl  <kargl@gcc.gnu.org>
34         PR fortran/88357
35         * class.c (insert_component_ref): Check for NULL pointer and 
36         previous error message issued.
37         * parse.c (parse_associate): Check for NULL pointer.
38         * resolve.c (resolve_assoc_var): Check for NULL pointer.
40 2018-12-07  Jakub Jelinek  <jakub@redhat.com>
42         PR fortran/88377
43         * trans-openmp.c (gfc_omp_clause_default_ctor,
44         gfc_omp_clause_copy_ctor, gfc_omp_clause_assign_op,
45         gfc_omp_clause_linear_ctor, gfc_omp_clause_dtor): Only consider
46         GFC_DECL_GET_SCALAR_ALLOCATABLE vars as scalar allocatables if they
47         have pointer type.
49 2018-12-03  Fritz Reese  <fritzoreese@gmail.com>
50             Mark Eggleston  <mark.eggleston@codethink.co.uk>
52         PR fortran/87919
53         * options.c (SET_FLAG, SET_BITFLAG, SET_BITFLAG2): New macros.
54         (set_dec_flags): Set/unset DEC and std flags according to value.
55         (post_dec_flags, set_init_local_zero): New functions.
56         (gfc_init_options): Use set_init_local_zero and post_dec_flags.
57         (gfc_handle_options) <case OPT_fcheck_array_temporaries>: Use
58         SET_BITFLAG.
59         <case OPT_finit_local_zero>: Use set_init_local_zero.
60         <case OPT_fdec>: Pass value to set_dec_flags.
61         <case OPT_fdec_structure>: Remove.
63 2018-11-30  Thomas Schwinge  <thomas@codesourcery.com>
65         * gfortran.h (struct gfc_omp_clauses): Remove "wait".  Adjust all
66         users.
68         * openmp.c (gfc_match_omp_clauses): Support multiple OpenACC wait
69         clauses.
71 2018-11-27  Martin Liska  <mliska@suse.cz>
73         * decl.c (gfc_match_gcc_builtin): New function.
74         * gfortran.h (struct vect_builtin_tuple): New.
75         (gfc_adjust_builtins): Likewise.
76         * lang-specs.h (TARGET_F951_OPTIONS): New.
77         (F951_OPTIONS): Use it.
78         * lang.opt: Add new option -fpre-include.
79         * match.h (gfc_match_gcc_builtin): Declare new function.
80         * parse.c (decode_gcc_attribute): Handle builtin.
81         (parse_progunit): Call gfc_adjust_builtins.
82         * scanner.c (gfc_new_file): Load pre-included header file
83         when provided.
84         * trans-intrinsic.c (add_simd_flag_for_built_in): New.
85         (gfc_adjust_builtins): Likewise.
87 2018-11-24  Paul Thomas  <pault@gcc.gnu.org>
89         PR fortran/88143
90         * resolve.c (resolve_variable): Check for associate names with
91         NULL target.
93 2018-11-23  Jakub Jelinek  <jakub@redhat.com>
95         * lang.opt (fpad-source): New option.
96         * scanner.c (load_line): Don't pad fixed form lines if
97         !flag_pad_source.
98         * invoke.texi (-fno-pad-source): Document.
100 2018-11-21  Jakub Jelinek  <jakub@redhat.com>
102         * invoke.texi (-fdec-include): Document.
104 2018-11-21  Jakub Jelinek  <jakub@redhat.com>
105             Mark Eggleston  <mark.eggleston@codethink.com>
107         * lang.opt (fdec-include): New option.
108         * options.c (set_dec_flags): Set also flag_dec_include.
109         * scanner.c (include_line): Change return type from bool to int.
110         In fixed form allow spaces in between include keyword letters.
111         For -fdec-include, allow in fixed form 0 in column 6.  With
112         -fdec-include return -1 if the parsed line is not full include
113         statement and it could be successfully completed on continuation
114         lines.
115         (include_stmt): New function.
116         (load_file): Adjust include_line caller.  If it returns -1, keep
117         trying include_stmt until it stops returning -1 whenever adding
118         further line of input.
120 2018-11-18  Thomas Koenig  <tkoenig@gcc.gnu.org>
122         PR fortran/88073
123         * frontend-passes.c (combine_array_constructor): Do not do
124         anything if in a WHERE statement.
126 2018-11-18  Thomas Koenig  <tkoenig@gcc.gnu.org>
128         PR fortran/70260
129         * expr.c (gfc_check_assign): Reject assigning to an external
130         symbol.
131         (gfc_check_pointer_assign): Add suppress_type_test
132         argument. Insert line after if. A non-proc pointer can not point
133         to a constant.  Only check types if suppress_type_test is false.
134         * gfortran.h (gfc_check_pointer_assign): Add optional
135         suppress_type_test argument.
136         * resolve.c (gfc_resolve_code):  Move up gfc_check_pointer_assign
137         and give it the extra argument.
138         (resolve_fl_procedure): Set error on value for a function with
139         an inizializer.
141 2018-11-15  David Malcolm  <dmalcolm@redhat.com>
143         PR other/19165
144         * error.c (gfc_diagnostic_finalizer): Add diagnostic_t param.
146 2018-11-13  David Malcolm  <dmalcolm@redhat.com>
148         * cpp.c: Replace "source_location" with "location_t".
149         * gfortran.h: Likewise.
151 2018-11-08  Jakub Jelinek  <jakub@redhat.com>
153         * trans-openmp.c (gfc_trans_omp_clauses): Use
154         OMP_CLAUSE_DEFAULTMAP_SET_KIND.
155         (gfc_trans_omp_atomic): Set OMP_ATOMIC_MEMORY_ORDER
156         rather than OMP_ATOMIC_SEQ_CST.
157         (gfc_trans_omp_taskgroup): Build OMP_TASKGROUP using
158         make_node instead of build1_loc.
159         * types.def (BT_FN_VOID_BOOL, BT_FN_VOID_SIZE_SIZE_PTR,
160         BT_FN_UINT_UINT_PTR_PTR, BT_FN_UINT_OMPFN_PTR_UINT_UINT,
161         BT_FN_BOOL_UINT_LONGPTR_LONG_LONG_LONGPTR_LONGPTR_PTR_PTR,
162         BT_FN_BOOL_UINT_ULLPTR_LONG_ULL_ULLPTR_ULLPTR_PTR_PTR,
163         BT_FN_BOOL_LONG_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR_PTR_PTR,
164         BT_FN_BOOL_BOOL_ULL_ULL_ULL_LONG_ULL_ULLPTR_ULLPTR_PTR_PTR): New.
165         (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_PTR): Formatting fix.
167 2018-11-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
169         PR fortran/46020
170         * decl.c (verify_bind_c_sym): Remove unnecessary space
171         in error message.
173 2018-11-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
175         PR fortran/87782
176         * frontend-passes.c (constant_string_length): If there is a
177         substring with a length which cannot be reduced to a constant,
178         return NULL.
180 2018-11-01  Paul Thomas  <pault@gcc.gnu.org>
182         PR fortran/40196
183         * dependency.c (are_identical_variables): Return false if the
184         inquiry refs are not the same.
185         (gfc_ref_needs_temporary_p): Break on an inquiry ref.
186         * dump_parse_tree.c (show_ref): Show the inquiry ref type.
187         * expr.c (gfc_free_ref_list): Break on an inquiry ref.
188         (gfc_copy_ref): Copy the inquiry ref types.
189         (find_inquiry_ref): New function.
190         (simplify_const_ref, simplify_ref_chain): Call it. Add new arg
191         to simplify_ref_chain.
192         (gfc_simplify_expr): Use the new arg in call to
193         simplify_ref_chain.
194         (gfc_get_full_arrayspec_from_expr, gfc_is_coarray): Break on
195         inquiry ref.
196         (gfc_traverse_expr): Return true for inquiry ref.
197         * frontend-passes.c (gfc_expr_walker): Break on inquiry ref.
198         * gfortran.h : Add enums and union member in gfc_ref to
199         implement inquiry refs.
200         * intrinsic.c : Fix white nois.
201         * match.c (gfc_match_assignment): A constant lavlue is an
202         error.
203         * module.c : Add DECL_MIO_NAME for inquiry_type and the mstring
204         for inquiry_types.
205         (mio_ref): Handle inquiry refs.
206         * primary.c (is_inquiry_ref): New function.
207         (gfc_match_varspec): Handle inquiry refs calling new function.
208         (gfc_variable_attr): Detect inquiry ref for disambiguation
209         with components.
210         (caf_variable_attr): Treat inquiry and substring refs in the
211         same way.
212         * resolve.c (find_array_spec): ditto.
213         (gfc_resolve_substring_charlen): If there is neither a charlen
214         ref not an inquiry ref, return.
215         (resolve_ref): Handle inqiry refs as appropriate.
216         (resolve_allocate_expr): Entities with an inquiry ref cannot be
217         allocated.
218         * simplify.c (simplify_bound, simplify_cobound): Punt on
219         inquiry refs.
220         * trans-array.c (get_array_ctor_var_strlen): Break on inquiry
221         ref.
222         *trans-expr.c (conv_inquiry): New function.
223         (gfc_conv_variable): Retain the last typespec to pass to
224         conv_inquiry on detecting an inquiry ref.
226 2018-11-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
228         PR fortran/46020
229         * decl.c (verify_bind_c_sym): Improve error message.
231 2018-11-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
233         PR fortran/54613
234         * gfortran.texi (File format of unformatted sequential files):
235         Replace random comma with period.
236         * intrinsic.texi (Intrinsic Procedures): Add FINDLOC to menu.
237         (FINDLOC): Document.
238         (MAXLOC): Add refrence to FINDLOC.
239         (MINLOC): Likewise.
241 2018-10-31  Nathan Sidwell  <nathan@acm.org>
243         * cpp.c (gfc_cpp_init): Adjust cpp_force_token_locations call.
245 2018-10-31  Martin Liska  <mliska@suse.cz>
247         * trans-decl.c (struct module_hasher): Call htab_hash_string
248         for s->name and not for s.
250 2018-10-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
252         PR fortran/85896
253         * simplify.c (simplify_min_max): Do not convert the type of the
254         return expression.
256 2017-10-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
258         PR fortran/54613
259         * gfortran.h (gfc_isym_id): Add GFC_ISYM_FINDLOC.
260         (gfc_check_f): Add f6fl field.
261         (gfc_simplify_f): Add f6 field.
262         (gfc_resolve_f): Likewise.
263         (gfc_type_letter): Add optional logical_equas_int flag.
264         * check.c (intrinsic_type_check): New function.
265         (gfc_check_findloc): New function.
266         * intrinsics.c (gfc_type_letter): If logical_equals_int is
267         set, act accordingly.
268         (add_sym_5ml):  Reformat comment.
269         (add_sym_6fl): New function.
270         (add_functions): Add findloc.
271         (check_arglist): Add sixth argument, handle it.
272         (resolve_intrinsic): Likewise.
273         (check_specific): Handle findloc.
274         * intrinsic.h (gfc_check_findloc): Add prototype.
275         (gfc_simplify_findloc): Likewise.
276         (gfc_resolve_findloc): Likewise.
277         (MAX_INTRINSIC_ARGS): Adjust.
278         * iresolve.c (gfc_resolve_findloc): New function.
279         * simplify.c (gfc_simplify_minmaxloc): Make static.
280         (simplify_findloc_to_scalar): New function.
281         (simplify_findloc_nodim): New function.
282         (simplify_findloc_to_array): New function.
283         (gfc_simplify_findloc): New function.
284         (gfc_conv_intrinsic_findloc): New function.
285         (gfc_conv_intrinsic_function): Handle GFC_ISYM_FINDLOC.
286         (gfc_is_intrinsic_libcall): Likewise.
288 2018-10-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
290         PR fortran/86907
291         * frontend-passes.c (check_locus_code): Add information that
292         warning about missing location information points to an
293         inconsisten internal state.
294         (check_locus_expr): Likewise.
296 2018-10-25  Jakub Jelinek  <jakub@redhat.com>
298         PR fortran/87725
299         * openmp.c (gfc_match_omp_clauses): Parse simd, monotonic and
300         nonmonotonic modifiers regardless of if they have been parsed
301         already or if the opposite one has.  Fix up check whether
302         comma after modifier should be parsed.
303         (resolve_omp_clauses): Diagnose schedule modifier restrictions.
305 2018-10-23  Paul Thomas  <pault@gcc.gnu.org>
307         PR fortran/85603
308         * frontend-passes.c (get_len_call): New function to generate a
309         call to intrinsic LEN.
310         (create_var): Use this to make length expressions for variable
311         rhs string lengths.
312         Clean up some white space issues.
314 2018-10-21  Paul Thomas  <pault@gcc.gnu.org>
316         PR fortran/71880
317         * trans-expr.c (gfc_trans_pointer_assignment): Set the string
318         length for array valued deferred length lhs.
320 2018-10-18  Tobias Burnus  <burnus@net-b.de>
322         PR fortran/87625
323         * trans-array.c (gfc_is_reallocatable_lhs): Detect allocatable
324         polymorphic arrays.
326 2018-10-18  Paul Thomas  <pault@gcc.gnu.org>
328         PR fortran/58618
329         * trans-stmt.c (trans_associate_var): All strings that return
330         as pointer types can be assigned directly to the associate
331         name so remove 'attr' and the condition that uses it.
333 2018-10-18  Paul Thomas  <pault@gcc.gnu.org>
335         PR fortran/58618
336         * trans-decl.c (gfc_get_symbol_decl): Deal correctly with the
337         initialization with NULL() of a deferred length pointer.
339 2018-10-17  Tobias Burnus  <burnus@net-b.de>
341         PR fortran/87632
342         * resolve.c (resolve_select_type): Use correct variable.
344 2018-10-17  David Malcolm  <dmalcolm@redhat.com>
346         * Make-lang.in (selftest-fortran): New.
348 2018-10-17  Paul Thomas  <pault@gcc.gnu.org>
350         PR fortran/56386
351         PR fortran/58906
352         PR fortran/77385
353         PR fortran/80260
354         PR fortran/82077
355         * resolve.c (resolve_variable): Fix up expressions with array
356         associate names, where the parser did not detect that this is
357         array and there was no array part_ref in the expression.
359 2018-10-16  Tobias Burnus  <burnus@net-b.de>
361         PR fortran/67125
362         * trans-array.c (gfc_array_init_size, gfc_array_allocate):
363         Rename argument e3_is_array_constr to e3_has_nodescriptor
364         and update comments.
365         * trans-stmt.c (gfc_trans_allocate): Also fix lower bound
366         to 1 for nonalloc/nonpointer func results/vars besides
367         array constructors.
369 2018-10-16  Tobias Burnus  <burnus@net-b.de>
371         PR fortran/87556
372         * trans-stmt.c (form_team, change_team, sync_team):
373         Don't ignore argse.pre/argse.post.
375 2018-10-15  Paul Thomas  <pault@gcc.gnu.org>
376         Tobias Burnus  <burnus@gcc.gnu.org>
378         PR fortran/87566
379         * resolve.c (resolve_assoc_var): Add missing array spec for
380         class associate names.
381         (resolve_select_type): Handle case where last typed component
382         of the selector has a different type to the expression.
383         * trans-expr.c (gfc_find_and_cut_at_last_class_ref): Replace
384         call to gfc_expr_to_initialize with call to gfc_copy_expr.
385         (gfc_conv_class_to_class): Guard assignment to 'len' field
386         against case where zero constant is supplied.
388 2018-10-12  Tobias Burnus  <burnus@net-b.de>
390         PR fortran/87597
391         * expr.c (gfc_simplify_expr): Avoid simplifying
392         the 'array' argument to lbound/ubound/lcobound/
393         ucobound.
395 2018-10-12  Tobias Burnus <burnus@net-b.de>
397         PR fortran/58787
398         * decl.c (get_proc_name): Return with error before
399         creating sym_tree.
401 2018-10-11  Tobias Burnus <burnus@net-b.de>
403         Revert:
404         2018-10-09  Tobias Burnus <burnus@net-b.de>
406         PR fortran/83522
407         * resolve.c (resolve_ref): Reject nonscalar
408         substring references.
410 2018-10-09  David Malcolm  <dmalcolm@redhat.com>
412         * cpp.c (gfc_cpp_init_0): Update for renamings.
413         (cb_cpp_error): Rename to...
414         (cb_cpp_diagnostic): ...this, converting level and reason to
415         enums.
417 2018-10-09  Tobias Burnus <burnus@net-b.de>
419         PR fortran/83522
420         * resolve.c (resolve_ref): Reject nonscalar
421         substring references.
423 2018-10-09  Paul Thomas  <pault@gcc.gnu.org>
425         PR fortran/87151
426         * trans-array.c (gfc_get_array_span): Deal with deferred char
427         array components having a TYPE_MAX_VALUE of zero.
428         (gfc_array_init_size): Use the hidden string length component
429         to build the descriptor dtype.
430         (gfc_array_allocate): Remove the erroneous replacement of the
431         charlen backend decl with a temporary.
432         (gfc_conv_expr_descriptor): Use the ss_info string length in
433         the case of deferred character components.
434         (gfc_alloc_allocatable_for_assignment): Actually compare the
435         string lengths for deferred characters. Make sure that kind > 1
436         is handled correctly. Set the span field of the descriptor.
437         * trans-intrinsic.c (gfc_conv_intrinsic_len): Remove the stupid
438         comment.
440         PR fortran/80931
441         * trans-array.c (gfc_array_allocate): Set the span field for
442         variable length character arrays.
444 2018-10-08  Cesar Philippidis  <cesar@codesourcery.com>
446         * expr.c (gfc_check_pointer_assign): Demote "Assignment to
447         contiguous pointer from non-contiguous target" to a warning.
449 2018-10-08  Paul Thomas  <pault@gcc.gnu.org>
451         PR fortran/86372
452         * trans-stmt.c (trans_associate_var): Character associate names
453         with variable string length do not have to be deferred length
454         for the string length to be set, if variable.
456 2018-10-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
458         PR fortran/86111
459         * gfortran.h (enum arith): Add ARITH_WRONGCONCAT.
460         * arith.h (gfc_arith_error): Issue error for ARITH_WRONGCONCAT.
461         (gfc_arith_concat):  If the types of op1 and op2 are not
462         character of if their kinds do not match, issue ARITH_WRONGCONCAT.
464 2018-10-06  Paul Thomas  <pault@gcc.gnu.org>
466         PR fortran/83999
467         * resolve.c (resolve_fl_procedure): Include class functions in
468         the test that elemental function results be scalar.
470 2018-10-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
472         PR fortran/84640
473         * simplify.c (gfc_simplify_cshift): Extend size of hs_ex and ss_ex
474         by one. Set extents one past the array boundaries to zero to avoid
475         warning with instrumented compiler.
476         (gfc_simplify_eoshift): Likewise, only for ss_ex.
478 2018-10-05  Paul Thomas  <pault@gcc.gnu.org>
480         PR fortran/87487
481         * trans-decl.c (gfc_get_symbol_decl): Make sure that deferred
482         character length pointer initializer has the right type to fix
483         problem with deferred_character_24.f90 on big endian.
485 2018-10-03  Jeff Law  <law@redhat.comg>
487         * trans-types.c (get_typenode_from_name): Moved into gcc/tree.c.
489 2018-10-01  Paul Thomas  <pault@gcc.gnu.org>
491         PR fortran/65677
492         * trans-expr.c (gfc_trans_assignment_1): Set the 'identical'
493         flag in the call to gfc_check_dependency.
495 2018-09-30  Paul Thomas  <pault@gcc.gnu.org>
497         PR fortran/87359
498         * trans-array.c (gfc_is_reallocatable_lhs): Correct the problem
499         introduced by r264358, which prevented components of associate
500         names from being reallocated on assignment.
502 2018-09-30  Paul Thomas  <pault@gcc.gnu.org>
504         PR fortran/70752
505         PR fortran/72709
506         * trans-array.c (gfc_conv_scalarized_array_ref): If this is a
507         deferred type and the info->descriptor is present, use the
508         info->descriptor
509         (gfc_conv_array_ref): Is the se expr is a descriptor type, pass
510         it as 'decl' rather than the symbol backend_decl.
511         (gfc_array_allocate): If the se string_length is a component
512         reference, fix it and use it for the expression string length
513         if the latter is not a variable type. If it is a variable do
514         an assignment. Make use of component ref string lengths to set
515         the descriptor 'span'.
516         (gfc_conv_expr_descriptor): For pointer assignment, do not set
517         the span field if gfc_get_array_span returns zero.
518         * trans.c (get_array_span): If the upper bound a character type
519         is zero, use the descriptor span if available.
521 2018-09-30  Paul Thomas  <pault@gcc.gnu.org>
523         PR fortran/70149
524         * trans-decl.c (gfc_get_symbol_decl): A deferred character
525         length pointer that is initialized needs the string length to
526         be initialized as well.
528 2018-09-29  Paul Thomas  <pault@gcc.gnu.org>
530         PR fortran/65677
531         * trans-expr.c (gfc_trans_assignment_1): If there is dependency
532         fix the rse stringlength.
534 2018-09-25  Martin Liska  <mliska@suse.cz>
536         PR fortran/87394
537         * decl.c (add_hidden_procptr_result): Simplify condition
538         as we are in branch witch 'case1 || case2'.
540 2018-09-25  Martin Liska  <mliska@suse.cz>
542         * trans.c (remove_suffix): Remove
543         unused function.
545 2018-09-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
547         PR fortran/87397
548         * gfc_conv_procedure_call: Do not add clobber on INTENT(OUT)
549         for variables in an associate statement.
551 2018-09-24  Bernhard Reuther-Fischer  <aldot@gcc.gnu.org>
552             Cesar Philippidis  <cesar@codesourcery.com>
554         * openmp.c (resolve_oacc_loop_blocks):
556 2018-09-23  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 having the dimension attribute.
562 2018-09-23  Janne Blomqvist  <jb@gcc.gnu.org>
564         * trans-expr.c (gfc_caf_get_image_index): Do array index
565         calculations in gfc_array_index_type.
566         * trans-intrinsic.c (conv_intrinsic_event_query): Likewise.
567         * trans-stmt.c (gfc_trans_lock_unlock): Likewise.
568         (gfc_trans_event_post_wait): Likewise.
570 2018-09-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
572         PR fortran/87395
573         * gfc_conv_procedure_call: Reformat comments slightly. Do not add
574         clobber on INTENT(OUT) for saved variables.
576 2018-09-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
578         PR fortran/41453
579         * trans.h (gfc_conv_expr_reference): Add optional argument
580         add_clobber to prototype.
581         (gfc_conv_procedure_call):  Set add_clobber argument to
582         gfc_conv_procedure_reference to true for scalar, INTENT(OUT),
583         non-pointer, non-allocatable, non-dummy variables whose type
584         is neither BT_CHARACTER, BT_DERIVED or BT_CLASS, but only if
585         the procedure is not elemental.
586         * trans-expr.c (gfc_conv_procedure_reference): Add clobber
587         statement before call if add_clobber is set.
589 2018-09-22  Paul Thomas  <pault@gcc.gnu.org>
591         PR fortran/85603
592         * trans-array.c (gfc_alloc_allocatable_for_assignment): Test
593         the charlen backend_decl before using the VAR_P macro.
595 2018-09-21  Paul Thomas  <pault@gcc.gnu.org>
597         PR fortran/77325
598         * trans-array.c (gfc_alloc_allocatable_for_assignment): If the
599         rhs has a charlen expression, convert that and use it.
600         * trans-expr.c (gfc_trans_assignment_1): The rse.pre for the
601         assignment of deferred character array vars to a realocatable
602         lhs should not be added to the exterior block since vector
603         indices, for example, generate temporaries indexed within the
604         loop.
606 2018-09-21  Paul Thomas  <pault@gcc.gnu.org>
608         PR fortran/87359
609         * trans-stmt.c (gfc_trans_allocate): Don't deallocate alloc
610         components if must_finalize is set for expr3.
612 2018-09-21  Andrew Stubbs  <ams@codesourcery.com>
613             Kwok Cheung Yeung  <kcy@codesourcery.com>
615         * trans-expr.c (gfc_trans_structure_assign): Ensure that the first
616         argument of a call to _gfortran_caf_register is of size_type_node.
617         * trans-intrinsic.c (conv_intrinsic_event_query): Convert computed
618         index to a size_type_node type.
619         * trans-stmt.c (gfc_trans_event_post_wait): Likewise.
621 2018-09-20  Allan Sandfeld Jensen  <allan.jensen@qt.io>
623         * gfortranspec.c (lang_specific_driver): Handle -r like -nostdlib.
625 2018-09-20  Janus Weil  <janus@gcc.gnu.org>
627         * gfortran.h (gfc_str_startswith): New macro.
628         * decl.c (variable_decl, gfc_match_end): Use it.
629         * iresolve.c (is_trig_resolved): Ditto.
630         * module.c (load_omp_udrs, read_module): Ditto.
631         * options.c (gfc_handle_runtime_check_option): Ditto.
632         * primary.c (match_arg_list_function): Ditto.
633         * trans-decl.c (gfc_get_symbol_decl): Ditto.
634         * trans-expr.c (gfc_conv_procedure_call): Ditto.
635         * interface.c (dtio_op): Replace strncmp by strcmp.
636         * resolve.c (resolve_actual_arglist, resolve_function): Ditto.
637         * trans-expr.c (conv_arglist_function): Ditto.
638         * trans-intrinsic.c (gfc_conv_ieee_arithmetic_function): Replace macro
639         STARTS_WITH by gfc_str_startswith.
641 2018-09-20  Cesar Philippidis  <cesar@codesourcery.com>
643         * dump-parse-tree.c (show_omp_clauses): Add missing omp list_types
644         and reorder the switch cases to match the enum in gfortran.h.
646 2018-09-19  Paul Thomas  <pault@gcc.gnu.org>
648         PR fortran/84109
649         * trans-expr.c (gfc_trans_assignment_1): The rse.pre for the
650         assignment of deferred character intrinsic elemental function
651         results to a realocatable lhs must not be added to the exterior
652         block if they are array valued but must go to the loop body.
654 2018-09-18  Thomas Koenig  <tkoenig@gcc.gnu.org>
656         PR fortran/29550
657         * gfortran.h (gfc_expr): Add external_blas flag.
658         * frontend-passes.c (matrix_case): Add case A2TB2T.
659         (optimize_namespace): Handle flag_external_blas by
660         calling call_external_blas.
661         (get_array_inq_function): Add argument okind. If
662         it is nonzero, use it as the kind of argument
663         to be used.
664         (inline_limit_check): Remove m_case argument, add
665         limit argument instead.  Remove assert about m_case.
666         Set the limit for inlining from the limit argument.
667         (matmul_lhs_realloc): Handle case A2TB2T.
668         (inline_matmul_assign): Handle inline limit for other cases with
669         two rank-two matrices.  Remove no-op calls to inline_limit_check.
670         (call_external_blas): New function.
671         * trans-intrinsic.c (gfc_conv_intrinsic_funcall): Do not add
672         argument to external BLAS if external_blas is already set.
674 2018-09-18  Paul Thomas  <pault@gcc.gnu.org>
676         PR fortran/87239
677         * trans-expr.c (gfc_trans_assignment_1): The rse.pre for the
678         assignment of deferred character elemental function results to
679         a realocatable lhs must not be added to the exterior block but
680         must go to the loop body.
682 2018-09-18  Paul Thomas  <pault@gcc.gnu.org>
684         PR fortran/87336
685         * trans-array.c (gfc_get_array_span): Try to get the element
686         length of incomplete types. Return NULL_TREE otherwise.
687         (gfc_conv_expr_descriptor): Only set the 'span' field if the
688         above does not return NULL_TREE. Set 'span' field if possible
689         for all new descriptors.
691 2018-09-17  Paul Thomas  <pault@gcc.gnu.org>
693         PR fortran/64120
694         * trans-decl.c (gfc_get_symbol_decl): Flag allocatable, scalar
695         characters with a variable length expression for deferred init.
696         (gfc_trans_deferred_vars): Perform the assignment for these
697         symbols by calling gfc_conv_string_length.
699 2018-09-17  Paul Thomas  <pault@gcc.gnu.org>
701         PR fortran/85954
702         * resolve.c (resolve_assoc_var): If the target expression is a
703         deferred charlen dummy and the associate name shares the
704         charlen, generate a new one. Make sure that new charlens are in
705         the namespace list so that they get cleaned up.
706         * trans-array.c (gfc_is_reallocatable_lhs): Associate names are
707         not reallocatable.
708         * trans-decl.c (gfc_get_symbol_decl): Put deferred character
709         length dummy and result arrays on the deferred initialization
710         list so that the variable length arrays can be correctly dealt
711         with.
712         * trans-expr.c (gfc_conv_string_length): Return if 'expr' is
713         NULL rather than ICEing..
715 2018-09-16  Janus Weil  <janus@gcc.gnu.org>
717         PR fortran/86484
718         PR fortran/84543
719         * match.c (gfc_match_assignment): For a polymorphic assignment,
720         make sure that the vtab for the rhs type is generated.
722 2018-09-16  Thomas Koenig  <tkoenig@gcc.gnu.org>
724         PR fortran/37802
725         * frontend-passes.c (B_ERROR): New macro for matmul bounds
726         checking error messages.
727         (C_ERROR): Likewise.
728         (inline_matmul_assign): Reorganize bounds checking, use B_ERROR
729         and C_ERROR macros.
731 2018-09-13  Bernd Edlinger  <bernd.edlinger@hotmail.de>
733         * trans-array.c (gfc_conv_array_initializer): Remove excess precision
734         from overlength string initializers.
736 2018-09-12  Paul Thomas  <pault@gcc.gnu.org>
738         PR fortran/87284
739         * trans-expr.c (gfc_trans_class_init_assign): Access to
740         to array elements of the dynamic type requires that the array
741         reference be added to the class expression and not the _data
742         component, unlike scalar expressions.
744 2018-09-11  Janus Weil  <janus@gcc.gnu.org>
746         PR fortran/87172
747         * resolve.c (resolve_fl_derived): If a type has the 'use_assoc'
748         attribute, then it was declared in another module, so there should be
749         no error that it has not been declared.
751 2018-09-11  Paul Thomas  <pault@gcc.gnu.org>
753         PR fortran/87277
754         * expr.c (is_subref_array): Add the check of dimensionality for
755         class, dummy, pointer arrays.
757 2018-09-11  Janus Weil  <janus@gcc.gnu.org>
759         PR fortran/86830
760         * expr.c (gfc_is_simply_contiguous): Handle type-bound procedure calls
761         with non-polymorphic objects.
763 2018-09-10  Janus Weil  <janus@gcc.gnu.org>
765         PR fortran/85395
766         * decl.c (match_binding_attributes): Use correct default accessibility
767         for procedure pointer components.
769 2018-09-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
771         * simplify.c (gfc_simplify_modulo): Re-arrange code to test whether
772         'P' is zero and issue an error if it is.
774 2018-08-31  Paul Thomas  <pault@gcc.gnu.org>
776         PR fortran/86328
777         PR fortran/86760
778         * trans-array.c (gfc_conv_scalarized_array_ref): Do not fix
779         info->descriptor but pass it directly to gfc_build_array_ref.
780         (gfc_conv_array_ref): Likewise for se->expr.
781         * trans.c (gfc_build_array_ref): If 'decl' is a COMPONENT_REF
782         obtain the span field directly from it.
784 2017-08-28  Paul Thomas  <pault@gcc.gnu.org>
786         PR fortran/80477
787         * trans-expr.c (gfc_conv_procedure_call): Allocatable class
788         scalar results being passed to a derived type formal argument
789         are finalized if possible. Otherwise, rely on existing code for
790         deallocation. Make the deallocation of allocatable result
791         components conditional on finalization not taking place. Make
792         the freeing of data components after finalization conditional
793         on the data being NULL.
794         (gfc_trans_arrayfunc_assign): Change the gcc_assert to a
795         condition to return NULL_TREE.
796         (gfc_trans_assignment_1): If the assignment is class to class
797         and the rhs expression must be finalized but the assignment
798         is not marked as a polymorphic assignment, use the vptr copy
799         function instead of gfc_trans_scalar_assign.
801         PR fortran/86481
802         * trans-expr.c (gfc_conv_expr_reference): Do not add the post
803         block to the pre block if the expression is to be finalized.
804         * trans-stmt.c (gfc_trans_allocate): If the expr3 must be
805         finalized, load the post block into a finalization block and
806         add it right at the end of the allocation block.
808 2018-08-27  David Malcolm  <dmalcolm@redhat.com>
810         PR 87091
811         * error.c (gfc_format_decoder): Update for conversion of
812         show_caret_p to a tri-state.
814 2018-08-25  Janus Weil  <janus@gcc.gnu.org>
816         PR fortran/86545
817         * resolve.c (resolve_transfer): Correctly determine typespec for
818         generic function calls, in order to throw a proper error.
820 2018-08-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
822         PR fortran/86837
823         * frontend-passes.c (var_in_expr_callback): New function.
824         (var_in_expr): New function.
825         (traverse_io_block): Use var_in_expr instead of
826         gfc_check_dependency for checking if the variable depends on the
827         previous interators.
829 2018-08-23  Janne Blomqvist  <blomqvist.janne@gmail.com>
831         * trans-intrinsic.c (gfc_conv_intrinsic_minmaxval): Delete
832         HONOR_SIGNED_ZEROS checks.
834 2018-08-23  Paul Thomas  <pault@gcc.gnu.org>
836         PR fortran/86863
837         * resolve.c (resolve_typebound_call): If the TBP is not marked
838         as a subroutine, check the specific symbol.
840 2018-08-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
842         * gfortran.texi: Mention that asynchronous I/O does
843         not work on systems which lack condition variables, such
844         as AIX.
846 2018-08-22  Janus Weil  <janus@gcc.gnu.org>
848         PR fortran/86935
849         * match.c (gfc_match_associate): Improve diagnostics for the ASSOCIATE
850         statement.
852 2018-08-22  Andrew Benson  <abensonca@gmail.com>
854         * module.c (load_generic_interfaces): Move call to find_symbol()
855         so that only occurs if actually needed.
857 2018-08-22  Janus Weil  <janus@gcc.gnu.org>
859         PR fortran/86888
860         * decl.c (gfc_match_data_decl): Allow allocatable components of
861         indirectly recursive type.
862         * resolve.c (resolve_component): Remove two errors messages ...
863         (resolve_fl_derived): ... and replace them by a new one.
865 2018-08-21  Janne Blomqvist  <jb@gcc.gnu.org>
867         * trans-intrinsic.c (gfc_conv_intrinsic_minmax): Use
868         MAX_EXPR/MIN_EXPR unconditionally for real arguments.
869         * gfortran.texi (Compiler Characteristics): Document MAX/MIN
870         behavior wrt NaN.
872 2018-08-21  Nicolas Koenig  <koenigni@gcc.gnu.org>
873         Thomas Koenig <tkoenig@gcc.gnu.org>
875         PR fortran/25829
876         * gfortran.texi: Add description of asynchronous I/O.
877         * trans-decl.c (gfc_finish_var_decl): Treat asynchronous variables
878         as volatile.
879         * trans-io.c (gfc_build_io_library_fndecls): Rename st_wait to
880         st_wait_async and change argument spec from ".X" to ".w".
881         (gfc_trans_wait): Pass ID argument via reference.
883 2018-08-16  Nathan Sidwell  <nathan@acm.org>
885         * cpp.c (dump_macro): Use cpp_user_macro_p.
887 2018-08-14  Janus Weil  <janus@gcc.gnu.org>
889         PR fortran/86116
890         * interface.c (compare_type): Remove a CLASS/TYPE check.
891         (compare_type_characteristics): New function that behaves like the old
892         'compare_type'.
893         (gfc_check_dummy_characteristics, gfc_check_result_characteristics):
894         Call 'compare_type_characteristics' instead of 'compare_type'.
896 2018-08-12  Paul Thomas  <pault@gcc.gnu.org>
898         PR fortran/66679
899         * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Class array
900         elements are returned as references to the data element. Get
901         the class expression by stripping back the references. Use this
902         for the element size.
904 2018-08-12  Paul Thomas  <pault@gcc.gnu.org>
906         PR fortran/86906
907         * resolve.c (resolve_fl_variable_derived): Check if the derived
908         type is use associated before checking for the host association
909         error.
911 2018-08-10  Janus Weil  <janus@gcc.gnu.org>
913         PR fortran/57160
914         * invoke.texi (frontend-optimize): Mention short-circuiting.
915         * options.c (gfc_post_options): Disable -ffrontend-optimize with -Og.
916         * resolve.c (resolve_operator): Warn about short-circuiting only with
917         -ffrontend-optimize.
918         * trans-expr.c (gfc_conv_expr_op): Use short-circuiting operators only
919         with -ffrontend-optimize. Without that flag, make sure that both
920         operands are evaluated.
922 2018-08-08  Nathan Sidwell  <nathan@acm.org>
924         * cpp.c (cb_file_change): Use linemap_included_from.
926 2018-08-07  Cesar Philippidis  <cesar@codesourcery.com>
928         * trans-stmt.h: Remove stale reference to trans-openacc.c.
930 2018-08-04  Janus Weil  <janus@gcc.gnu.org>
932         PR fortran/45521
933         * interface.c (gfc_compare_interfaces): Apply additional
934         distinguishability criteria of F08 to operator interfaces.
936 2018-07-31  Andre Vieira  <andre.simoesdiasvieira@arm.com>
938         Revert 'AsyncI/O patch committed'
939         2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
940                 Thomas Koenig <tkoenig@gcc.gnu.org>
942         PR fortran/25829
943         * gfortran.texi: Add description of asynchronous I/O.
944         * trans-decl.c (gfc_finish_var_decl): Treat asynchronous variables
945         as volatile.
946         * trans-io.c (gfc_build_io_library_fndecls): Rename st_wait to
947         st_wait_async and change argument spec from ".X" to ".w".
948         (gfc_trans_wait): Pass ID argument via reference.
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-20  Martin Sebor  <msebor@redhat.com>
963         PR middle-end/82063
964         * gfortran.h (gfc_handle_option): Change function argument
965         to HOST_WIDE_INT.
966         * options.c (gfc_handle_option): Same.
968 2018-07-20  Andrew Benson  <abenson@carnegiescience.edu>
970         * gfortran.h (gfc_symbol): Add pointer to next derived type.
971         (gfc_dt_list, gfc_get_dt_list): Remove.
972         (gfc_namespace): Replace gfc_dt_list with gfc_symbol.
973         * parse.c (resolve_all_program_units): Replace gfc_free_dt_list() with
974         simple nullification of gfc_derived_types.
975         * resolve.c (resolve_global_procedure): Replace gfc_dt_list with
976         gfc_symbol.
977         (add_dt_to_dt_list): Change derived type linked list insertion to
978         utilize dt_next pointers in gfc_symbol.
979         * symbol.c (gfc_new_symbol, gfc_free_dt_list, gfc_symbol_done2)
980         (get_iso_c_binding_dt, generate_isocbinding_symbol): Remove
981         gfc_free_dt_list as gfc_dt_list is obsoleted. Change derived type
982         linked list search/insertion to utilize dt_next pointers in gfc_symbol.
983         * trans-types.c (gfc_get_derived_type): Change derived type linked
984         list search to utilize dt_next pointers in gfc_symbol.
986 2018-07-19  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
988         * trans-intrinsic.c: (gfc_conv_intrinsic_minmax): Emit MIN_MAX_EXPR
989         or IFN_FMIN/FMAX sequence to calculate the min/max when possible.
991 2018-07-18  Janus Weil  <janus@gcc.gnu.org>
992             Thomas Koenig  <tkoenig@gcc.gnu.org>
994         PR fortran/85599
995         * dump-parse-tree.c (show_attr): Add handling of implicit_pure.
996         * frontend-passes.c (do_warn_function_elimination): Do not warn for
997         pure functions.
998         * gfortran.h: Add prototypes for gfc_pure_function and
999         gfc_implicit_pure_function.
1000         * gfortran.texi: Add chapter on evaluation of logical expressions.
1001         * invoke.texi: Mention that -Wfunction-elimination is implied
1002         by -Wextra.
1003         * lang.opt: Make -Wextra imply -Wfunction-elimination.
1004         * resolve.c (pure_function): Rename to gfc_pure_function.
1005         (gfc_implicit_pure_function): New function.
1006         (check_pure_function): Use it here.
1007         (impure_function_callback): New function.
1008         (resolve_operator): Call it via gfc_expr_walker.
1010 2018-07-16  Fritz Reese  <fritzoreese@gmail.com>
1012         PR fortran/83184
1013         * decl.c (match_old_style_init): Initialize locus of variable expr when
1014         creating a data variable.
1015         (match_clist_expr): Verify array is explicit shape/size before
1016         attempting to allocate constant array constructor.
1018 2018-07-16  Fritz Reese  <fritzoreese@gmail.com>
1020         PR fortran/86417
1021         * module.c (mio_component): Set component->loc when loading from module.
1023 2018-07-10  Jakub Jelinek  <jakub@redhat.com>
1025         PR fortran/86421
1026         * module.c (omp_declare_simd_clauses): Add LINEAR with _REF, _VAL and
1027         _UVAL suffixes.
1028         (mio_omp_declare_simd): Save and restore ref, val and uval modifiers
1029         on linear clauses.  Initialize n->where to gfc_current_locus.
1031 2018-07-05  Paul Thomas  <pault@gcc.gnu.org>
1033         PR fortran/86408
1034         * resolve.c.c (resolve_contained_fntype): Reference to C418 is
1035         in F2008 and not F2003.
1036         (resolve_function): Ditto in error message. Also, exclude
1037         deferred character length results from the error.
1039 2018-07-05  Fritz Reese  <fritzoreese@gmail.com>
1041         PR fortran/83183
1042         PR fortran/86325
1043         * expr.c (class_allocatable, class_pointer, comp_allocatable,
1044         comp_pointer): New helpers.
1045         (component_initializer): Generate EXPR_NULL for allocatable or pointer
1046         components. Do not generate initializers for components within BT_CLASS.
1047         Do not assign to comp->initializer.
1048         (gfc_generate_initializer): Use new helpers; move code to generate
1049         EXPR_NULL for class allocatable components into component_initializer().
1051 2018-07-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
1053         PR fortran/82009
1054         * trans-decl.c (gfc_process_block_locals): Delete assert and set
1055         saved_local_decls = NULL_TREE.
1057 2018-07-02  Richard Biener  <rguenther@suse.de>
1059         PR lto/86321
1060         * trans-types.c (gfc_get_array_type_bounds): Unshare TYPE_FIELDs
1061         for the distinct type copy.
1063 2018-07-02  Paul Thomas  <pault@gcc.gnu.org>
1065         PR fortran/82969
1066         PR fortran/86242
1067         * trans-array.c (structure_alloc_comps): Do not explicitly copy
1068         procedure pointer components.
1070 2018-07-02  Paul Thomas  <pault@gcc.gnu.org>
1072         PR fortran/45305
1073         * expr.c : Add a prototype for scalarize_intrinsic_call.
1074         (gfc_simplify_expr): Use scalarize_intrinsic_call for elemental
1075         intrinsic function calls.
1076         (scalarize_intrinsic_call): Add 'init_flag' argument. Check if
1077         the expression or any of the actual argument expressions are
1078         NULL. Before calling gfc_check_init_expr, check 'init_flag'.
1079         Only simplify the scalarized expressions if there are no errors
1080         on the stack.
1081         (gfc_check_init_expr): Set 'init_flag' true in the call to
1082         scalarize_intrinsic_call.
1084 2018-06-28  Fritz Reese  <fritzoreese@gmail.com>
1086         PR fortran/82865
1087         * decl.c (gfc_match_type): Refactor and check for PDT declarations.
1089 2018-06-28  Martin Liska  <mliska@suse.cz>
1091         * gfortranspec.c: Include opt-suggestions.h.
1093 2018-06-25  Fritz Reese  <fritzoreese@gmail.com>
1095         PR fortran/82972
1096         PR fortran/83088
1097         PR fortran/85851
1098         * expr.c (component_initializer): Assign init expr to c->initializer.
1099         (generate_isocbinding_initializer): New.
1100         (gfc_generate_initializer): Call generate_isocbinding_initializer to
1101         generate initializers for c_ptr and c_funptr with -finit-derived.
1103 2018-06-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
1105         PR fortran/85983
1106         * interface.c (check_dtio_interface1): Delete assert.
1108 2018-06-22  Paul Thomas  <pault@gcc.gnu.org>
1109             Rainer Orth  <ro@gcc.gnu.org>
1111         PR fortran/86281
1112         * resolve.c (resolve_contained_fntype): Check for the charlen
1113         before testing the length.
1115 2018-06-21  Paul Thomas  <pault@gcc.gnu.org>
1117         PR fortran/49630
1118         * resolve.c (resolve_contained_fntype): Change standard ref.
1119         from F95 to F2003: C418. Correct a spelling error in a comment.
1120         It is an error for an abstract interface to have an assumed
1121         character length result.
1122         * trans-expr.c (gfc_conv_procedure_call): Likewise change the
1123         standard reference.
1125 2018-06-21  Paul Thomas  <pault@gcc.gnu.org>
1127         PR fortran/83118
1128         * resolve.c (resolve_ordinary_assign): Force the creation of a
1129         vtable for assignment of non-polymorphic expressions to an
1130         unlimited polymorphic object.
1131         * trans-array.c (gfc_alloc_allocatable_for_assignment): Use the
1132         size of the rhs type for such assignments. Set the dtype, _len
1133         and vptrs appropriately.
1134         * trans-expr.c (gfc_trans_assignment): Force the use of the
1135         _copy function for these assignments.
1137 2018-06-20  Chung-Lin Tang <cltang@codesourcery.com>
1138             Thomas Schwinge <thomas@codesourcery.com>
1139             Cesar Philippidis  <cesar@codesourcery.com>
1141         * gfortran.h (gfc_omp_clauses): Add unsigned if_present, finalize
1142         bitfields.
1143         * openmp.c (enum omp_mask2): Remove OMP_CLAUSE_PRESENT_OR_*. Add
1144         OMP_CLAUSE_{IF_PRESENT,FINALIZE}.
1145         (gfc_match_omp_clauses): Update handling of copy, copyin, copyout,
1146         create, deviceptr, present_of_*. Add support for finalize and
1147         if_present.
1148         (OACC_PARALLEL_CLAUSES): Remove PRESENT_OR_* clauses.
1149         (OACC_KERNELS_CLAUSES): Likewise.
1150         (OACC_DATA_CLAUSES): Likewise.
1151         (OACC_DECLARE_CLAUSES): Likewise.
1152         (OACC_UPDATE_CLAUSES): Add IF_PRESENT clause.
1153         (OACC_ENTER_DATA_CLAUSES): Remove PRESENT_OR_* clauses.
1154         (OACC_EXIT_DATA_CLAUSES): Add FINALIZE clause.
1155         (gfc_match_oacc_declare): Update to OpenACC 2.5 semantics.
1156         * trans-openmp.c (gfc_trans_omp_clauses): Add support for IF_PRESENT
1157         and FINALIZE.
1159 2018-06-18  Eric Botcazou  <ebotcazou@adacore.com>
1161         * trans-decl.c (gfc_get_fake_result_decl): Revert latest change.
1163 2018-06-17  Eric Botcazou  <ebotcazou@adacore.com>
1165         * trans-decl.c (nonlocal_dummy_decl_pset): Delete.
1166         (nonlocal_dummy_decls): Likewise.
1167         (gfc_nonlocal_dummy_array_decl): Likewise.
1168         (gfc_get_symbol_decl): Do not call gfc_nonlocal_dummy_array_decl.
1169         (gfc_get_fake_result_decl): Do not generate a new DECL if simply
1170         reusing the result of a recursive call.
1171         (gfc_generate_function_code): Do not create, insert and destroy
1172         nonlocal_dummy_decls.
1174 2018-06-13  Steven G. Kargl  <kargl@gcc.gnu.org>
1176         PR fortran/86110
1177         * array.c (gfc_resolve_character_array_constructor): Avoid NULL
1178         pointer dereference.
1180 2018-06-13  Cesar Philippidis  <cesar@codesourcery.com>
1182         PR fortran/85703
1183         * parse.c (decode_oacc_directive): Set gfc_matching_function
1184         to false.
1185         (decode_omp_directive): Likewise.
1187 2018-06-13  Cesar Philippidis  <cesar@codesourcery.com>
1189         PR fortran/85702
1190         * openmp.c (gfc_match_oacc_wait): Use %C to report error location.
1192 2018-06-12  David Malcolm  <dmalcolm@redhat.com>
1194         PR other/69968
1195         * misc.c (gfc_closest_fuzzy_match): Update for renaming of
1196         levenshtein_distance to get_edit_distance.
1198 2018-06-12  Steven G. Kargl  <kargl@gcc.gnu.org>
1200         PR fortran/44491
1201         * expr.c (gfc_check_assign): Select non-NULL locus.
1203 2018-06-11  Janus Weil  <janus@gcc.gnu.org>
1205         PR fortran/45521
1206         * interface.c (compare_ptr_alloc): New function.
1207         (generic_correspondence): Call it.
1209 2018-06-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
1211         * gfortran.h (gfc_expr): Add no_bounds_check field.
1212         * frontend-passes.c (get_array_inq_function): Set no_bounds_check
1213         on function and function argument.
1214         (inline_matmul_assign): Set no_bounds_check on zero expression
1215         and on lhs of zero expression.
1216         Also handle A1B2 case if realloc on assigment is active.
1217         * trans-array.c (gfc_conv_array_ref): Don't do range checking
1218         if expr has no_bounds_check set.
1219         (gfc_conv_expr_descriptor): Set no_bounds_check on ss if expr
1220         has it set.
1221         * trans-expr.c (gfc_trans_assignment_1): Set no_bounds_check
1222         on lss and lss if the corresponding expressions have it set.
1224 2018-06-10  Dominique d'Humieres  <dominiq@gcc.gnu.org>
1226         PR fortran/79854
1227         * trans-const.c: Remove include "diagnostic-core.h".
1228         (gfc_conv_constant_to_tree): Replace fatal_error with gcc_unreachable.
1230 2018-06-10  Janus Weil  <janus@gcc.gnu.org>
1232         PR fortran/85088
1233         * decl.c (match_attr_spec): Synchronize the DECL_* enum values with the
1234         INTENT_* values from the enum 'sym_intent'. Call 'match_intent_spec'
1235         and remove a TODO note.
1236         * gfortran.h: Add a comment to sym_intent.
1238 2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>
1240         PR fortran/38351
1241         * resolve.c (resolve_operator): Provide better error message for
1242         derived type entity used in an binary intrinsic numeric operator.
1244 2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>
1246         PR fortran/85138
1247         PR fortran/85996
1248         PR fortran/86051
1249         * decl.c (gfc_match_char_spec): Use private namespace in attempt to
1250         reduce a charlen to a constant.
1252 2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>
1254         PR fortran/78278
1255         * data.c (gfc_assign_data_value): Re-arrange code to allow for
1256         an error for double initialization of CHARACTER entities.
1258 2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>
1260         PR fortran/63514
1261         * symbol.c (gfc_add_volatile): Enforce F2008:C1282 and F2018:C1588.
1263 2018-06-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
1265         PR fortran/85631
1266         * trans.h (gfc_ss): Add field no_bounds_check.
1267         * trans-array.c (gfc_conv_ss_startstride): If flag_realloc_lhs and
1268         ss->no_bounds_check is set, do not use runtime checks.
1269         * trans-expr.c (gfc_trans_assignment_1): Set lss->no_bounds_check
1270         for reallocatable lhs.
1272 2018-06-08  Steven G. Kargl  <kargl@gcc.gnu.org>
1274         PR fortran/86059
1275         * array.c (match_array_cons_element): NULL() cannot be in an
1276         array constructor.
1278 2018-06-08  Steven G. Kargl  <kargl@gcc.gnu.org>
1280         PR fortran/78571
1281         * data.c (create_character_initializer): Return early if type is
1282         incompatible with CHARACTER.
1284 2018-06-07  Steven G. Kargl  <kargl@gcc.gnu.org>
1286         PR fortran/86045
1287         * simplify.c (gfc_simplify_mod): Re-arrange code to test whether
1288         'P' is zero and issue an error if it is.
1290 2018-06-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
1292         PR fortran/85641
1293         * frontend-passes.c (is_fe_temp): Add prototype.
1294         (realloc_string_callback): Early return for frontend-generated
1295         temporary.
1297 2018-06-05  Cesar Philippidis  <cesar@codesourcery.com>
1299         PR fortran/85701
1301         * openmp.c (gfc_resolve_oacc_declare): Error on functions and
1302         subroutine data clause arguments.
1304 2018-06-04  Steven G. Kargl  <kargl@gcc.gnu.org>
1306         PR fortran/85981
1307         * resolve.c (resolve_allocate_deallocate): Check errmsg is default
1308         character kind.
1310 2018-06-03  Paul Thomas  <pault@gcc.gnu.org>
1312         PR fortran/36497
1313         * decl.c (variable_decl): Use gfc_add_type for cray pointees.
1315 2018-06-01  Steven G. Kargl  <kargl@gcc.gnu.org>
1317         PR fortran/63570
1318         * check.c (gfc_check_random_init): New function. Check arguments of
1319         RANDOM_INIT.
1320         * gfortran.h (GFC_ISYM_RANDOM_INIT): New enum token.
1321         * intrinsic.c (add_subroutines): Add RANDOM_INIT to list of
1322         subroutines.
1323         (gfc_check_intrinsic_standard): Introduce Fortran 2018 check.
1324         * intrinsic.h: Add prototypes for gfc_check_random_init and
1325         gfc_resolve_random_init
1326         * intrinsic.texi: Document new intrinsic subprogram.
1327         * iresolve.c (gfc_resolve_random_init): Resolve routine name.
1328         * trans-decl.c: Declare gfor_fndecl_random_init
1329         * trans-intrinsic.c (conv_intrinsic_random_init): New function.
1330         Translate call to RANDOM_INIT.
1331         (gfc_conv_intrinsic_subroutine): Call it.
1332         * trans.h: Declare gfor_fndecl_random_init
1334 2018-05-27  Steven G. Kargl  <kargl@gcc.gnu.org>
1336         * decl.c (match_data_constant):  Fortran 2018 allows pointer
1337         initialization in a data statement.
1339 2018-05-25  Janus Weil  <janus@gcc.gnu.org>
1341         PR fortran/85839
1342         * match.c (gfc_match_block_data): Call gfc_notify_std to warn about
1343         an obsolescent feature in Fortran 2018.
1344         (gfc_match_equivalence): Ditto.
1345         * resolve.c (resolve_common_blocks): Ditto.
1346         (gfc_resolve_forall): Ditto.
1347         * symbol.c (gfc_define_st_label): Ditto.
1349 2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
1351         PR fortran/85543
1352         * resolve.c (update_current_proc_array_outer_dependency): Avoid NULL
1353         pointer dereference.
1355 2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
1357         PR fortran/85780
1358         * resolve.c (resolve_fl_procedure): Avoid NULL dereference.
1360 2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
1362         PR fortran/85779
1363         * decl.c (gfc_match_derived_decl): Fix NULL point dereference.
1365 2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
1367         PR fortran/85895
1368         * resolve.c (resolve_sync): Resolve expression before checking for
1369         an error.
1371 2018-05-22  Janus Weil  <janus@gcc.gnu.org>
1373         PR fortran/85841
1374         * libgfortran.h: Remove the macros GFC_STD_F2008_TS and
1375         GFC_STD_OPT_F08TS.
1376         * error.c (notify_std_msg): Remove GFC_STD_F2008_TS.
1377         * options.c (set_default_std_flags): Ditto.
1378         (gfc_handle_option): Make -std=f2008ts an alias for -std=f2018.
1379         * array.c (gfc_match_array_spec): Replace GFC_STD_F2008_TS by
1380         GFC_STD_F2018.
1381         * check.c (gfc_check_atomic, gfc_check_event_query,
1382         gfc_check_c_f_pointer, gfc_check_c_f_procpointer, gfc_check_c_funloc,
1383         gfc_check_c_loc, gfc_check_num_images, gfc_check_this_image): Ditto.
1384         * decl.c (gfc_verify_c_interop_param, gfc_match_decl_type_spec): Ditto.
1385         * intrinsic.c (add_functions, add_subroutines,
1386         gfc_check_intrinsic_standard): Ditto.
1387         * iso-c-binding.def: Ditto.
1388         * iso-fortran-env.def: Ditto.
1389         * match.c (gfc_match_event_post, gfc_match_event_wait,
1390         gfc_match_fail_image, gfc_match_form_team, gfc_match_change_team,
1391         gfc_match_end_team, gfc_match_sync_team): Ditto.
1392         * gfortran.texi: Remove mention of -std=f2008ts.
1393         Move TSs into F2018 section.
1394         * invoke.texi: Update documentation of -std=f2008ts.
1396 2018-05-21  Janus Weil  <janus@gcc.gnu.org>
1398         PR fortran/85841
1399         * libgfortran.h: New macros GFC_STD_OPT_*.
1400         * error.c (notify_std_msg): New function.
1401         (gfc_notify_std): Adjust such that it can handle combinations of
1402         GFC_STD_* flags in the 'std' argument, not just a single one.
1403         * match.c (match_arithmetic_if, gfc_match_if): Reject arithmetic if
1404         in Fortran 2018.
1405         (gfc_match_stopcode): Use GFC_STD_OPT_* macros.
1406         * options.c (set_default_std_flags): Warn for F2018 deleted features
1407         by default.
1408         (gfc_handle_option): F2018 deleted features are allowed in earlier
1409         standards.
1410         * symbol.c (gfc_define_st_label, gfc_reference_st_label): Reject
1411         nonblock do constructs in Fortran 2018.
1413 2018-05-20  Paul Thomas  <pault@gcc.gnu.org>
1415         PR fortran/80657
1416         * resolve.c (flag_fn_result_spec): Use the 'sym' argument to
1417         test for self refs to the function result in the character len
1418         expression. If a self reference is found, emit an error and
1419         return true.
1420         (resolve_fntype): Use the function symbol in the calls to the
1421         above.
1423 2018-05-20  Paul Thomas  <pault@gcc.gnu.org>
1425         PR fortran/49636
1426         * trans-array.c (gfc_get_array_span): Renamed from
1427         'get_array_span'.
1428         (gfc_conv_expr_descriptor): Change references to above.
1429         * trans-array.h : Add prototype for 'gfc_get_array_span'.
1430         * trans-intrinsic.c (gfc_conv_associated): Add pre and post
1431         blocks for 'arg1'.
1432         * trans-stmt.c (trans_associate_var): If the associate name is
1433         a subref array pointer, use gfc_get_array_span for the span.
1435 2018-05-20  Paul Thomas  <pault@gcc.gnu.org>
1437         PR fortran/82275
1438         * match.c (gfc_match_type_spec): Go through the array ref and
1439         decrement 'rank' for every dimension that is an element.
1441 2018-05-19  Paul Thomas  <pault@gcc.gnu.org>
1443         PR fortran/82923
1444         PR fortran/66694
1445         PR fortran/82617
1446         * trans-array.c (gfc_alloc_allocatable_for_assignment): Set the
1447         charlen backend_decl of the rhs expr to ss->info->string_length
1448         so that the value in the current scope is used.
1450 2018-05-13  Steven G. Kargl  <kargl@gcc.gnu.org>
1452         PR fortran/63529
1453         * gfortran.texi: Clarify documentation for Cray pointer and
1454         assumed-sized array.
1456 2018-05-13  Paul Thomas  <pault@gcc.gnu.org>
1458         PR fortran/85742
1459         * trans-types.c (gfc_get_dtype_rank_type): Reorder evaluation
1460         of 'size'. If the element type is a pointer use the size of the
1461         TREE_TYPE of the type, unless it is VOID_TYPE. In this latter
1462         case, set the size to zero.
1464 2018-05-13  Steven G. Kargl  <kargl@gcc.gnu.org>
1466         * gfortran.h: Remove prototype.
1467         * symbol.c (gfc_new_undo_checkpoint): Remove unused function.
1469 2018-05-11  Steven G. Kargl  <kargl@gcc.gnu.org>
1471         PR fortran/85542
1472         * expr.c (check_inquiry): Avoid NULL pointer dereference.
1474 2018-05-10  Steven G. Kargl  <kargl@gcc.gnu.org>
1476         PR fortran/85687
1477         * check.c (gfc_check_rank): Check that the argument is a data object.
1479 2018-05-10  Steven G. Kargl  <kargl@gcc.gnu.org>
1481         PR fortran/85521
1482         * array.c (gfc_resolve_character_array_constructor): Substrings
1483         with upper bound smaller than lower bound are zero length strings.
1485 2018-05-10  Steven G. Kargl  <kargl@gcc.gnu.org>
1487         PR fortran/70870
1488         * data.c (gfc_assign_data_value): Check that a data object does
1489         not also have default initialization.
1491 2018-05-10  Marek Polacek  <polacek@redhat.com>
1493         PR fortran/85735
1494         * options.c (gfc_post_options): Set main_input_filename.
1496 2018-05-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
1498         PR fortran/54613
1499         * intrinsic.texi: Document BACK for MINLOC and MAXLOC.
1501 2018-05-10  Paul Thomas  <pault@gcc.gnu.org>
1503         PR fortran/68846
1504         PR fortran/70864
1505         * resolve.c (get_temp_from_expr): The temporary must not have
1506         dummy or intent attributes.
1508 2018-05-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
1510         PR fortran/54613
1511         * check.c (gfc_check_minmaxloc): Remove error for BACK not being
1512         implemented.  Use gfc_logical_4_kind for BACK.
1513         * simplify.c (min_max_choose): Add optional argument back_val.
1514         Handle it.
1515         (simplify_minmaxloc_to_scalar): Add argument back_val. Pass
1516         back_val to min_max_choose.
1517         (simplify_minmaxloc_to_nodim): Likewise.
1518         (simplify_minmaxloc_to_array): Likewise.
1519         (gfc_simplify_minmaxloc): Add argument back, handle it.
1520         Pass back_val to specific simplification functions.
1521         (gfc_simplify_minloc): Remove ATTRIBUTE_UNUSED from argument back,
1522         pass it on to gfc_simplify_minmaxloc.
1523         (gfc_simplify_maxloc): Likewise.
1524         * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Adjust
1525         comment. If BACK is true, use greater or equal (or lesser or
1526         equal) insteal of greater (or lesser). Mark the condition of
1527         having found a value which exceeds the limit as unlikely.
1529 2018-05-07  Jeff Law  <law@redhat.comg>
1531         * scanner.c (preprocessor_line): Call linemap_add after a line
1532         directive that changes the current filename.
1534 2018-05-06  Andre Vehreschild  <vehre@gcc.gnu.org>
1536         PR fortran/85507
1537         * dependency.c (gfc_dep_resolver): Revert looking at coarray dimension
1538         introduced by r259385.
1539         * trans-intrinsic.c (conv_caf_send): Always report a dependency for
1540         same variables in coarray assignments.
1542 2018-05-02  Tom de Vries  <tom@codesourcery.com>
1544         PR libgomp/82428
1545         * f95-lang.c (DEF_GOACC_BUILTIN_ONLY): Define.
1547 2018-04-24  Steven G. Kargl  <kargl@gcc.gnu.org>
1549         PR fortran/85520
1550         * decl.c (gfc_match_char_spec): Check for negative length and set to 0.
1552 2018-04-14  Andre Vehreschild  <vehre@gcc.gnu.org>
1554         PR fortran/81773
1555         PR fortran/83606
1556         * dependency.c (gfc_dep_resolver): Coarray indexes are to be ignored
1557         during dependency computation.  They define no data dependency.
1558         * trans-array.c (conv_array_index_offset): The stride can not be set
1559         here, prevent fail.
1560         * trans-intrinsic.c (conv_caf_send): Add creation of temporary array
1561         for caf_get's result and copying to the array with vectorial
1562         indexing.
1564 2018-04-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
1566         PR fortran/85387
1567         * frontend-passes.c (traverse_io_block): Check for start, end or
1568         stride being defined by an outer implied DO loop.
1570 2018-04-12  Thomas Koenig  <tkoenig@gcc.gnu.org>
1572         PR fortran/83064
1573         PR testsuite/85346
1574         * trans-stmt.c (gfc_trans_forall_loop): Use annot_expr_ivdep_kind
1575         for annotation and remove dependence on -ftree-parallelize-loops.
1577 2018-04-10  Jakub Jelinek  <jakub@redhat.com>
1579         PR fortran/85313
1580         * openmp.c (resolve_omp_do): Remove bogus if (j < i) break;.
1581         (resolve_oacc_nested_loops): Likewise.  Formatting fix.
1583 2018-04-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
1585         PR fortran/83064
1586         * trans-stmt.c (gfc_trans_forall_loop): Remove annotation for
1587         parallell processing of DO CONCURRENT -ftree-parallelize-loops
1588         is set.
1590 2018-04-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
1592         PR fortran/51260
1593         * resolve.c (resolve_variable): Simplify cases where access to a
1594         parameter array results in a single constant.
1596 2018-04-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
1598         PR fortran/85102
1599         * decl.c (variable_decl): If upper or lower bounds simplify
1600         to a constant, use that.
1602 2018-03-30  Paul Thomas  <pault@gcc.gnu.org>
1604         PR fortran/84931
1605         * simplify.c (gfc_convert_constant): Handle case of array
1606         constructors within an array that has no iterator and improve
1607         the conciseness of this section of code.
1609 2017-03-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
1611         PR fortran/85111
1612         * array.c (gfc_resolve_character_array_constructor): Early
1613         exit for zero-size arrays.
1614         * simplify.c (simplify_transformation_to_array): Exit early
1615         if the result size is zero.
1616         (simplify_minmaxloc_to_array): Likewise.
1618 2018-03-28  Mikael Morin  <mikael@gcc.gnu.org>
1620         PR fortran/69497
1621         * symbol.c (gfc_symbol_done_2): Start freeing namespaces
1622         from the root.
1623         (gfc_free_namespace): Restore assert (revert r258839).
1625 2018-03-28  Jakub Jelinek  <jakub@redhat.com>
1627         * gfortran.h (gfc_dt): Rename default_exp field to dec_ext.
1628         * ioparm.def (IOPARM_dt_default_exp): Rename to ...
1629         (IOPARM_dt_dec_ext): ... this.
1630         * trans-io.c (build_dt): Adjust for default_exp renaming to
1631         dec_ext and IOPARM_dt_default_exp renaming to IOPARM_dt_dec_ext.
1632         * io.c (match_io): Likewise.
1634 2018-03-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
1636         PR fortran/85084
1637         * frontend-passes.c (gfc_run_passes): Do not run front-end
1638         optimizations if a previous error occurred.
1640 2018-03-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
1641         Harald Anlauf  <anlauf@gmx.de>
1643         PR fortran/85083
1644         * primary.c (gfc_convert_to_structure_constructor): Check
1645         conformance of argument types in structure constructor.
1647 2018-03-26  Thomas Koenig  <tkoenig@gcc.gnu.org>
1649         PR fortran/66709
1650         * io.c: Include constructor.h.
1651         (resolve_tag_format): For a constant character array, concatenate
1652         into a single character expression.
1654 2018-03-25  Seth Johnson <johnsonsr@ornl.gov>
1655         Dominique d'Humieres  <dominiq@gcc.gnu.org>
1657         PR fortran/84924
1658         * check.c (gfc_check_c_f_pointer): Allow scalar noninteroperable
1659         scalar derived type with -std=f2003 and -std=f2008.
1661 2018-03-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
1662             Dominique d'Humieres  <dominiq@gcc.gnu.org>
1664         PR fortran/69497
1665         * symbol.c (gfc_free_namespace): Delete the assert and only if
1666         refs count is equals zero, free the namespace. Otherwise,
1667         something is halfway and other errors will resound.
1669 2018-03-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
1671         PR fortran/70068
1672         * expr.c (find_substring_ref): Change types of start, end
1673         and length variables to gfc_charlen_t. Set length to zero
1674         for empty substring.
1676 2018-03-24  Steven G. Kargl  <kargl@gcc.gnu.org>
1678         PR fortran/42651
1679         * decl.c (check_function_name): Improved error message
1680         (gfc_match_volatile, gfc_match_asynchronous) Use check_function_name.
1682 2018-03-22  Steven G. Kargl  <kargl@gcc.gnu.org>
1684         PR fortran/84922
1685         * decl.c (get_proc_name): If the MODULE prefix appears in interface
1686         body, then it must appear on the contained subroutine or function.
1687         While here, fix nearby mis-indented code.
1689 2018-03-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
1690         Harald Anlauf  <anlauf@gmx.de>
1692         PR fortran/84957
1693         * trans-types.c (gfc_sym_type): Do not dereference NULL pointer.
1695 2018-03-21  Janne Blomqvist  <jb@gcc.gnu.org>
1697         PR fortran/84615
1698         * trans-expr.c (gfc_conv_procedure_call): Convert charlen to
1699         gfc_charlen_type_node when calling procedure.
1701 2018-03-20  Steven G. Kargl  <kargl@gcc.gnu.org>
1703         PR fortran/85001
1704         * interface.c (symbol_rank): Remove bogus null pointer check that
1705         crept in when translating a ternary operator into an if-else
1706         constructor.
1708 2018-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
1710         PR fortran/84931
1711         * simplify.c (gfc_convert_constant): Correctly handle iterators
1712         for type conversion.
1714 2018-03-18  Steven G. Kargl  <kargl@gcc.gnu.org>
1716         PR fortran/77414
1717         * decl.c (get_proc_name):  Check for a subroutine re-defined in
1718         the contain portion of a subroutine.  Change language of existing
1719         error message to better describe the issue. While here fix whitespace
1720         issues.
1722 2018-03-18  Steven G. Kargl  <kargl@gcc.gnu.org>
1724         PR fortran/65453
1725         * decl.c (get_proc_name): Catch clash between a procedure statement
1726         and a contained subprogram
1728 2018-03-16  Steven G. Kargl  <kargl@gcc.gnu.org>
1730         PR fortran/69395
1731         * decl.c (merge_array_spec): Correct the error condition.
1733 2018-03-15  Steven G. Kargl  <kargl@gcc.gnu.org>
1735         PR fortran/78741
1736         * decl.c (get_proc_name):  Check for clash of entry name with
1737         subroutine name.
1739 2018-03-15  Steven G. Kargl  <kargl@gcc.gnu.org>
1741         PR fortran/69395
1742         * decl.c (merge_array_spec): Limit the merging to maximum allowed
1743         dimensions, and issue error message if limit is exceeded.
1745 2018-03-13  Steven G. Kargl  <kargl@gcc.gnu.org>
1747         * check.c (gfc_check_kill_sub):  Remove check for INTEGER(4) or (8).
1748         * intrinsic.c (add_functions): Remove reference to gfc_resolve_kill.
1749         (add_subroutines): Remove reference to gfc_resolve_kill_sub.
1750         * intrinsic.texi: Update documentation.
1751         * iresolve.c (gfc_resolve_kill, gfc_resolve_kill_sub): Remove.
1752         * trans-decl.c (gfc_build_intrinsic_function_decls):  Add
1753         gfor_fndecl_kill and gfor_fndecl_kill_sub
1754         * trans-intrinsic.c (conv_intrinsic_kill, conv_intrinsic_kill_sub): new
1755         functions.
1756         (gfc_conv_intrinsic_function): Use conv_intrinsic_kill.
1757         (gfc_conv_intrinsic_subroutine): Use conv_intrinsic_kill_sub.
1758         * trans.h: Declare gfor_fndecl_kill and gfor_fndecl_kill_sub.
1760 2018-03-11  Paul Thomas  <pault@gcc.gnu.org>
1762         PR fortran/84546
1763         * trans-array.c (structure_alloc_comps): Make sure that the
1764         vptr is copied and that the unlimited polymorphic _len is used
1765         to compute the size to be allocated.
1766         * trans-expr.c (gfc_get_class_array_ref): If unlimited, use the
1767         unlimited polymorphic _len for the offset to the element.
1768         (gfc_copy_class_to_class): Set the new 'unlimited' argument.
1769         * trans.h : Add the boolean 'unlimited' to the prototype.
1771 2018-03-11  Steven G. Kargl  <kargl@gcc.gnu.org>
1773         PR fortran/83939
1774         * resolve.c (resolve_fl_procedure): Enforce F2018:C15100.
1776 2018-03-11  Steven G. Kargl  <kargls@gcc.gnu.org>
1778         * check.c (gfc_check_kill):  Check pid and sig are scalar.
1779         (gfc_check_kill_sub): Restrict kind to 4 and 8.
1780         * intrinsic.c (add_function): Sort keyword list.  Add pid and sig
1781         keywords for KILL.  Remove redundant *back="back" in favor of the
1782         original *bck="back".
1783         (add_subroutines): Sort keyword list.  Add pid and sig keywords
1784         for KILL.
1785         * intrinsic.texi: Fix documentation to consistently use pid and sig.
1786         * iresolve.c (gfc_resolve_kill): Kind can only be 4 or 8.  Choose the
1787         correct function.
1788         (gfc_resolve_rename_sub): Add comment.
1790 2018-03-11  Thomas Koenig  <tkoenig@gcc.gnu.org>
1792         PR fortran/66128
1793         * simplify.c (simplify_transformation): Return default result for
1794         empty array argument.
1795         (gfc_simplify_all): Remove special-case handling for zerosize.
1796         (gfc_simplify_any): Likewise.
1797         (gfc_simplify_count): Likewise.
1798         (gfc_simplify_iall): Likewise.
1799         (gfc_simplify_iany): Likewise.
1800         (gfc_simplify_iparity): Likewise.
1801         (gfc_simplify_minval): Likewise.
1802         (gfc_simplify_maxval): Likewise.
1803         (gfc_simplify_norm2): Likewise.
1804         (gfc_simplify_product): Likewise.
1805         (gfc_simplify_sum): Likewise.
1807 2018-03-10  Steven G. Kargl  <kargl@gcc.gnu.org>
1809         PR fortran/84734
1810         * arith.c (check_result, eval_intrinsic):  If result overflows, pass
1811         the expression up the chain instead of a NULL pointer.
1813 2018-03-07  Steven G. Kargl  <kargl@gcc.gnu.org>
1815         PR fortran/64124
1816         PR fortran/70409
1817         * decl.c (gfc_match_char_spec): Try to reduce a charlen to a constant.
1819 2017-03-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
1821         PR fortran/84697
1822         PR fortran/66128
1823         * expr.c (simplify_parameter_variable): If p is a size zero array
1824         and not an ARRAY_EXPR insert an empty array constructor and
1825         return.
1826         * gfortran.h: Add prototype for gfc_is_size_zero_array.
1827         * simplify.c (is_size_zero_array): Make non-static and rename into
1828         (gfc_is_size_zero_array):  Check for parameter arrays of zero
1829         size by comparing shape and absence of constructor.
1830         (gfc_simplify_all): Use gfc_is_size_zero_array instead of
1831         is_size_zero_array.
1832         (gfc_simplify_count): Likewise.
1833         (gfc_simplify_iall): Likewise.
1834         (gfc_simplify_iany): Likewise.
1835         (gfc_simplify_iparity): Likewise.
1836         (gfc_simplify_minval): Likewise.
1837         (gfc_simplify_maxval): Likewise.
1838         (gfc_simplify_product): Likewise.
1839         (gfc_simplify_sum): Likewise.
1841 2018-03-06  Steven G. Kargl  <kargl@gcc.gnu.org>
1843         PR fortran/56667
1844         * primary.c (match_sym_complex_part): Give the matcher for an implied
1845         do-loop a chance to run.
1847 2018-03-03  Harald Anlauf  <anlauf@gmx.de>
1849         PR fortran/71085
1850         * trans-expr.c (gfc_apply_interface_mapping_to_expr): Do not
1851         dereference NULL pointer.
1853 2018-03-03  Steven G. Kargl  <kargl@gcc.gnu.org>
1855         PR fortran/66128
1856         * simplify.c (is_size_zero_array): New function to check for size
1857         zero array.
1858         (gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
1859          gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
1860          gfc_simplify_minval, gfc_simplify_maxval, gfc_simplify_norm2,
1861          gfc_simplify_product, gfc_simplify_sum): Use it, and implement
1862         requirements from F2018.
1864 2018-03-03  Steven G. Kargl  <kargl@gcc.gnu.org>
1866         PR fortran/51434
1867         * simplify.c (gfc_simplify_transfer): Resolve mold.
1869 2018-03-03  Paul Thomas  <pault@gcc.gnu.org>
1871         PR fortran/80965
1872         * resolve.c (build_loc_call): Change symtree name from 'loc' to
1873         '_loc'.
1875 2018-03-01  Paul Thomas  <pault@gcc.gnu.org>
1877         PR fortran/84219
1878         * target-memory.c (gfc_interpret_derived): Assert that BT_VOID
1879         components are caf tokens.
1880         (gfc_target_interpret_expr): Treat BT_VOID expressions as
1881         integers.
1883 2018-03-01  Paul Thomas  <pault@gcc.gnu.org>
1885         PR fortran/84538
1886         * class.c (class_array_ref_detected): Remove the condition that
1887         there be no reference after the array reference.
1888         (find_intrinsic_vtab): Remove excess whitespace.
1889         * trans-array.c (gfc_conv_scalarized_array_ref): Rename 'tmp'
1890         as 'base and call build_class_array_ref earlier.
1892 2018-02-28  Paul Thomas  <pault@gcc.gnu.org>
1894         PR fortran/83901
1895         * trans-stmt.c (trans_associate_var): Make sure that the se
1896         expression is a pointer type before converting it to the symbol
1897         backend_decl type.
1899 2018-02-25  Steven G. Kargl  <kargl@gcc.gnu.org>
1901         PR fortran/83633
1902         * decl.c (variable_decl): Check that an explicit-shape-array with
1903         nonconstant bounds is allowed.
1905 2018-02-25  Paul Thomas  <pault@gcc.gnu.org>
1907         PR fortran/84523
1908         * trans-intrinsic.c (gfc_conv_allocated): If the argument se
1909         has a pre block, add it to the expression pre block.
1911 2018-02-25  Thomas Koenig  <tkoenig@gcc.gnu.org>
1913         PR fortran/78238
1914         * gfortran.h (gfc_integer_4_kind): Define.
1915         * resolve.c (resolve_select_type): Make sure that the
1916         kind of c->high is gfc_integer_4_kind.
1918 2018-02-24  Steven G. Kargl <kargl@gcc.gnu.org>
1920         PR fortran/30792
1921         * decl.c (gfc_match_data): Check for invalid substring in
1922         data-implied-do
1924 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
1926         * intrinsic.texi: Arguments to MATMUL cannot both be rank one.
1928 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
1930         PR fortran/84511
1931         * trans-io.c (transfer_expr): Deal with C_LOC in transfer statement.
1933 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
1935         PR fortran/84346
1936         * interface.c (compare_actual_formal): Issue error if keyword is
1937         used in a statement function.
1939 2018-02-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
1941         PR fortran/84506
1942         * trans-io.c (set_parameter_value_inquire): Adjust range check of
1943         negative unit values for kind=8 units to the kind=4 negative limit.
1945 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
1947         PR fortran/83149
1948         * trans-types.c (gfc_sym_type): Test sym->ns->proc_name before
1949         accessing its components.
1951 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
1953         PR fortran/83149
1954         * trans-decl.c (gfc_finish_var_decl): Test sym->ns->proc_name
1955         before accessing its components.
1957 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
1959         PR fortran/83148
1960         * trans-const.c : Clean up some whitespace issues.
1961         * trans-expr.c (gfc_conv_initializer): If an iso_c_binding
1962         derived type has a kind value of zero, set it to the default
1963         integer kind.
1965 2018-02-23  Janne Blomqvist  <jb@gcc.gnu.org>
1967         PR fortran/84519
1968         * trans-decl.c (gfc_build_builtin_function_decls): Add bool
1969         argument to stop and error stop decls.
1970         * trans-stmt.c (gfc_trans_stop): Add false value to argument
1971         lists.
1973 2018-02-22  Janne Blomqvist  <jb@gcc.gnu.org>
1975         PR 78534
1976         PR 84509
1977         * trans-decl.c (gfc_build_builtin_function_decls): Pass
1978         gfc_int8_type node to pause_numeric, size_type_node to
1979         pause_string.
1980         * trans-stmt.c (gfc_trans_pause): Likewise.
1982 2018-02-22  Janne Blomqvist  <jb@gcc.gnu.org>
1984         * gfortran.texi: Update Coarray API description.
1985         * trans-decl.c (gfc_build_builtin_function_decls): Use size_t for
1986         character lengths, int for exit codes.
1987         (generate_coarray_sym_init): Use size_t for character length.
1988         * trans-intrinsic.c (conv_co_collective): Likewise.
1989         * trans-stmt.c (gfc_trans_lock_unlock): Likewise.
1990         (gfc_trans_event_post_wait): Likewise.
1991         (gfc_trans_sync): Likewise.
1992         (gfc_trans_stop): Use size_t for character lengths, int for exit
1993         codes.
1995 2018-02-20  Thomas Koenig  <tkoenig@gcc.gnu.org>
1997         PR fortran/48890
1998         PR fortran/83823
1999         * primary.c (gfc_convert_to_structure_constructor):
2000         For a constant string constructor, make sure the length
2001         is correct.
2003 2018-02-19  Paul Thomas  <pault@gcc.gnu.org>
2005         PR fortran/83344
2006         PR fortran/83975
2007         * resolve.c (resolve_assoc_var): Rearrange the logic for the
2008         determination of the character length of associate names. If
2009         the associate name is missing a length expression or the length
2010         expression is not a constant and the target is not a variable,
2011         make the associate name allocatable and deferred length.
2012         * trans-decl.c (gfc_get_symbol_decl): Null the character length
2013         backend_decl for deferred length associate names that are not
2014         variables. Set 'length' to gfc_index_zero_node for character
2015         associate names, whose character length is a PARM_DECL.
2017 2018-02-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
2019         PR fortran/35339
2020         * frontend-passes.c (traverse_io_block): Remove workaround for
2021         PR 80945.
2023 2018-02-19  Andre Vehreschild  <vehre@gcc.gnu.org>
2025         * gfortran.texi: Document additional src/dst_type.  Fix some typos.
2026         * trans-decl.c (gfc_build_builtin_function_decls): Declare the new
2027         argument of _caf_*_by_ref () with * e { get, send, sendget }.
2028         * trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Add the type of the
2029         data referenced when generating a call to caf_get_by_ref ().
2030         (conv_caf_send): Same but for caf_send_by_ref () and
2031         caf_sendget_by_ref ().
2033 2018-02-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
2035         PR fortran/84389
2036         * io.c (check_format): Allow FMT_COLON.
2038 2018-02-18  Paul Thomas  <pault@gcc.gnu.org>
2040         PR fortran/80945
2041         * trans-array.c (gfc_conv_expr_descriptor): Set parmtype from
2042         the typenode in the case of deferred length characters.
2044 2018-02-17  Thomas Koenig  <tkoenig@gcc.gnu.org>
2046         PR fortran/84270
2047         * frontend-passes (scalarized_expr):  If the expression
2048         is an assumed size array, leave in the last reference
2049         and pass AR_SECTION instead of AR_FULL to gfc_resolve
2050         in order to avoid an error.
2052 2018-02-17  Paul Thomas  <pault@gcc.gnu.org>
2054         PR fortran/84115
2055         * resolve.c (resolve_assoc_var): If a non-constant target expr.
2056         has no string length expression, make the associate variable
2057         into a deferred length, allocatable symbol.
2058         * trans-decl.c (gfc_is_reallocatable_lhs): Add and use a ptr to
2059         the symbol.
2060         * trans-stmt.c (trans_associate_var): Null and free scalar
2061         associate names that are allocatable. After assignment, remove
2062         the allocatable attribute to prevent reallocation.
2064 2018-02-16  Jakub Jelinek  <jakub@redhat.com>
2066         PR fortran/84418
2067         * trans-openmp.c (gfc_trans_omp_clauses): For OMP_CLAUSE_LINEAR_REF
2068         kind set OMP_CLAUSE_LINEAR_STEP to TYPE_SIZE_UNIT times last_step.
2070 2018-02-16  Dominique d'Humieres  <dominiq@gcc.gnu.org>
2072         PR fortran/84354
2073         * decl.c (gfc_get_pdt_instance): Replace '%qs' with %qs.
2075 2018-02-15  Janus Weil  <janus@gcc.gnu.org>
2077         PR fortran/84409
2078         * interface.c (check_dtio_arg_TKR_intent): Add a check for character
2079         length.
2081 2018-02-14  Janus Weil  <janus@gcc.gnu.org>
2083         PR fortran/84385
2084         * match.c (gfc_match_select_type): Fix check for selector in
2085         SELECT TYPE statement.
2087 2018-02-13  Janus Weil  <janus@gcc.gnu.org>
2089         PR fortran/84313
2090         * symbol.c (check_conflict): Reject procedure pointers in common blocks.
2092 2018-02-13  Alastair McKinstry  <alastair.mckinstry@sceal.ie>
2093             Janne Blomqvist  <jb@gcc.gnu.org>
2095         * module.c (dump_module): Use lbasename to ensure that module
2096         files are reproducible.
2098 2018-02-12  Janus Weil  <janus@gcc.gnu.org>
2100         PR fortran/84273
2101         * resolve.c (resolve_component): Fix checks of passed argument in
2102         procedure-pointer components.
2104 2018-02-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
2106         PR fortran/35299
2107         * resolve.c (resolve_formal_arglist): Update error message.
2109 2018-02-11  Andre Vehreschild  <vehre@gcc.gnu.org>
2111         * gfortran.texi: Fix typos in documentation of caf_register ().
2112         * trans-array.c (structure_alloc_comps): Only register a component of
2113         a derived typed corray, not of an ultimate component coarray.
2115 2018-02-11  Steven G. Kargl  <kargl@gcc.gnu.org>
2117         PR fortran/54223
2118         PR fortran/84276
2119         * interface.c (compare_actual_formal): Add in_statement_function
2120         bool parameter.  Skip check of INTENT attribute for statement
2121         functions.  Arguments to a statement function cannot be optional,
2122         issue error for missing argument.
2123         (gfc_procedure_use, gfc_ppc_use, gfc_arglist_matches_symbol): Use
2124          in_statement_function.
2126 2018-02-11  Paul Thomas  <pault@gcc.gnu.org>
2128         PR fortran/84074
2129         * trans-expr.c (gfc_conv_derived_to_class): Set the use_offset
2130         flag. If the is a vector subscript or the expression is not a
2131         variable, make the descriptor one-based.
2133 2018-02-10  Paul Thomas  <pault@gcc.gnu.org>
2135         PR fortran/84141
2136         PR fortran/84155
2137         * trans-array.c (gfc_array_init_size): Revert the change made
2138         in revision 257356 setting the dtype.
2139         * trans-types.c (gfc_get_dtype): Do not use the cached dtype.
2140         Call gfc_get_dtype_rank_type every time.
2142         PR fortran/56691
2143         * trans-array.c (gfc_conv_expr_descriptor): If the source array
2144         is a descriptor type, use its offset, removing the condition
2145         that is be a class expression.
2147 2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>
2149         PR fortran/82994
2150         * match.c (gfc_match_deallocate): Check for NULL pointer.
2152 2018-02-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
2154         PR fortran/68560
2155         * trans-intrinsic.c (gfc_conv_intrinsic_shape): New function.
2156         (gfc_conv_intrinsic_function): Call it.
2158 2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>
2160         PR fortran/82049
2161         * match.c (gfc_match_type_spec): If the charlen is non-NULL, then
2162         try to resolve it.  While here return early if possible.
2164 2018-02-04  Paul Thomas  <pault@gcc.gnu.org>
2166         PR fortran/84115
2167         * trans-decl.c (gfc_get_symbol_decl): Do not finish the decl of
2168         'length' if the symbol charlen backend_decl is an indirect ref.
2170 2018-02-03  Paul Thomas  <pault@gcc.gnu.org>
2172         PR fortran/84141
2173         PR fortran/84155
2174         * trans-array.c (gfc_array_init_size): Instead of gfc_get_dtype
2175         use gfc_get_dtype_rank_type.
2177 2018-02-01  Janne Blomqvist  <jb@gcc.gnu.org>
2179         PR 83975
2180         PR 83344
2181         * resolve.c (resolve_assoc_var): Generate an error if
2182         target length unknown.
2184 2018-02-01  Janne Blomqvist  <jb@gcc.gnu.org>
2186         PR fortran/83705
2187         * simplify.c (gfc_simplify_repeat): Increase limit for deferring
2188         to runtime, print a warning message.
2190 2018-01-31  Jakub Jelinek  <jakub@redhat.com>
2192         PR fortran/84116
2193         * openmp.c (gfc_match_omp_clauses): If all the linear
2194         gfc_match_omp_variable_list calls failed, don't gfc_free_omp_namelist
2195         nor set *head = NULL.  Formatting fixes.
2197 2018-01-31  Paul Thomas  <pault@gcc.gnu.org>
2199         PR fortran/84088
2200         * trans-expr.c (gfc_conv_procedure_call): If the parm expr is
2201         an address expression passed to an assumed rank dummy, convert
2202         to an indirect reference.
2204 2018-01-31  Thomas Koenig  <tkoenig@gcc.gnu.org>
2206         * dump-parse-tree.c (write_proc): Use sym_name (which may
2207         be sym->binding_label) instead of sym->name.
2209 2018-01-31  Janne Blomqvist  <jb@gcc.gnu.org>
2211         * trans-const.c (gfc_conv_string_init): Use gfc_charlen_t instead
2212         of int for slen.
2214 2018-01-31  Janne Blomqvist  <jb@gcc.gnu.org>
2216         PR fortran/78534
2217         * trans-expr.c (fill_with_spaces): Use memset instead of
2218         generating loop.
2219         (gfc_trans_string_copy): Improve opportunity to use builtins with
2220         constant lengths.
2222 2018-01-30  Jakub Jelinek  <jakub@redhat.com>
2224         PR debug/84131
2225         * trans-array.c (gfc_get_descriptor_offsets_for_info): Set *data_off
2226         to DATA_FIELD's offset rather than OFFSET_FIELD's offset.
2228 2018-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
2230         PR fortran/84134
2231         * array.c (gfc_ref_dimen_size): Whitespace fixes.  If stride is
2232         zero, return false.
2234 2018-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
2236         PR fortran/84133
2237         * frontend-passes (matmul_to_var_expr): Return early if
2238         in association list.
2239         (inline_matmul_assign): Likewise.
2241 2017-01-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
2243         PR fortran/84073
2244         * resolve.c (resolve_component): Ensure BIND(C) character
2245         components have length one.
2246         (resolve_symbol): Likewise for variables.
2248 2018-01-27  Jakub Jelinek  <jakub@redhat.com>
2250         PR fortran/84065
2251         * decl.c (add_init_expr_to_sym): Ignore initializers for too large
2252         lengths.
2254 2018-01-26  Damian Rouson  <damian@sourceryinstitute.org>
2255             Alessandro Fanfarillo  <fanfarillo.gcc@gmail.com>
2256             Soren Rasmussen  <s.c.rasmussen@gmail.com>
2258         Partial support for Fortran 2018 teams features.
2260         * array.c (gfc_match_array_ref): add team attribute in coarray
2261         transfers.
2262         * check.c (gfc_check_get_team, gfc_check_team_number): add new
2263         functions for get_team and team_number.
2264         * dump-parse-tree.c (show_code_node): add new statements: form team,
2265         change team, end team, and sync team.
2266         * expr.c (gfc_find_team_co): add new function.
2267         * gfortran.h: add new statements.
2268         * intrinsic.c (add_functions): add get_team and team_number functions.
2269         * intrinsic.h: add get_team and team_number prototypes for check,
2270         simplify, and resolve.
2271         * iresolve.c (gfc_resolve_get_team, gfc_resolve_team_number): add new
2272         functions.
2273         * iso-fortran-env.def: add the team_type derived type.
2274         * match.c (gfc_match_if, gfc_match_form_team, gfc_match_team_number)
2275         (gfc_match_end_team, gfc_match_sync_team, gfc_match_change_team):
2276         add change team, end team, form team, sync team match and functions.
2277         * match.h: add new prototypes for change team, end team, form team,
2278         and sync team.
2279         * parse.c (decode_statement): add cases for change team, end team,
2280         form team, and sync team.
2281         * resolve.c: add cases for exec form team, change team, end team, and
2282         sync team.
2283         * simplify.c (gfc_simplify_get_team): add new function for get team.
2284         * st.c (gfc_free_statement): add cases exec for change team, end team,
2285         form team, sync team.
2286         * trans-decl.c (gfor_fndecl_caf_form_team)
2287         (gfor_fndecl_caf_change_team, gfor_fndecl_caf_end_team)
2288         (gfor_fndecl_caf_sync_team, gfor_fndecl_caf_get_team)
2289         (gfor_fndecl_caf_team_number): add functions and definitions.
2290         * trans-intrinsic.c (conv_caf_send, conv_intrinsic_team_number): add
2291         new function and team_type argument support.
2292         * trans-stmt.c (gfc_trans_form_team, gfc_trans_change_team)
2293         (gfc_trans_end_team, gfc_trans_sync_team): add new functions.
2294         * trans-stmt.h: add new prototypes.
2295         * trans-types.c (gfc_get_derived_type): check condition for team_type.
2296         * trans.c (trans_code): new exec cases for form team, change team, end
2297         team, and sync team.
2298         * trans.h: add new prototypes.
2300 2018-01-26  Steven G. Kargl  <kargl@gcc.gnu.org>
2302         PR fortran/83998
2303         * simplify.c (compute_dot_product):  Initialize result to INTEGER(1) 0
2304         or .false.  The summation does the correct type conversion.
2305         (gfc_simplify_dot_product): Special case zero-sized arrays.
2307 2018-25-01  Paul Thomas  <pault@gcc.gnu.org>
2309         PR fortran/37577
2310         * array.c (gfc_match_array_ref): If standard earlier than F2008
2311         it is an error if the reference dimension is greater than 7.
2312         libgfortran.h : Increase GFC_MAX_DIMENSIONS to 15. Change the
2313         dtype masks and shifts accordingly.
2314         * trans-array.c (gfc_conv_descriptor_dtype): Use the dtype
2315         type node to check the field.
2316         (gfc_conv_descriptor_dtype): Access the rank field of dtype.
2317         (duplicate_allocatable_coarray): Access the rank field of the
2318         dtype descriptor rather than the dtype itself.
2319         * trans-expr.c (get_scalar_to_descriptor_type): Store the type
2320         of 'scalar' on entry and use its TREE_TYPE if it is ARRAY_TYPE
2321         (ie. a character).
2322         (gfc_conv_procedure_call): Pass TREE_OPERAND (tmp,0) to
2323         get_scalar_to_descriptor_type if the actual expression is a
2324         constant.
2325         (gfc_trans_structure_assign): Assign the rank directly to the
2326         dtype rank field.
2327         * trans-intrinsic.c (gfc_conv_intrinsic_rank): Cast the result
2328         to default integer kind.
2329         (gfc_conv_intrinsic_sizeof): Obtain the element size from the
2330         'elem_len' field of the dtype.
2331         * trans-io.c (gfc_build_io_library_fndecls): Replace
2332         gfc_int4_type_node with dtype_type_node where necessary.
2333         (transfer_namelist_element): Use gfc_get_dtype_rank_type for
2334         scalars.
2335         * trans-types.c : Provide 'get_dtype_type_node' to acces the
2336         dtype_type_node and, if necessary, build it.
2337         The maximum size of an array element is now determined by the
2338         maximum value of size_t.
2339         Update the description of the array descriptor, including the
2340         type def for the dtype_type.
2341         (gfc_get_dtype_rank_type): Build a constructor for the dtype.
2342         Distinguish RECORD_TYPEs that are BT_DERIVED or BT_CLASS.
2343         (gfc_get_array_descriptor_base): Change the type of the dtype
2344         field to dtype_type_node.
2345         (gfc_get_array_descr_info): Get the offset to the rank field of
2346         the dtype.
2347         * trans-types.h : Add a prototype for 'get_dtype_type_node ()'.
2348         * trans.h : Define the indices of the dtype fields.
2350 2018-23-01  Paul Thomas  <pault@gcc.gnu.org>
2352         PR fortran/83866
2353         * decl.c (gfc_match_derived_decl): If eos not matched, recover
2354         and emit error about garbage after declaration.
2356 2018-23-01  Paul Thomas  <pault@gcc.gnu.org>
2358         PR fortran/83898
2359         * trans-stmt.c (trans_associate_var): Do not set cst_array_ctor
2360         for characters.
2362 2018-01-22  Janne Blomqvist  <jb@gcc.gnu.org>
2364         PR 78534
2365         PR 83704
2366         * arith.c (gfc_arith_concat): Use size_t for string length.
2367         (gfc_compare_string): Likewise.
2368         (gfc_compare_with_Cstring): Likewise.
2369         * array.c (gfc_resolve_character_array_constructor): Use
2370         HOST_WIDE_INT, gfc_mpz_get_hwi.
2371         * check.c (gfc_check_fe_runtime_error): Use size_t.
2372         * data.c (create_character_initializer): Use HOST_WIDE_INT,
2373         gfc_extract_hwi.
2374         * decl.c (gfc_set_constant_character_len): Use gfc_charlen_t.
2375         (add_init_expr_to_sym): Use HOST_WIDE_INT.
2376         * expr.c (gfc_build_init_expr): Use HOST_WIDE_INT,
2377         gfc_extract_hwi.
2378         (gfc_apply_init): Likewise.
2379         * match.h (gfc_set_constant_character_len): Update prototype.
2380         * primary.c (match_string_constant): Use size_t.
2381         * resolve.c (resolve_ordinary_assign): Use HOST_WIDE_INT,
2382         gfc_mpz_get_hwi.
2383         * simplify.c (init_result_expr): Likewise.
2384         (gfc_simplify_len_trim): Use size_t.
2385         * target-memory.c (gfc_encode_character): Use size_t.
2386         (gfc_target_encode_expr): Use HOST_WIDE_INT, gfc_mpz_get_hwi.
2387         (interpret_array): Use size_t.
2388         (gfc_interpret_character): Likewise.
2389         * target-memory.h (gfc_encode_character): Update prototype.
2390         (gfc_interpret_character): Likewise.
2391         (gfc_target_interpret_expr): Likewise.
2392         * trans-const.c (gfc_build_string_const): Use size_t for length
2393         argument.
2394         (gfc_build_wide_string_const): Likewise.
2395         * trans-const.h (gfc_build_string_const): Likewise.
2396         (gfc_build_wide_string_const): Likewise.
2398 2018-01-20  Steven G. Kargl  <kargl@gcc.gnu.org>
2400         PR fortran/83900
2401     * simplify.c (gfc_simplify_matmul): Set return type correctly.
2403 2018-01-19  Steven G. Kargl  <kargl@gcc.gnu.org>
2405         PR fortran/83900
2406         * simplify.c (gfc_simplify_matmul): Delete bogus assertion.
2408 2018-01-17  Harald Anlauf  <anlauf@gmx.de>
2410         PR fortran/83864
2411         * expr.c (add_init_expr_to_sym): Do not dereference NULL pointer.
2413 2018-01-17  Harald Anlauf  <anlauf@gmx.de>
2415         PR fortran/83874
2416         * decl.c (add_init_expr_to_sym): Do not dereference NULL pointer.
2418 2018-01-15  Louis Krupp  <louis.krupp@zoho.com>
2420         PR fortran/82257
2421         * interface.c (compare_rank): Don't try to retrieve CLASS_DATA
2422         from symbol marked unlimited polymorphic.
2423         * resolve.c (resolve_structure_cons): Likewise.
2424         * misc.c (gfc_typename): Don't dereference derived->components
2425         if it's NULL.
2427 2018-01-15  Thomas Koenig  <tkoenig@gcc.gnu.org>
2429         PR fortran/54613
2430         * gfortran.h (gfc_check_f): Rename f4ml to f5ml.
2431         (gfc_logical_4_kind): New macro
2432         * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument.
2433         (gfc_simplify_maxloc): Likewise.
2434         (gfc_resolve_maxloc): Likewise.
2435         (gfc_resolve_minloc): Likewise.
2436         * check.c (gfc_check_minloc_maxloc): Add checking for "back"
2437         argument; also raise error if it is used (for now). Add it
2438         if it isn't present.
2439         * intrinsic.c (add_sym_4ml): Rename to
2440         (add_sym_5ml), adjust for extra argument.
2441         (add_functions): Add "back" constant. Adjust maxloc and minloc
2442         for back argument.
2443         * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is
2444         not of gfc_logical_4_kind, convert.
2445         (gfc_resolve_minloc): Likewise.
2446         * simplify.c (gfc_simplify_minloc): Add back argument.
2447         (gfc_simplify_maxloc): Likewise.
2448         * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last
2449         argument to %VAL to ensure passing by value.
2450         (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc
2451         also for library calls.
2453 2018-01-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
2455         PR fortran/82007
2456         * resolve.c (resolve_transfer): Delete code looking for 'DT'
2457         format specifiers in format strings. Set formatted to true if a
2458         format string or format label is present.
2459         * trans-io.c (get_dtio_proc): Likewise. (transfer_expr): Fix
2460         whitespace.
2462 2018-01-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
2464         PR fortran/83744
2465         * dump-parse-tree.c (get_c_type_name): Remove extra line.
2466         Change for loop to use declaration in for loop. Handle BT_LOGICAL
2467         and BT_CHARACTER.
2468         (write_decl): Add where argument. Fix indentation. Replace
2469         assert with error message. Add typename to warning
2470         in comment.
2471         (write_type): Adjust locus to call of write_decl.
2472         (write_variable): Likewise.
2473         (write_proc): Likewise. Replace assert with error message.
2475 2018-01-13  Paul Thomas  <pault@gcc.gnu.org>
2477         PR fortran/52162
2478         * trans-expr.c (gfc_trans_scalar_assign): Flag is_alloc_lhs if
2479         the rhs expression is neither an elemental nor a conversion
2480         function.
2482         PR fortran/83622
2483         * trans-array.c (is_pointer_array): Remove unconditional return
2484         of false for -fopenmp.
2486 2018-01-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
2487         <emsr@gcc.gnu.org>
2489         PR fortran/83803
2490         * dump-parse-tree.c (write_proc): Always emit closing parenthesis
2491         for functions.
2493 2018-01-10  Steven G. Kargl  <kargl@gcc.gnu.org>
2495         PR fortran/82367
2496         * resolve.c (resolve_allocate_expr): Check for NULL pointer.
2498 2018-01-10  Steven G. Kargl  <kargl@gcc.gnu.org>
2500         PR fortran/83093
2501         * resolve.c (resolve_charlen): Check the type of cl->length
2502         after resolution.
2504 2018-01-10  Janne Blomqvist  <jb@gcc.gnu.org>
2506         PR fortran/83740
2507         * trans-array.c (gfc_trans_array_ctor_element): Fix formatting.
2509 2018-01-10  Janne Blomqvist  <jb@gcc.gnu.org>
2511         PR fortran/83740
2512         * trans-array.c (gfc_trans_array_ctor_element): Convert RHS to the
2513         LHS type when assigning.
2515 2018-01-09  Steven G. Kargl  <kargl@gcc.gnu.org>
2517         PR fortran/83742
2518         * expr.c (gfc_is_simply_contiguous): Check for NULL pointer.
2520 2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>
2522         * match.c (gfc_match_allocate): Check for NULL pointer.
2524 2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>
2526         * expr.c (gfc_check_pointer_assign): Fix typo in comment.
2528 2018-01-08  Paul Thomas  <pault@gcc.gnu.org>
2530         PR fortran/83611
2531         * decl.c (gfc_get_pdt_instance): If parameterized arrays have
2532         an initializer, convert the kind parameters and add to the
2533         component if the instance.
2534         * trans-array.c (structure_alloc_comps): Add 'is_pdt_type' and
2535         use it with case COPY_ALLOC_COMP. Call 'duplicate_allocatable'
2536         for parameterized arrays. Clean up typos in comments. Convert
2537         parameterized array initializers and copy into the array.
2538         * trans-expr.c (gfc_trans_scalar_assign): Do a deep copy for
2539         parameterized types.
2540         *trans-stmt.c (trans_associate_var): Deallocate associate vars
2541         as necessary, when they are PDT function results for example.
2543         PR fortran/83731
2544         * trans-array.c (structure_alloc_comps): Only compare len parms
2545         when they are declared explicitly.
2547 2018-01-06  Janne Blomqvist  <jb@gcc.gnu.org>
2549         PR fortran/50892
2550         * trans-expr.c (gfc_trans_pointer_assignment): fold_convert rhs to
2551         lhs type.
2553 2018-01-05  Janne Blomqvist  <jb@gcc.gnu.org>
2555         PR fortran/78534
2556         PR fortran/66310
2557         * array.c (got_charlen): Use gfc_charlen_int_kind.
2558         * class.c (gfc_find_derived_vtab): Use gfc_size_kind instead of
2559         hardcoded kind.
2560         (find_intrinsic_vtab): Likewise.
2561         * decl.c (match_char_length): Use gfc_charlen_int_kind.
2562         (add_init_expr_to_sym): Use gfc_charlen_t and gfc_charlen_int_kind.
2563         (gfc_match_implicit): Use gfc_charlen_int_kind.
2564         * dump-parse-tree.c (show_char_const): Use gfc_charlen_t and size_t.
2565         (show_expr): Use HOST_WIDE_INT_PRINT_DEC.
2566         * expr.c (gfc_get_character_expr): Length parameter of type
2567         gfc_charlen_t.
2568         (gfc_get_int_expr): Value argument of type HOST_WIDE_INT.
2569         (gfc_extract_hwi): New function.
2570         (simplify_const_ref): Make string_len of type gfc_charlen_t.
2571         (gfc_simplify_expr): Use HOST_WIDE_INT for substring refs.
2572         * frontend-passes.c (optimize_trim): Use gfc_charlen_int_kind.
2573         * gfortran.h (gfc_mpz_get_hwi): New prototype.
2574         (gfc_mpz_set_hwi): Likewise.
2575         (gfc_charlen_t): New typedef.
2576         (gfc_expr): Use gfc_charlen_t for character lengths.
2577         (gfc_size_kind): New extern variable.
2578         (gfc_extract_hwi): New prototype.
2579         (gfc_get_character_expr): Use gfc_charlen_t for character length.
2580         (gfc_get_int_expr): Use HOST_WIDE_INT type for value argument.
2581         * gfortran.texi: Update description of hidden string length argument.
2582         * iresolve.c (check_charlen_present): Use gfc_charlen_int_kind.
2583         (gfc_resolve_char_achar): Likewise.
2584         (gfc_resolve_repeat): Pass string length directly without
2585         temporary, use gfc_charlen_int_kind.
2586         (gfc_resolve_transfer): Use gfc_charlen_int_kind.
2587         * match.c (select_intrinsic_set_tmp): Use HOST_WIDE_INT for charlen.
2588         * misc.c (gfc_mpz_get_hwi): New function.
2589         (gfc_mpz_set_hwi): New function.
2590         * module.c (atom_int): Change type from int to HOST_WIDE_INT.
2591         (parse_integer): Don't complain about large integers.
2592         (write_atom): Use HOST_WIDE_INT for integers.
2593         (mio_integer): Handle integer type mismatch.
2594         (mio_hwi): New function.
2595         (mio_intrinsic_op): Use HOST_WIDE_INT.
2596         (mio_array_ref): Likewise.
2597         (mio_expr): Likewise.
2598         * primary.c (match_substring): Use gfc_charlen_int_kind.
2599         * resolve.c (resolve_substring_charlen): Use gfc_charlen_int_kind.
2600         (resolve_character_operator): Likewise.
2601         (resolve_assoc_var): Likewise.
2602         (resolve_select_type): Use HOST_WIDE_INT for charlen, use snprintf.
2603         (resolve_charlen): Use mpz_sgn to determine sign.
2604         * simplify.c (gfc_simplify_repeat): Use HOST_WIDE_INT/gfc_charlen_t
2605         instead of long.
2606         * symbol.c (generate_isocbinding_symbol): Use gfc_charlen_int_kind.
2607         * target-memory.c (size_character): Length argument of type
2608         gfc_charlen_t.
2609         (gfc_encode_character): Likewise.
2610         (gfc_interpret_character): Use gfc_charlen_t.
2611         * target-memory.h (gfc_encode_character): Modify prototype.
2612         * trans-array.c (gfc_trans_array_ctor_element): Use existing type.
2613         (get_array_ctor_var_strlen): Use gfc_conv_mpz_to_tree_type.
2614         (trans_array_constructor): Use existing type.
2615         (get_array_charlen): Likewise.
2616         * trans-const.c (gfc_conv_mpz_to_tree_type): New function.
2617         * trans-const.h (gfc_conv_mpz_to_tree_type): New prototype.
2618         * trans-decl.c (gfc_trans_deferred_vars): Use existing type.
2619         (add_argument_checking): Likewise.
2620         * trans-expr.c (gfc_class_len_or_zero_get): Build const of type
2621         gfc_charlen_type_node.
2622         (gfc_conv_intrinsic_to_class): Use gfc_charlen_int_kind instead of
2623         4, fold_convert to correct type.
2624         (gfc_conv_class_to_class): Build const of type size_type_node for
2625         size.
2626         (gfc_copy_class_to_class): Likewise.
2627         (gfc_conv_string_length): Use same type in expression.
2628         (gfc_conv_substring): Likewise, use HOST_WIDE_INT for charlen.
2629         (gfc_conv_string_tmp): Make sure len is of the right type.
2630         (gfc_conv_concat_op): Use same type in expression.
2631         (gfc_conv_procedure_call): Likewise.
2632         (fill_with_spaces): Comment out memset() block due to spurious
2633         -Wstringop-overflow warnings.
2634         (gfc_trans_string_copy): Use gfc_charlen_type_node.
2635         (alloc_scalar_allocatable_for_subcomponent_assignment):
2636         fold_convert to right type.
2637         (gfc_trans_subcomponent_assign): Likewise.
2638         (trans_class_vptr_len_assignment): Build const of correct type.
2639         (gfc_trans_pointer_assignment): Likewise.
2640         (alloc_scalar_allocatable_for_assignment): fold_convert to right
2641         type in expr.
2642         (trans_class_assignment): Build const of correct type.
2643         * trans-intrinsic.c (gfc_conv_associated): Likewise.
2644         (gfc_conv_intrinsic_repeat): Do calculation in sizetype.
2645         * trans-io.c (gfc_build_io_library_fndecls): Use
2646         gfc_charlen_type_node for character lengths.
2647         (set_string): Convert to right type in assignment.
2648         * trans-stmt.c (gfc_trans_label_assign): Build const of
2649         gfc_charlen_type_node.
2650         (trans_associate_var): Likewise.
2651         (gfc_trans_character_select): Likewise.
2652         (gfc_trans_allocate): Likewise, don't typecast strlen result.
2653         (gfc_trans_deallocate): Don't typecast strlen result.
2654         * trans-types.c (gfc_size_kind): New variable.
2655         (gfc_init_types): Determine gfc_charlen_int_kind and gfc_size_kind
2656         from size_type_node.
2657         * trans-types.h: Fix comment.
2659 2018-01-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
2661         PR fortran/83683
2662         PR fortran/45689
2663         * check.c (gfc_check_eoshift): Check for string length and
2664         for conformance of boundary.
2665         * intrinsic.c (add_functions): Add gfc_simplify_eoshift.
2666         * intrinsic.h: Add prototype for gfc_simplify_eoshift.
2667         * simplify.c (gfc_simplify_eoshift): New function.
2669 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2670             Alan Hayward  <alan.hayward@arm.com>
2671             David Sherwood  <david.sherwood@arm.com>
2673         * trans-types.c (gfc_type_for_mode): Handle MODE_VECTOR_BOOL.
2675 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
2676             Alan Hayward  <alan.hayward@arm.com>
2677             David Sherwood  <david.sherwood@arm.com>
2679         * trans-types.c (gfc_type_for_mode): Check valid_vector_subparts_p.
2681 2018-01-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
2683         PR fortran/83664
2684         * check.c (gfc_check_eoshift): Error for missing boundary if array
2685         is not one of the standard types.
2687 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
2689         Update copyright years.
2691         * gfortranspec.c (lang_specific_driver): Update copyright notice
2692         dates.
2693         * gfc-internals.texi: Bump @copying's copyright year.
2694         * gfortran.texi: Ditto.
2695         * intrinsic.texi: Ditto.
2696         * invoke.texi: Ditto.
2698 2017-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
2700         PR fortran/45689
2701         * intrinsic.c (add_function): Add gfc_simplify_maxloc and
2702         gfc_simplify_minloc to maxloc and minloc, respectively.
2703         * intrinsic.h: Add prototypes for gfc_simplify_minloc
2704         and gfc_simplify_maxloc.
2705         * simplify.c (min_max_chose): Adjust prototype.  Modify function
2706         to have a return value which indicates if the extremum was found.
2707         (is_constant_array_expr): Fix typo in comment.
2708         (simplify_minmaxloc_to_scalar): New function.
2709         (simplify_minmaxloc_nodim): New function.
2710         (new_array): New function.
2711         (simplify_minmaxloc_to_array): New function.
2712         (gfc_simplify_minmaxloc): New function.
2713         (simplify_minloc): New function.
2714         (simplify_maxloc): New function.
2716 2018-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
2718         PR fortran/45689
2719         PR fortran/83650
2720         * simplify.c (gfc_simplify_cshift): Re-implement to allow full
2721         range of arguments.
2723 2018-01-01  Paul Thomas  <pault@gcc.gnu.org>
2725         PR fortran/83076
2726         * resolve.c (resolve_fl_derived0): Add caf_token fields for
2727         allocatable and pointer scalars, when -fcoarray selected.
2728         * trans-types.c (gfc_copy_dt_decls_ifequal): Copy the token
2729         field as well as the backend_decl.
2730         (gfc_get_derived_type): Flag GFC_FCOARRAY_LIB for module
2731         derived types that are not vtypes. Components with caf_token
2732         attribute are pvoid types. For a component requiring it, find
2733         the caf_token field and have the component token field point to
2734         its backend_decl.
2736         PR fortran/83319
2737         *trans-types.c (gfc_get_array_descriptor_base): Add the token
2738         field to the descriptor even when codimen not set.
2740 Copyright (C) 2018 Free Software Foundation, Inc.
2742 Copying and distribution of this file, with or without modification,
2743 are permitted in any medium without royalty provided the copyright
2744 notice and this notice are preserved.
2746         PR fortran/87945
2747         * decl.c (var_element): Inquiry parameters cannit be data objects.
2749 2018-12-08  Steven G. Kargl  <kargl@gcc.gnu.org>
2751         PR fortran/88025
2752         * expr.c (gfc_apply_init):  Remove asserts that cannot trigger.
2753         Check for a NULL pointer.
2755 2018-12-08  Steven G. Kargl  <kargl@gcc.gnu.org>
2757         PR fortran/88357
2758         * class.c (insert_component_ref): Check for NULL pointer and 
2759         previous error message issued.
2760         * parse.c (parse_associate): Check for NULL pointer.
2761         * resolve.c (resolve_assoc_var): Check for NULL pointer.
2763 2018-12-07  Jakub Jelinek  <jakub@redhat.com>
2765         PR fortran/88377
2766         * trans-openmp.c (gfc_omp_clause_default_ctor,
2767         gfc_omp_clause_copy_ctor, gfc_omp_clause_assign_op,
2768         gfc_omp_clause_linear_ctor, gfc_omp_clause_dtor): Only consider
2769         GFC_DECL_GET_SCALAR_ALLOCATABLE vars as scalar allocatables if they
2770         have pointer type.
2772 2018-12-03  Fritz Reese  <fritzoreese@gmail.com>
2773             Mark Eggleston  <mark.eggleston@codethink.co.uk>
2775         PR fortran/87919
2776         * options.c (SET_FLAG, SET_BITFLAG, SET_BITFLAG2): New macros.
2777         (set_dec_flags): Set/unset DEC and std flags according to value.
2778         (post_dec_flags, set_init_local_zero): New functions.
2779         (gfc_init_options): Use set_init_local_zero and post_dec_flags.
2780         (gfc_handle_options) <case OPT_fcheck_array_temporaries>: Use
2781         SET_BITFLAG.
2782         <case OPT_finit_local_zero>: Use set_init_local_zero.
2783         <case OPT_fdec>: Pass value to set_dec_flags.
2784         <case OPT_fdec_structure>: Remove.
2786 2018-11-30  Thomas Schwinge  <thomas@codesourcery.com>
2788         * gfortran.h (struct gfc_omp_clauses): Remove "wait".  Adjust all
2789         users.
2791         * openmp.c (gfc_match_omp_clauses): Support multiple OpenACC wait
2792         clauses.
2794 2018-11-27  Martin Liska  <mliska@suse.cz>
2796         * decl.c (gfc_match_gcc_builtin): New function.
2797         * gfortran.h (struct vect_builtin_tuple): New.
2798         (gfc_adjust_builtins): Likewise.
2799         * lang-specs.h (TARGET_F951_OPTIONS): New.
2800         (F951_OPTIONS): Use it.
2801         * lang.opt: Add new option -fpre-include.
2802         * match.h (gfc_match_gcc_builtin): Declare new function.
2803         * parse.c (decode_gcc_attribute): Handle builtin.
2804         (parse_progunit): Call gfc_adjust_builtins.
2805         * scanner.c (gfc_new_file): Load pre-included header file
2806         when provided.
2807         * trans-intrinsic.c (add_simd_flag_for_built_in): New.
2808         (gfc_adjust_builtins): Likewise.
2810 2018-11-24  Paul Thomas  <pault@gcc.gnu.org>
2812         PR fortran/88143
2813         * resolve.c (resolve_variable): Check for associate names with
2814         NULL target.
2816 2018-11-23  Jakub Jelinek  <jakub@redhat.com>
2818         * lang.opt (fpad-source): New option.
2819         * scanner.c (load_line): Don't pad fixed form lines if
2820         !flag_pad_source.
2821         * invoke.texi (-fno-pad-source): Document.
2823 2018-11-21  Jakub Jelinek  <jakub@redhat.com>
2825         * invoke.texi (-fdec-include): Document.
2827 2018-11-21  Jakub Jelinek  <jakub@redhat.com>
2828             Mark Eggleston  <mark.eggleston@codethink.com>
2830         * lang.opt (fdec-include): New option.
2831         * options.c (set_dec_flags): Set also flag_dec_include.
2832         * scanner.c (include_line): Change return type from bool to int.
2833         In fixed form allow spaces in between include keyword letters.
2834         For -fdec-include, allow in fixed form 0 in column 6.  With
2835         -fdec-include return -1 if the parsed line is not full include
2836         statement and it could be successfully completed on continuation
2837         lines.
2838         (include_stmt): New function.
2839         (load_file): Adjust include_line caller.  If it returns -1, keep
2840         trying include_stmt until it stops returning -1 whenever adding
2841         further line of input.
2843 2018-11-18  Thomas Koenig  <tkoenig@gcc.gnu.org>
2845         PR fortran/88073
2846         * frontend-passes.c (combine_array_constructor): Do not do
2847         anything if in a WHERE statement.
2849 2018-11-18  Thomas Koenig  <tkoenig@gcc.gnu.org>
2851         PR fortran/70260
2852         * expr.c (gfc_check_assign): Reject assigning to an external
2853         symbol.
2854         (gfc_check_pointer_assign): Add suppress_type_test
2855         argument. Insert line after if. A non-proc pointer can not point
2856         to a constant.  Only check types if suppress_type_test is false.
2857         * gfortran.h (gfc_check_pointer_assign): Add optional
2858         suppress_type_test argument.
2859         * resolve.c (gfc_resolve_code):  Move up gfc_check_pointer_assign
2860         and give it the extra argument.
2861         (resolve_fl_procedure): Set error on value for a function with
2862         an inizializer.
2864 2018-11-15  David Malcolm  <dmalcolm@redhat.com>
2866         PR other/19165
2867         * error.c (gfc_diagnostic_finalizer): Add diagnostic_t param.
2869 2018-11-13  David Malcolm  <dmalcolm@redhat.com>
2871         * cpp.c: Replace "source_location" with "location_t".
2872         * gfortran.h: Likewise.
2874 2018-11-08  Jakub Jelinek  <jakub@redhat.com>
2876         * trans-openmp.c (gfc_trans_omp_clauses): Use
2877         OMP_CLAUSE_DEFAULTMAP_SET_KIND.
2878         (gfc_trans_omp_atomic): Set OMP_ATOMIC_MEMORY_ORDER
2879         rather than OMP_ATOMIC_SEQ_CST.
2880         (gfc_trans_omp_taskgroup): Build OMP_TASKGROUP using
2881         make_node instead of build1_loc.
2882         * types.def (BT_FN_VOID_BOOL, BT_FN_VOID_SIZE_SIZE_PTR,
2883         BT_FN_UINT_UINT_PTR_PTR, BT_FN_UINT_OMPFN_PTR_UINT_UINT,
2884         BT_FN_BOOL_UINT_LONGPTR_LONG_LONG_LONGPTR_LONGPTR_PTR_PTR,
2885         BT_FN_BOOL_UINT_ULLPTR_LONG_ULL_ULLPTR_ULLPTR_PTR_PTR,
2886         BT_FN_BOOL_LONG_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR_PTR_PTR,
2887         BT_FN_BOOL_BOOL_ULL_ULL_ULL_LONG_ULL_ULLPTR_ULLPTR_PTR_PTR): New.
2888         (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_PTR): Formatting fix.
2890 2018-11-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
2892         PR fortran/46020
2893         * decl.c (verify_bind_c_sym): Remove unnecessary space
2894         in error message.
2896 2018-11-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
2898         PR fortran/87782
2899         * frontend-passes.c (constant_string_length): If there is a
2900         substring with a length which cannot be reduced to a constant,
2901         return NULL.
2903 2018-11-01  Paul Thomas  <pault@gcc.gnu.org>
2905         PR fortran/40196
2906         * dependency.c (are_identical_variables): Return false if the
2907         inquiry refs are not the same.
2908         (gfc_ref_needs_temporary_p): Break on an inquiry ref.
2909         * dump_parse_tree.c (show_ref): Show the inquiry ref type.
2910         * expr.c (gfc_free_ref_list): Break on an inquiry ref.
2911         (gfc_copy_ref): Copy the inquiry ref types.
2912         (find_inquiry_ref): New function.
2913         (simplify_const_ref, simplify_ref_chain): Call it. Add new arg
2914         to simplify_ref_chain.
2915         (gfc_simplify_expr): Use the new arg in call to
2916         simplify_ref_chain.
2917         (gfc_get_full_arrayspec_from_expr, gfc_is_coarray): Break on
2918         inquiry ref.
2919         (gfc_traverse_expr): Return true for inquiry ref.
2920         * frontend-passes.c (gfc_expr_walker): Break on inquiry ref.
2921         * gfortran.h : Add enums and union member in gfc_ref to
2922         implement inquiry refs.
2923         * intrinsic.c : Fix white nois.
2924         * match.c (gfc_match_assignment): A constant lavlue is an
2925         error.
2926         * module.c : Add DECL_MIO_NAME for inquiry_type and the mstring
2927         for inquiry_types.
2928         (mio_ref): Handle inquiry refs.
2929         * primary.c (is_inquiry_ref): New function.
2930         (gfc_match_varspec): Handle inquiry refs calling new function.
2931         (gfc_variable_attr): Detect inquiry ref for disambiguation
2932         with components.
2933         (caf_variable_attr): Treat inquiry and substring refs in the
2934         same way.
2935         * resolve.c (find_array_spec): ditto.
2936         (gfc_resolve_substring_charlen): If there is neither a charlen
2937         ref not an inquiry ref, return.
2938         (resolve_ref): Handle inqiry refs as appropriate.
2939         (resolve_allocate_expr): Entities with an inquiry ref cannot be
2940         allocated.
2941         * simplify.c (simplify_bound, simplify_cobound): Punt on
2942         inquiry refs.
2943         * trans-array.c (get_array_ctor_var_strlen): Break on inquiry
2944         ref.
2945         *trans-expr.c (conv_inquiry): New function.
2946         (gfc_conv_variable): Retain the last typespec to pass to
2947         conv_inquiry on detecting an inquiry ref.
2949 2018-11-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
2951         PR fortran/46020
2952         * decl.c (verify_bind_c_sym): Improve error message.
2954 2018-11-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
2956         PR fortran/54613
2957         * gfortran.texi (File format of unformatted sequential files):
2958         Replace random comma with period.
2959         * intrinsic.texi (Intrinsic Procedures): Add FINDLOC to menu.
2960         (FINDLOC): Document.
2961         (MAXLOC): Add refrence to FINDLOC.
2962         (MINLOC): Likewise.
2964 2018-10-31  Nathan Sidwell  <nathan@acm.org>
2966         * cpp.c (gfc_cpp_init): Adjust cpp_force_token_locations call.
2968 2018-10-31  Martin Liska  <mliska@suse.cz>
2970         * trans-decl.c (struct module_hasher): Call htab_hash_string
2971         for s->name and not for s.
2973 2018-10-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
2975         PR fortran/85896
2976         * simplify.c (simplify_min_max): Do not convert the type of the
2977         return expression.
2979 2017-10-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
2981         PR fortran/54613
2982         * gfortran.h (gfc_isym_id): Add GFC_ISYM_FINDLOC.
2983         (gfc_check_f): Add f6fl field.
2984         (gfc_simplify_f): Add f6 field.
2985         (gfc_resolve_f): Likewise.
2986         (gfc_type_letter): Add optional logical_equas_int flag.
2987         * check.c (intrinsic_type_check): New function.
2988         (gfc_check_findloc): New function.
2989         * intrinsics.c (gfc_type_letter): If logical_equals_int is
2990         set, act accordingly.
2991         (add_sym_5ml):  Reformat comment.
2992         (add_sym_6fl): New function.
2993         (add_functions): Add findloc.
2994         (check_arglist): Add sixth argument, handle it.
2995         (resolve_intrinsic): Likewise.
2996         (check_specific): Handle findloc.
2997         * intrinsic.h (gfc_check_findloc): Add prototype.
2998         (gfc_simplify_findloc): Likewise.
2999         (gfc_resolve_findloc): Likewise.
3000         (MAX_INTRINSIC_ARGS): Adjust.
3001         * iresolve.c (gfc_resolve_findloc): New function.
3002         * simplify.c (gfc_simplify_minmaxloc): Make static.
3003         (simplify_findloc_to_scalar): New function.
3004         (simplify_findloc_nodim): New function.
3005         (simplify_findloc_to_array): New function.
3006         (gfc_simplify_findloc): New function.
3007         (gfc_conv_intrinsic_findloc): New function.
3008         (gfc_conv_intrinsic_function): Handle GFC_ISYM_FINDLOC.
3009         (gfc_is_intrinsic_libcall): Likewise.
3011 2018-10-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
3013         PR fortran/86907
3014         * frontend-passes.c (check_locus_code): Add information that
3015         warning about missing location information points to an
3016         inconsisten internal state.
3017         (check_locus_expr): Likewise.
3019 2018-10-25  Jakub Jelinek  <jakub@redhat.com>
3021         PR fortran/87725
3022         * openmp.c (gfc_match_omp_clauses): Parse simd, monotonic and
3023         nonmonotonic modifiers regardless of if they have been parsed
3024         already or if the opposite one has.  Fix up check whether
3025         comma after modifier should be parsed.
3026         (resolve_omp_clauses): Diagnose schedule modifier restrictions.
3028 2018-10-23  Paul Thomas  <pault@gcc.gnu.org>
3030         PR fortran/85603
3031         * frontend-passes.c (get_len_call): New function to generate a
3032         call to intrinsic LEN.
3033         (create_var): Use this to make length expressions for variable
3034         rhs string lengths.
3035         Clean up some white space issues.
3037 2018-10-21  Paul Thomas  <pault@gcc.gnu.org>
3039         PR fortran/71880
3040         * trans-expr.c (gfc_trans_pointer_assignment): Set the string
3041         length for array valued deferred length lhs.
3043 2018-10-18  Tobias Burnus  <burnus@net-b.de>
3045         PR fortran/87625
3046         * trans-array.c (gfc_is_reallocatable_lhs): Detect allocatable
3047         polymorphic arrays.
3049 2018-10-18  Paul Thomas  <pault@gcc.gnu.org>
3051         PR fortran/58618
3052         * trans-stmt.c (trans_associate_var): All strings that return
3053         as pointer types can be assigned directly to the associate
3054         name so remove 'attr' and the condition that uses it.
3056 2018-10-18  Paul Thomas  <pault@gcc.gnu.org>
3058         PR fortran/58618
3059         * trans-decl.c (gfc_get_symbol_decl): Deal correctly with the
3060         initialization with NULL() of a deferred length pointer.
3062 2018-10-17  Tobias Burnus  <burnus@net-b.de>
3064         PR fortran/87632
3065         * resolve.c (resolve_select_type): Use correct variable.
3067 2018-10-17  David Malcolm  <dmalcolm@redhat.com>
3069         * Make-lang.in (selftest-fortran): New.
3071 2018-10-17  Paul Thomas  <pault@gcc.gnu.org>
3073         PR fortran/56386
3074         PR fortran/58906
3075         PR fortran/77385
3076         PR fortran/80260
3077         PR fortran/82077
3078         * resolve.c (resolve_variable): Fix up expressions with array
3079         associate names, where the parser did not detect that this is
3080         array and there was no array part_ref in the expression.
3082 2018-10-16  Tobias Burnus  <burnus@net-b.de>
3084         PR fortran/67125
3085         * trans-array.c (gfc_array_init_size, gfc_array_allocate):
3086         Rename argument e3_is_array_constr to e3_has_nodescriptor
3087         and update comments.
3088         * trans-stmt.c (gfc_trans_allocate): Also fix lower bound
3089         to 1 for nonalloc/nonpointer func results/vars besides
3090         array constructors.
3092 2018-10-16  Tobias Burnus  <burnus@net-b.de>
3094         PR fortran/87556
3095         * trans-stmt.c (form_team, change_team, sync_team):
3096         Don't ignore argse.pre/argse.post.
3098 2018-10-15  Paul Thomas  <pault@gcc.gnu.org>
3099         Tobias Burnus  <burnus@gcc.gnu.org>
3101         PR fortran/87566
3102         * resolve.c (resolve_assoc_var): Add missing array spec for
3103         class associate names.
3104         (resolve_select_type): Handle case where last typed component
3105         of the selector has a different type to the expression.
3106         * trans-expr.c (gfc_find_and_cut_at_last_class_ref): Replace
3107         call to gfc_expr_to_initialize with call to gfc_copy_expr.
3108         (gfc_conv_class_to_class): Guard assignment to 'len' field
3109         against case where zero constant is supplied.
3111 2018-10-12  Tobias Burnus  <burnus@net-b.de>
3113         PR fortran/87597
3114         * expr.c (gfc_simplify_expr): Avoid simplifying
3115         the 'array' argument to lbound/ubound/lcobound/
3116         ucobound.
3118 2018-10-12  Tobias Burnus <burnus@net-b.de>
3120         PR fortran/58787
3121         * decl.c (get_proc_name): Return with error before
3122         creating sym_tree.
3124 2018-10-11  Tobias Burnus <burnus@net-b.de>
3126         Revert:
3127         2018-10-09  Tobias Burnus <burnus@net-b.de>
3129         PR fortran/83522
3130         * resolve.c (resolve_ref): Reject nonscalar
3131         substring references.
3133 2018-10-09  David Malcolm  <dmalcolm@redhat.com>
3135         * cpp.c (gfc_cpp_init_0): Update for renamings.
3136         (cb_cpp_error): Rename to...
3137         (cb_cpp_diagnostic): ...this, converting level and reason to
3138         enums.
3140 2018-10-09  Tobias Burnus <burnus@net-b.de>
3142         PR fortran/83522
3143         * resolve.c (resolve_ref): Reject nonscalar
3144         substring references.
3146 2018-10-09  Paul Thomas  <pault@gcc.gnu.org>
3148         PR fortran/87151
3149         * trans-array.c (gfc_get_array_span): Deal with deferred char
3150         array components having a TYPE_MAX_VALUE of zero.
3151         (gfc_array_init_size): Use the hidden string length component
3152         to build the descriptor dtype.
3153         (gfc_array_allocate): Remove the erroneous replacement of the
3154         charlen backend decl with a temporary.
3155         (gfc_conv_expr_descriptor): Use the ss_info string length in
3156         the case of deferred character components.
3157         (gfc_alloc_allocatable_for_assignment): Actually compare the
3158         string lengths for deferred characters. Make sure that kind > 1
3159         is handled correctly. Set the span field of the descriptor.
3160         * trans-intrinsic.c (gfc_conv_intrinsic_len): Remove the stupid
3161         comment.
3163         PR fortran/80931
3164         * trans-array.c (gfc_array_allocate): Set the span field for
3165         variable length character arrays.
3167 2018-10-08  Cesar Philippidis  <cesar@codesourcery.com>
3169         * expr.c (gfc_check_pointer_assign): Demote "Assignment to
3170         contiguous pointer from non-contiguous target" to a warning.
3172 2018-10-08  Paul Thomas  <pault@gcc.gnu.org>
3174         PR fortran/86372
3175         * trans-stmt.c (trans_associate_var): Character associate names
3176         with variable string length do not have to be deferred length
3177         for the string length to be set, if variable.
3179 2018-10-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
3181         PR fortran/86111
3182         * gfortran.h (enum arith): Add ARITH_WRONGCONCAT.
3183         * arith.h (gfc_arith_error): Issue error for ARITH_WRONGCONCAT.
3184         (gfc_arith_concat):  If the types of op1 and op2 are not
3185         character of if their kinds do not match, issue ARITH_WRONGCONCAT.
3187 2018-10-06  Paul Thomas  <pault@gcc.gnu.org>
3189         PR fortran/83999
3190         * resolve.c (resolve_fl_procedure): Include class functions in
3191         the test that elemental function results be scalar.
3193 2018-10-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
3195         PR fortran/84640
3196         * simplify.c (gfc_simplify_cshift): Extend size of hs_ex and ss_ex
3197         by one. Set extents one past the array boundaries to zero to avoid
3198         warning with instrumented compiler.
3199         (gfc_simplify_eoshift): Likewise, only for ss_ex.
3201 2018-10-05  Paul Thomas  <pault@gcc.gnu.org>
3203         PR fortran/87487
3204         * trans-decl.c (gfc_get_symbol_decl): Make sure that deferred
3205         character length pointer initializer has the right type to fix
3206         problem with deferred_character_24.f90 on big endian.
3208 2018-10-03  Jeff Law  <law@redhat.comg>
3210         * trans-types.c (get_typenode_from_name): Moved into gcc/tree.c.
3212 2018-10-01  Paul Thomas  <pault@gcc.gnu.org>
3214         PR fortran/65677
3215         * trans-expr.c (gfc_trans_assignment_1): Set the 'identical'
3216         flag in the call to gfc_check_dependency.
3218 2018-09-30  Paul Thomas  <pault@gcc.gnu.org>
3220         PR fortran/87359
3221         * trans-array.c (gfc_is_reallocatable_lhs): Correct the problem
3222         introduced by r264358, which prevented components of associate
3223         names from being reallocated on assignment.
3225 2018-09-30  Paul Thomas  <pault@gcc.gnu.org>
3227         PR fortran/70752
3228         PR fortran/72709
3229         * trans-array.c (gfc_conv_scalarized_array_ref): If this is a
3230         deferred type and the info->descriptor is present, use the
3231         info->descriptor
3232         (gfc_conv_array_ref): Is the se expr is a descriptor type, pass
3233         it as 'decl' rather than the symbol backend_decl.
3234         (gfc_array_allocate): If the se string_length is a component
3235         reference, fix it and use it for the expression string length
3236         if the latter is not a variable type. If it is a variable do
3237         an assignment. Make use of component ref string lengths to set
3238         the descriptor 'span'.
3239         (gfc_conv_expr_descriptor): For pointer assignment, do not set
3240         the span field if gfc_get_array_span returns zero.
3241         * trans.c (get_array_span): If the upper bound a character type
3242         is zero, use the descriptor span if available.
3244 2018-09-30  Paul Thomas  <pault@gcc.gnu.org>
3246         PR fortran/70149
3247         * trans-decl.c (gfc_get_symbol_decl): A deferred character
3248         length pointer that is initialized needs the string length to
3249         be initialized as well.
3251 2018-09-29  Paul Thomas  <pault@gcc.gnu.org>
3253         PR fortran/65677
3254         * trans-expr.c (gfc_trans_assignment_1): If there is dependency
3255         fix the rse stringlength.
3257 2018-09-25  Martin Liska  <mliska@suse.cz>
3259         PR fortran/87394
3260         * decl.c (add_hidden_procptr_result): Simplify condition
3261         as we are in branch witch 'case1 || case2'.
3263 2018-09-25  Martin Liska  <mliska@suse.cz>
3265         * trans.c (remove_suffix): Remove
3266         unused function.
3268 2018-09-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
3270         PR fortran/87397
3271         * gfc_conv_procedure_call: Do not add clobber on INTENT(OUT)
3272         for variables in an associate statement.
3274 2018-09-24  Bernhard Reuther-Fischer  <aldot@gcc.gnu.org>
3275             Cesar Philippidis  <cesar@codesourcery.com>
3277         * openmp.c (resolve_oacc_loop_blocks):
3279 2018-09-23  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 having the dimension attribute.
3285 2018-09-23  Janne Blomqvist  <jb@gcc.gnu.org>
3287         * trans-expr.c (gfc_caf_get_image_index): Do array index
3288         calculations in gfc_array_index_type.
3289         * trans-intrinsic.c (conv_intrinsic_event_query): Likewise.
3290         * trans-stmt.c (gfc_trans_lock_unlock): Likewise.
3291         (gfc_trans_event_post_wait): Likewise.
3293 2018-09-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
3295         PR fortran/87395
3296         * gfc_conv_procedure_call: Reformat comments slightly. Do not add
3297         clobber on INTENT(OUT) for saved variables.
3299 2018-09-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
3301         PR fortran/41453
3302         * trans.h (gfc_conv_expr_reference): Add optional argument
3303         add_clobber to prototype.
3304         (gfc_conv_procedure_call):  Set add_clobber argument to
3305         gfc_conv_procedure_reference to true for scalar, INTENT(OUT),
3306         non-pointer, non-allocatable, non-dummy variables whose type
3307         is neither BT_CHARACTER, BT_DERIVED or BT_CLASS, but only if
3308         the procedure is not elemental.
3309         * trans-expr.c (gfc_conv_procedure_reference): Add clobber
3310         statement before call if add_clobber is set.
3312 2018-09-22  Paul Thomas  <pault@gcc.gnu.org>
3314         PR fortran/85603
3315         * trans-array.c (gfc_alloc_allocatable_for_assignment): Test
3316         the charlen backend_decl before using the VAR_P macro.
3318 2018-09-21  Paul Thomas  <pault@gcc.gnu.org>
3320         PR fortran/77325
3321         * trans-array.c (gfc_alloc_allocatable_for_assignment): If the
3322         rhs has a charlen expression, convert that and use it.
3323         * trans-expr.c (gfc_trans_assignment_1): The rse.pre for the
3324         assignment of deferred character array vars to a realocatable
3325         lhs should not be added to the exterior block since vector
3326         indices, for example, generate temporaries indexed within the
3327         loop.
3329 2018-09-21  Paul Thomas  <pault@gcc.gnu.org>
3331         PR fortran/87359
3332         * trans-stmt.c (gfc_trans_allocate): Don't deallocate alloc
3333         components if must_finalize is set for expr3.
3335 2018-09-21  Andrew Stubbs  <ams@codesourcery.com>
3336             Kwok Cheung Yeung  <kcy@codesourcery.com>
3338         * trans-expr.c (gfc_trans_structure_assign): Ensure that the first
3339         argument of a call to _gfortran_caf_register is of size_type_node.
3340         * trans-intrinsic.c (conv_intrinsic_event_query): Convert computed
3341         index to a size_type_node type.
3342         * trans-stmt.c (gfc_trans_event_post_wait): Likewise.
3344 2018-09-20  Allan Sandfeld Jensen  <allan.jensen@qt.io>
3346         * gfortranspec.c (lang_specific_driver): Handle -r like -nostdlib.
3348 2018-09-20  Janus Weil  <janus@gcc.gnu.org>
3350         * gfortran.h (gfc_str_startswith): New macro.
3351         * decl.c (variable_decl, gfc_match_end): Use it.
3352         * iresolve.c (is_trig_resolved): Ditto.
3353         * module.c (load_omp_udrs, read_module): Ditto.
3354         * options.c (gfc_handle_runtime_check_option): Ditto.
3355         * primary.c (match_arg_list_function): Ditto.
3356         * trans-decl.c (gfc_get_symbol_decl): Ditto.
3357         * trans-expr.c (gfc_conv_procedure_call): Ditto.
3358         * interface.c (dtio_op): Replace strncmp by strcmp.
3359         * resolve.c (resolve_actual_arglist, resolve_function): Ditto.
3360         * trans-expr.c (conv_arglist_function): Ditto.
3361         * trans-intrinsic.c (gfc_conv_ieee_arithmetic_function): Replace macro
3362         STARTS_WITH by gfc_str_startswith.
3364 2018-09-20  Cesar Philippidis  <cesar@codesourcery.com>
3366         * dump-parse-tree.c (show_omp_clauses): Add missing omp list_types
3367         and reorder the switch cases to match the enum in gfortran.h.
3369 2018-09-19  Paul Thomas  <pault@gcc.gnu.org>
3371         PR fortran/84109
3372         * trans-expr.c (gfc_trans_assignment_1): The rse.pre for the
3373         assignment of deferred character intrinsic elemental function
3374         results to a realocatable lhs must not be added to the exterior
3375         block if they are array valued but must go to the loop body.
3377 2018-09-18  Thomas Koenig  <tkoenig@gcc.gnu.org>
3379         PR fortran/29550
3380         * gfortran.h (gfc_expr): Add external_blas flag.
3381         * frontend-passes.c (matrix_case): Add case A2TB2T.
3382         (optimize_namespace): Handle flag_external_blas by
3383         calling call_external_blas.
3384         (get_array_inq_function): Add argument okind. If
3385         it is nonzero, use it as the kind of argument
3386         to be used.
3387         (inline_limit_check): Remove m_case argument, add
3388         limit argument instead.  Remove assert about m_case.
3389         Set the limit for inlining from the limit argument.
3390         (matmul_lhs_realloc): Handle case A2TB2T.
3391         (inline_matmul_assign): Handle inline limit for other cases with
3392         two rank-two matrices.  Remove no-op calls to inline_limit_check.
3393         (call_external_blas): New function.
3394         * trans-intrinsic.c (gfc_conv_intrinsic_funcall): Do not add
3395         argument to external BLAS if external_blas is already set.
3397 2018-09-18  Paul Thomas  <pault@gcc.gnu.org>
3399         PR fortran/87239
3400         * trans-expr.c (gfc_trans_assignment_1): The rse.pre for the
3401         assignment of deferred character elemental function results to
3402         a realocatable lhs must not be added to the exterior block but
3403         must go to the loop body.
3405 2018-09-18  Paul Thomas  <pault@gcc.gnu.org>
3407         PR fortran/87336
3408         * trans-array.c (gfc_get_array_span): Try to get the element
3409         length of incomplete types. Return NULL_TREE otherwise.
3410         (gfc_conv_expr_descriptor): Only set the 'span' field if the
3411         above does not return NULL_TREE. Set 'span' field if possible
3412         for all new descriptors.
3414 2018-09-17  Paul Thomas  <pault@gcc.gnu.org>
3416         PR fortran/64120
3417         * trans-decl.c (gfc_get_symbol_decl): Flag allocatable, scalar
3418         characters with a variable length expression for deferred init.
3419         (gfc_trans_deferred_vars): Perform the assignment for these
3420         symbols by calling gfc_conv_string_length.
3422 2018-09-17  Paul Thomas  <pault@gcc.gnu.org>
3424         PR fortran/85954
3425         * resolve.c (resolve_assoc_var): If the target expression is a
3426         deferred charlen dummy and the associate name shares the
3427         charlen, generate a new one. Make sure that new charlens are in
3428         the namespace list so that they get cleaned up.
3429         * trans-array.c (gfc_is_reallocatable_lhs): Associate names are
3430         not reallocatable.
3431         * trans-decl.c (gfc_get_symbol_decl): Put deferred character
3432         length dummy and result arrays on the deferred initialization
3433         list so that the variable length arrays can be correctly dealt
3434         with.
3435         * trans-expr.c (gfc_conv_string_length): Return if 'expr' is
3436         NULL rather than ICEing..
3438 2018-09-16  Janus Weil  <janus@gcc.gnu.org>
3440         PR fortran/86484
3441         PR fortran/84543
3442         * match.c (gfc_match_assignment): For a polymorphic assignment,
3443         make sure that the vtab for the rhs type is generated.
3445 2018-09-16  Thomas Koenig  <tkoenig@gcc.gnu.org>
3447         PR fortran/37802
3448         * frontend-passes.c (B_ERROR): New macro for matmul bounds
3449         checking error messages.
3450         (C_ERROR): Likewise.
3451         (inline_matmul_assign): Reorganize bounds checking, use B_ERROR
3452         and C_ERROR macros.
3454 2018-09-13  Bernd Edlinger  <bernd.edlinger@hotmail.de>
3456         * trans-array.c (gfc_conv_array_initializer): Remove excess precision
3457         from overlength string initializers.
3459 2018-09-12  Paul Thomas  <pault@gcc.gnu.org>
3461         PR fortran/87284
3462         * trans-expr.c (gfc_trans_class_init_assign): Access to
3463         to array elements of the dynamic type requires that the array
3464         reference be added to the class expression and not the _data
3465         component, unlike scalar expressions.
3467 2018-09-11  Janus Weil  <janus@gcc.gnu.org>
3469         PR fortran/87172
3470         * resolve.c (resolve_fl_derived): If a type has the 'use_assoc'
3471         attribute, then it was declared in another module, so there should be
3472         no error that it has not been declared.
3474 2018-09-11  Paul Thomas  <pault@gcc.gnu.org>
3476         PR fortran/87277
3477         * expr.c (is_subref_array): Add the check of dimensionality for
3478         class, dummy, pointer arrays.
3480 2018-09-11  Janus Weil  <janus@gcc.gnu.org>
3482         PR fortran/86830
3483         * expr.c (gfc_is_simply_contiguous): Handle type-bound procedure calls
3484         with non-polymorphic objects.
3486 2018-09-10  Janus Weil  <janus@gcc.gnu.org>
3488         PR fortran/85395
3489         * decl.c (match_binding_attributes): Use correct default accessibility
3490         for procedure pointer components.
3492 2018-09-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3494         * simplify.c (gfc_simplify_modulo): Re-arrange code to test whether
3495         'P' is zero and issue an error if it is.
3497 2018-08-31  Paul Thomas  <pault@gcc.gnu.org>
3499         PR fortran/86328
3500         PR fortran/86760
3501         * trans-array.c (gfc_conv_scalarized_array_ref): Do not fix
3502         info->descriptor but pass it directly to gfc_build_array_ref.
3503         (gfc_conv_array_ref): Likewise for se->expr.
3504         * trans.c (gfc_build_array_ref): If 'decl' is a COMPONENT_REF
3505         obtain the span field directly from it.
3507 2017-08-28  Paul Thomas  <pault@gcc.gnu.org>
3509         PR fortran/80477
3510         * trans-expr.c (gfc_conv_procedure_call): Allocatable class
3511         scalar results being passed to a derived type formal argument
3512         are finalized if possible. Otherwise, rely on existing code for
3513         deallocation. Make the deallocation of allocatable result
3514         components conditional on finalization not taking place. Make
3515         the freeing of data components after finalization conditional
3516         on the data being NULL.
3517         (gfc_trans_arrayfunc_assign): Change the gcc_assert to a
3518         condition to return NULL_TREE.
3519         (gfc_trans_assignment_1): If the assignment is class to class
3520         and the rhs expression must be finalized but the assignment
3521         is not marked as a polymorphic assignment, use the vptr copy
3522         function instead of gfc_trans_scalar_assign.
3524         PR fortran/86481
3525         * trans-expr.c (gfc_conv_expr_reference): Do not add the post
3526         block to the pre block if the expression is to be finalized.
3527         * trans-stmt.c (gfc_trans_allocate): If the expr3 must be
3528         finalized, load the post block into a finalization block and
3529         add it right at the end of the allocation block.
3531 2018-08-27  David Malcolm  <dmalcolm@redhat.com>
3533         PR 87091
3534         * error.c (gfc_format_decoder): Update for conversion of
3535         show_caret_p to a tri-state.
3537 2018-08-25  Janus Weil  <janus@gcc.gnu.org>
3539         PR fortran/86545
3540         * resolve.c (resolve_transfer): Correctly determine typespec for
3541         generic function calls, in order to throw a proper error.
3543 2018-08-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
3545         PR fortran/86837
3546         * frontend-passes.c (var_in_expr_callback): New function.
3547         (var_in_expr): New function.
3548         (traverse_io_block): Use var_in_expr instead of
3549         gfc_check_dependency for checking if the variable depends on the
3550         previous interators.
3552 2018-08-23  Janne Blomqvist  <blomqvist.janne@gmail.com>
3554         * trans-intrinsic.c (gfc_conv_intrinsic_minmaxval): Delete
3555         HONOR_SIGNED_ZEROS checks.
3557 2018-08-23  Paul Thomas  <pault@gcc.gnu.org>
3559         PR fortran/86863
3560         * resolve.c (resolve_typebound_call): If the TBP is not marked
3561         as a subroutine, check the specific symbol.
3563 2018-08-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
3565         * gfortran.texi: Mention that asynchronous I/O does
3566         not work on systems which lack condition variables, such
3567         as AIX.
3569 2018-08-22  Janus Weil  <janus@gcc.gnu.org>
3571         PR fortran/86935
3572         * match.c (gfc_match_associate): Improve diagnostics for the ASSOCIATE
3573         statement.
3575 2018-08-22  Andrew Benson  <abensonca@gmail.com>
3577         * module.c (load_generic_interfaces): Move call to find_symbol()
3578         so that only occurs if actually needed.
3580 2018-08-22  Janus Weil  <janus@gcc.gnu.org>
3582         PR fortran/86888
3583         * decl.c (gfc_match_data_decl): Allow allocatable components of
3584         indirectly recursive type.
3585         * resolve.c (resolve_component): Remove two errors messages ...
3586         (resolve_fl_derived): ... and replace them by a new one.
3588 2018-08-21  Janne Blomqvist  <jb@gcc.gnu.org>
3590         * trans-intrinsic.c (gfc_conv_intrinsic_minmax): Use
3591         MAX_EXPR/MIN_EXPR unconditionally for real arguments.
3592         * gfortran.texi (Compiler Characteristics): Document MAX/MIN
3593         behavior wrt NaN.
3595 2018-08-21  Nicolas Koenig  <koenigni@gcc.gnu.org>
3596         Thomas Koenig <tkoenig@gcc.gnu.org>
3598         PR fortran/25829
3599         * gfortran.texi: Add description of asynchronous I/O.
3600         * trans-decl.c (gfc_finish_var_decl): Treat asynchronous variables
3601         as volatile.
3602         * trans-io.c (gfc_build_io_library_fndecls): Rename st_wait to
3603         st_wait_async and change argument spec from ".X" to ".w".
3604         (gfc_trans_wait): Pass ID argument via reference.
3606 2018-08-16  Nathan Sidwell  <nathan@acm.org>
3608         * cpp.c (dump_macro): Use cpp_user_macro_p.
3610 2018-08-14  Janus Weil  <janus@gcc.gnu.org>
3612         PR fortran/86116
3613         * interface.c (compare_type): Remove a CLASS/TYPE check.
3614         (compare_type_characteristics): New function that behaves like the old
3615         'compare_type'.
3616         (gfc_check_dummy_characteristics, gfc_check_result_characteristics):
3617         Call 'compare_type_characteristics' instead of 'compare_type'.
3619 2018-08-12  Paul Thomas  <pault@gcc.gnu.org>
3621         PR fortran/66679
3622         * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Class array
3623         elements are returned as references to the data element. Get
3624         the class expression by stripping back the references. Use this
3625         for the element size.
3627 2018-08-12  Paul Thomas  <pault@gcc.gnu.org>
3629         PR fortran/86906
3630         * resolve.c (resolve_fl_variable_derived): Check if the derived
3631         type is use associated before checking for the host association
3632         error.
3634 2018-08-10  Janus Weil  <janus@gcc.gnu.org>
3636         PR fortran/57160
3637         * invoke.texi (frontend-optimize): Mention short-circuiting.
3638         * options.c (gfc_post_options): Disable -ffrontend-optimize with -Og.
3639         * resolve.c (resolve_operator): Warn about short-circuiting only with
3640         -ffrontend-optimize.
3641         * trans-expr.c (gfc_conv_expr_op): Use short-circuiting operators only
3642         with -ffrontend-optimize. Without that flag, make sure that both
3643         operands are evaluated.
3645 2018-08-08  Nathan Sidwell  <nathan@acm.org>
3647         * cpp.c (cb_file_change): Use linemap_included_from.
3649 2018-08-07  Cesar Philippidis  <cesar@codesourcery.com>
3651         * trans-stmt.h: Remove stale reference to trans-openacc.c.
3653 2018-08-04  Janus Weil  <janus@gcc.gnu.org>
3655         PR fortran/45521
3656         * interface.c (gfc_compare_interfaces): Apply additional
3657         distinguishability criteria of F08 to operator interfaces.
3659 2018-07-31  Andre Vieira  <andre.simoesdiasvieira@arm.com>
3661         Revert 'AsyncI/O patch committed'
3662         2018-07-25  Nicolas Koenig  <koenigni@gcc.gnu.org>
3663                 Thomas Koenig <tkoenig@gcc.gnu.org>
3665         PR fortran/25829
3666         * gfortran.texi: Add description of asynchronous I/O.
3667         * trans-decl.c (gfc_finish_var_decl): Treat asynchronous variables
3668         as volatile.
3669         * trans-io.c (gfc_build_io_library_fndecls): Rename st_wait to
3670         st_wait_async and change argument spec from ".X" to ".w".
3671         (gfc_trans_wait): Pass ID argument via reference.
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-20  Martin Sebor  <msebor@redhat.com>
3686         PR middle-end/82063
3687         * gfortran.h (gfc_handle_option): Change function argument
3688         to HOST_WIDE_INT.
3689         * options.c (gfc_handle_option): Same.
3691 2018-07-20  Andrew Benson  <abenson@carnegiescience.edu>
3693         * gfortran.h (gfc_symbol): Add pointer to next derived type.
3694         (gfc_dt_list, gfc_get_dt_list): Remove.
3695         (gfc_namespace): Replace gfc_dt_list with gfc_symbol.
3696         * parse.c (resolve_all_program_units): Replace gfc_free_dt_list() with
3697         simple nullification of gfc_derived_types.
3698         * resolve.c (resolve_global_procedure): Replace gfc_dt_list with
3699         gfc_symbol.
3700         (add_dt_to_dt_list): Change derived type linked list insertion to
3701         utilize dt_next pointers in gfc_symbol.
3702         * symbol.c (gfc_new_symbol, gfc_free_dt_list, gfc_symbol_done2)
3703         (get_iso_c_binding_dt, generate_isocbinding_symbol): Remove
3704         gfc_free_dt_list as gfc_dt_list is obsoleted. Change derived type
3705         linked list search/insertion to utilize dt_next pointers in gfc_symbol.
3706         * trans-types.c (gfc_get_derived_type): Change derived type linked
3707         list search to utilize dt_next pointers in gfc_symbol.
3709 2018-07-19  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
3711         * trans-intrinsic.c: (gfc_conv_intrinsic_minmax): Emit MIN_MAX_EXPR
3712         or IFN_FMIN/FMAX sequence to calculate the min/max when possible.
3714 2018-07-18  Janus Weil  <janus@gcc.gnu.org>
3715             Thomas Koenig  <tkoenig@gcc.gnu.org>
3717         PR fortran/85599
3718         * dump-parse-tree.c (show_attr): Add handling of implicit_pure.
3719         * frontend-passes.c (do_warn_function_elimination): Do not warn for
3720         pure functions.
3721         * gfortran.h: Add prototypes for gfc_pure_function and
3722         gfc_implicit_pure_function.
3723         * gfortran.texi: Add chapter on evaluation of logical expressions.
3724         * invoke.texi: Mention that -Wfunction-elimination is implied
3725         by -Wextra.
3726         * lang.opt: Make -Wextra imply -Wfunction-elimination.
3727         * resolve.c (pure_function): Rename to gfc_pure_function.
3728         (gfc_implicit_pure_function): New function.
3729         (check_pure_function): Use it here.
3730         (impure_function_callback): New function.
3731         (resolve_operator): Call it via gfc_expr_walker.
3733 2018-07-16  Fritz Reese  <fritzoreese@gmail.com>
3735         PR fortran/83184
3736         * decl.c (match_old_style_init): Initialize locus of variable expr when
3737         creating a data variable.
3738         (match_clist_expr): Verify array is explicit shape/size before
3739         attempting to allocate constant array constructor.
3741 2018-07-16  Fritz Reese  <fritzoreese@gmail.com>
3743         PR fortran/86417
3744         * module.c (mio_component): Set component->loc when loading from module.
3746 2018-07-10  Jakub Jelinek  <jakub@redhat.com>
3748         PR fortran/86421
3749         * module.c (omp_declare_simd_clauses): Add LINEAR with _REF, _VAL and
3750         _UVAL suffixes.
3751         (mio_omp_declare_simd): Save and restore ref, val and uval modifiers
3752         on linear clauses.  Initialize n->where to gfc_current_locus.
3754 2018-07-05  Paul Thomas  <pault@gcc.gnu.org>
3756         PR fortran/86408
3757         * resolve.c.c (resolve_contained_fntype): Reference to C418 is
3758         in F2008 and not F2003.
3759         (resolve_function): Ditto in error message. Also, exclude
3760         deferred character length results from the error.
3762 2018-07-05  Fritz Reese  <fritzoreese@gmail.com>
3764         PR fortran/83183
3765         PR fortran/86325
3766         * expr.c (class_allocatable, class_pointer, comp_allocatable,
3767         comp_pointer): New helpers.
3768         (component_initializer): Generate EXPR_NULL for allocatable or pointer
3769         components. Do not generate initializers for components within BT_CLASS.
3770         Do not assign to comp->initializer.
3771         (gfc_generate_initializer): Use new helpers; move code to generate
3772         EXPR_NULL for class allocatable components into component_initializer().
3774 2018-07-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3776         PR fortran/82009
3777         * trans-decl.c (gfc_process_block_locals): Delete assert and set
3778         saved_local_decls = NULL_TREE.
3780 2018-07-02  Richard Biener  <rguenther@suse.de>
3782         PR lto/86321
3783         * trans-types.c (gfc_get_array_type_bounds): Unshare TYPE_FIELDs
3784         for the distinct type copy.
3786 2018-07-02  Paul Thomas  <pault@gcc.gnu.org>
3788         PR fortran/82969
3789         PR fortran/86242
3790         * trans-array.c (structure_alloc_comps): Do not explicitly copy
3791         procedure pointer components.
3793 2018-07-02  Paul Thomas  <pault@gcc.gnu.org>
3795         PR fortran/45305
3796         * expr.c : Add a prototype for scalarize_intrinsic_call.
3797         (gfc_simplify_expr): Use scalarize_intrinsic_call for elemental
3798         intrinsic function calls.
3799         (scalarize_intrinsic_call): Add 'init_flag' argument. Check if
3800         the expression or any of the actual argument expressions are
3801         NULL. Before calling gfc_check_init_expr, check 'init_flag'.
3802         Only simplify the scalarized expressions if there are no errors
3803         on the stack.
3804         (gfc_check_init_expr): Set 'init_flag' true in the call to
3805         scalarize_intrinsic_call.
3807 2018-06-28  Fritz Reese  <fritzoreese@gmail.com>
3809         PR fortran/82865
3810         * decl.c (gfc_match_type): Refactor and check for PDT declarations.
3812 2018-06-28  Martin Liska  <mliska@suse.cz>
3814         * gfortranspec.c: Include opt-suggestions.h.
3816 2018-06-25  Fritz Reese  <fritzoreese@gmail.com>
3818         PR fortran/82972
3819         PR fortran/83088
3820         PR fortran/85851
3821         * expr.c (component_initializer): Assign init expr to c->initializer.
3822         (generate_isocbinding_initializer): New.
3823         (gfc_generate_initializer): Call generate_isocbinding_initializer to
3824         generate initializers for c_ptr and c_funptr with -finit-derived.
3826 2018-06-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3828         PR fortran/85983
3829         * interface.c (check_dtio_interface1): Delete assert.
3831 2018-06-22  Paul Thomas  <pault@gcc.gnu.org>
3832             Rainer Orth  <ro@gcc.gnu.org>
3834         PR fortran/86281
3835         * resolve.c (resolve_contained_fntype): Check for the charlen
3836         before testing the length.
3838 2018-06-21  Paul Thomas  <pault@gcc.gnu.org>
3840         PR fortran/49630
3841         * resolve.c (resolve_contained_fntype): Change standard ref.
3842         from F95 to F2003: C418. Correct a spelling error in a comment.
3843         It is an error for an abstract interface to have an assumed
3844         character length result.
3845         * trans-expr.c (gfc_conv_procedure_call): Likewise change the
3846         standard reference.
3848 2018-06-21  Paul Thomas  <pault@gcc.gnu.org>
3850         PR fortran/83118
3851         * resolve.c (resolve_ordinary_assign): Force the creation of a
3852         vtable for assignment of non-polymorphic expressions to an
3853         unlimited polymorphic object.
3854         * trans-array.c (gfc_alloc_allocatable_for_assignment): Use the
3855         size of the rhs type for such assignments. Set the dtype, _len
3856         and vptrs appropriately.
3857         * trans-expr.c (gfc_trans_assignment): Force the use of the
3858         _copy function for these assignments.
3860 2018-06-20  Chung-Lin Tang <cltang@codesourcery.com>
3861             Thomas Schwinge <thomas@codesourcery.com>
3862             Cesar Philippidis  <cesar@codesourcery.com>
3864         * gfortran.h (gfc_omp_clauses): Add unsigned if_present, finalize
3865         bitfields.
3866         * openmp.c (enum omp_mask2): Remove OMP_CLAUSE_PRESENT_OR_*. Add
3867         OMP_CLAUSE_{IF_PRESENT,FINALIZE}.
3868         (gfc_match_omp_clauses): Update handling of copy, copyin, copyout,
3869         create, deviceptr, present_of_*. Add support for finalize and
3870         if_present.
3871         (OACC_PARALLEL_CLAUSES): Remove PRESENT_OR_* clauses.
3872         (OACC_KERNELS_CLAUSES): Likewise.
3873         (OACC_DATA_CLAUSES): Likewise.
3874         (OACC_DECLARE_CLAUSES): Likewise.
3875         (OACC_UPDATE_CLAUSES): Add IF_PRESENT clause.
3876         (OACC_ENTER_DATA_CLAUSES): Remove PRESENT_OR_* clauses.
3877         (OACC_EXIT_DATA_CLAUSES): Add FINALIZE clause.
3878         (gfc_match_oacc_declare): Update to OpenACC 2.5 semantics.
3879         * trans-openmp.c (gfc_trans_omp_clauses): Add support for IF_PRESENT
3880         and FINALIZE.
3882 2018-06-18  Eric Botcazou  <ebotcazou@adacore.com>
3884         * trans-decl.c (gfc_get_fake_result_decl): Revert latest change.
3886 2018-06-17  Eric Botcazou  <ebotcazou@adacore.com>
3888         * trans-decl.c (nonlocal_dummy_decl_pset): Delete.
3889         (nonlocal_dummy_decls): Likewise.
3890         (gfc_nonlocal_dummy_array_decl): Likewise.
3891         (gfc_get_symbol_decl): Do not call gfc_nonlocal_dummy_array_decl.
3892         (gfc_get_fake_result_decl): Do not generate a new DECL if simply
3893         reusing the result of a recursive call.
3894         (gfc_generate_function_code): Do not create, insert and destroy
3895         nonlocal_dummy_decls.
3897 2018-06-13  Steven G. Kargl  <kargl@gcc.gnu.org>
3899         PR fortran/86110
3900         * array.c (gfc_resolve_character_array_constructor): Avoid NULL
3901         pointer dereference.
3903 2018-06-13  Cesar Philippidis  <cesar@codesourcery.com>
3905         PR fortran/85703
3906         * parse.c (decode_oacc_directive): Set gfc_matching_function
3907         to false.
3908         (decode_omp_directive): Likewise.
3910 2018-06-13  Cesar Philippidis  <cesar@codesourcery.com>
3912         PR fortran/85702
3913         * openmp.c (gfc_match_oacc_wait): Use %C to report error location.
3915 2018-06-12  David Malcolm  <dmalcolm@redhat.com>
3917         PR other/69968
3918         * misc.c (gfc_closest_fuzzy_match): Update for renaming of
3919         levenshtein_distance to get_edit_distance.
3921 2018-06-12  Steven G. Kargl  <kargl@gcc.gnu.org>
3923         PR fortran/44491
3924         * expr.c (gfc_check_assign): Select non-NULL locus.
3926 2018-06-11  Janus Weil  <janus@gcc.gnu.org>
3928         PR fortran/45521
3929         * interface.c (compare_ptr_alloc): New function.
3930         (generic_correspondence): Call it.
3932 2018-06-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
3934         * gfortran.h (gfc_expr): Add no_bounds_check field.
3935         * frontend-passes.c (get_array_inq_function): Set no_bounds_check
3936         on function and function argument.
3937         (inline_matmul_assign): Set no_bounds_check on zero expression
3938         and on lhs of zero expression.
3939         Also handle A1B2 case if realloc on assigment is active.
3940         * trans-array.c (gfc_conv_array_ref): Don't do range checking
3941         if expr has no_bounds_check set.
3942         (gfc_conv_expr_descriptor): Set no_bounds_check on ss if expr
3943         has it set.
3944         * trans-expr.c (gfc_trans_assignment_1): Set no_bounds_check
3945         on lss and lss if the corresponding expressions have it set.
3947 2018-06-10  Dominique d'Humieres  <dominiq@gcc.gnu.org>
3949         PR fortran/79854
3950         * trans-const.c: Remove include "diagnostic-core.h".
3951         (gfc_conv_constant_to_tree): Replace fatal_error with gcc_unreachable.
3953 2018-06-10  Janus Weil  <janus@gcc.gnu.org>
3955         PR fortran/85088
3956         * decl.c (match_attr_spec): Synchronize the DECL_* enum values with the
3957         INTENT_* values from the enum 'sym_intent'. Call 'match_intent_spec'
3958         and remove a TODO note.
3959         * gfortran.h: Add a comment to sym_intent.
3961 2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>
3963         PR fortran/38351
3964         * resolve.c (resolve_operator): Provide better error message for
3965         derived type entity used in an binary intrinsic numeric operator.
3967 2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>
3969         PR fortran/85138
3970         PR fortran/85996
3971         PR fortran/86051
3972         * decl.c (gfc_match_char_spec): Use private namespace in attempt to
3973         reduce a charlen to a constant.
3975 2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>
3977         PR fortran/78278
3978         * data.c (gfc_assign_data_value): Re-arrange code to allow for
3979         an error for double initialization of CHARACTER entities.
3981 2018-06-09  Steven G. Kargl  <kargl@gcc.gnu.org>
3983         PR fortran/63514
3984         * symbol.c (gfc_add_volatile): Enforce F2008:C1282 and F2018:C1588.
3986 2018-06-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
3988         PR fortran/85631
3989         * trans.h (gfc_ss): Add field no_bounds_check.
3990         * trans-array.c (gfc_conv_ss_startstride): If flag_realloc_lhs and
3991         ss->no_bounds_check is set, do not use runtime checks.
3992         * trans-expr.c (gfc_trans_assignment_1): Set lss->no_bounds_check
3993         for reallocatable lhs.
3995 2018-06-08  Steven G. Kargl  <kargl@gcc.gnu.org>
3997         PR fortran/86059
3998         * array.c (match_array_cons_element): NULL() cannot be in an
3999         array constructor.
4001 2018-06-08  Steven G. Kargl  <kargl@gcc.gnu.org>
4003         PR fortran/78571
4004         * data.c (create_character_initializer): Return early if type is
4005         incompatible with CHARACTER.
4007 2018-06-07  Steven G. Kargl  <kargl@gcc.gnu.org>
4009         PR fortran/86045
4010         * simplify.c (gfc_simplify_mod): Re-arrange code to test whether
4011         'P' is zero and issue an error if it is.
4013 2018-06-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
4015         PR fortran/85641
4016         * frontend-passes.c (is_fe_temp): Add prototype.
4017         (realloc_string_callback): Early return for frontend-generated
4018         temporary.
4020 2018-06-05  Cesar Philippidis  <cesar@codesourcery.com>
4022         PR fortran/85701
4024         * openmp.c (gfc_resolve_oacc_declare): Error on functions and
4025         subroutine data clause arguments.
4027 2018-06-04  Steven G. Kargl  <kargl@gcc.gnu.org>
4029         PR fortran/85981
4030         * resolve.c (resolve_allocate_deallocate): Check errmsg is default
4031         character kind.
4033 2018-06-03  Paul Thomas  <pault@gcc.gnu.org>
4035         PR fortran/36497
4036         * decl.c (variable_decl): Use gfc_add_type for cray pointees.
4038 2018-06-01  Steven G. Kargl  <kargl@gcc.gnu.org>
4040         PR fortran/63570
4041         * check.c (gfc_check_random_init): New function. Check arguments of
4042         RANDOM_INIT.
4043         * gfortran.h (GFC_ISYM_RANDOM_INIT): New enum token.
4044         * intrinsic.c (add_subroutines): Add RANDOM_INIT to list of
4045         subroutines.
4046         (gfc_check_intrinsic_standard): Introduce Fortran 2018 check.
4047         * intrinsic.h: Add prototypes for gfc_check_random_init and
4048         gfc_resolve_random_init
4049         * intrinsic.texi: Document new intrinsic subprogram.
4050         * iresolve.c (gfc_resolve_random_init): Resolve routine name.
4051         * trans-decl.c: Declare gfor_fndecl_random_init
4052         * trans-intrinsic.c (conv_intrinsic_random_init): New function.
4053         Translate call to RANDOM_INIT.
4054         (gfc_conv_intrinsic_subroutine): Call it.
4055         * trans.h: Declare gfor_fndecl_random_init
4057 2018-05-27  Steven G. Kargl  <kargl@gcc.gnu.org>
4059         * decl.c (match_data_constant):  Fortran 2018 allows pointer
4060         initialization in a data statement.
4062 2018-05-25  Janus Weil  <janus@gcc.gnu.org>
4064         PR fortran/85839
4065         * match.c (gfc_match_block_data): Call gfc_notify_std to warn about
4066         an obsolescent feature in Fortran 2018.
4067         (gfc_match_equivalence): Ditto.
4068         * resolve.c (resolve_common_blocks): Ditto.
4069         (gfc_resolve_forall): Ditto.
4070         * symbol.c (gfc_define_st_label): Ditto.
4072 2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
4074         PR fortran/85543
4075         * resolve.c (update_current_proc_array_outer_dependency): Avoid NULL
4076         pointer dereference.
4078 2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
4080         PR fortran/85780
4081         * resolve.c (resolve_fl_procedure): Avoid NULL dereference.
4083 2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
4085         PR fortran/85779
4086         * decl.c (gfc_match_derived_decl): Fix NULL point dereference.
4088 2018-05-24  Steven G. Kargl  <kargl@gcc.gnu.org>
4090         PR fortran/85895
4091         * resolve.c (resolve_sync): Resolve expression before checking for
4092         an error.
4094 2018-05-22  Janus Weil  <janus@gcc.gnu.org>
4096         PR fortran/85841
4097         * libgfortran.h: Remove the macros GFC_STD_F2008_TS and
4098         GFC_STD_OPT_F08TS.
4099         * error.c (notify_std_msg): Remove GFC_STD_F2008_TS.
4100         * options.c (set_default_std_flags): Ditto.
4101         (gfc_handle_option): Make -std=f2008ts an alias for -std=f2018.
4102         * array.c (gfc_match_array_spec): Replace GFC_STD_F2008_TS by
4103         GFC_STD_F2018.
4104         * check.c (gfc_check_atomic, gfc_check_event_query,
4105         gfc_check_c_f_pointer, gfc_check_c_f_procpointer, gfc_check_c_funloc,
4106         gfc_check_c_loc, gfc_check_num_images, gfc_check_this_image): Ditto.
4107         * decl.c (gfc_verify_c_interop_param, gfc_match_decl_type_spec): Ditto.
4108         * intrinsic.c (add_functions, add_subroutines,
4109         gfc_check_intrinsic_standard): Ditto.
4110         * iso-c-binding.def: Ditto.
4111         * iso-fortran-env.def: Ditto.
4112         * match.c (gfc_match_event_post, gfc_match_event_wait,
4113         gfc_match_fail_image, gfc_match_form_team, gfc_match_change_team,
4114         gfc_match_end_team, gfc_match_sync_team): Ditto.
4115         * gfortran.texi: Remove mention of -std=f2008ts.
4116         Move TSs into F2018 section.
4117         * invoke.texi: Update documentation of -std=f2008ts.
4119 2018-05-21  Janus Weil  <janus@gcc.gnu.org>
4121         PR fortran/85841
4122         * libgfortran.h: New macros GFC_STD_OPT_*.
4123         * error.c (notify_std_msg): New function.
4124         (gfc_notify_std): Adjust such that it can handle combinations of
4125         GFC_STD_* flags in the 'std' argument, not just a single one.
4126         * match.c (match_arithmetic_if, gfc_match_if): Reject arithmetic if
4127         in Fortran 2018.
4128         (gfc_match_stopcode): Use GFC_STD_OPT_* macros.
4129         * options.c (set_default_std_flags): Warn for F2018 deleted features
4130         by default.
4131         (gfc_handle_option): F2018 deleted features are allowed in earlier
4132         standards.
4133         * symbol.c (gfc_define_st_label, gfc_reference_st_label): Reject
4134         nonblock do constructs in Fortran 2018.
4136 2018-05-20  Paul Thomas  <pault@gcc.gnu.org>
4138         PR fortran/80657
4139         * resolve.c (flag_fn_result_spec): Use the 'sym' argument to
4140         test for self refs to the function result in the character len
4141         expression. If a self reference is found, emit an error and
4142         return true.
4143         (resolve_fntype): Use the function symbol in the calls to the
4144         above.
4146 2018-05-20  Paul Thomas  <pault@gcc.gnu.org>
4148         PR fortran/49636
4149         * trans-array.c (gfc_get_array_span): Renamed from
4150         'get_array_span'.
4151         (gfc_conv_expr_descriptor): Change references to above.
4152         * trans-array.h : Add prototype for 'gfc_get_array_span'.
4153         * trans-intrinsic.c (gfc_conv_associated): Add pre and post
4154         blocks for 'arg1'.
4155         * trans-stmt.c (trans_associate_var): If the associate name is
4156         a subref array pointer, use gfc_get_array_span for the span.
4158 2018-05-20  Paul Thomas  <pault@gcc.gnu.org>
4160         PR fortran/82275
4161         * match.c (gfc_match_type_spec): Go through the array ref and
4162         decrement 'rank' for every dimension that is an element.
4164 2018-05-19  Paul Thomas  <pault@gcc.gnu.org>
4166         PR fortran/82923
4167         PR fortran/66694
4168         PR fortran/82617
4169         * trans-array.c (gfc_alloc_allocatable_for_assignment): Set the
4170         charlen backend_decl of the rhs expr to ss->info->string_length
4171         so that the value in the current scope is used.
4173 2018-05-13  Steven G. Kargl  <kargl@gcc.gnu.org>
4175         PR fortran/63529
4176         * gfortran.texi: Clarify documentation for Cray pointer and
4177         assumed-sized array.
4179 2018-05-13  Paul Thomas  <pault@gcc.gnu.org>
4181         PR fortran/85742
4182         * trans-types.c (gfc_get_dtype_rank_type): Reorder evaluation
4183         of 'size'. If the element type is a pointer use the size of the
4184         TREE_TYPE of the type, unless it is VOID_TYPE. In this latter
4185         case, set the size to zero.
4187 2018-05-13  Steven G. Kargl  <kargl@gcc.gnu.org>
4189         * gfortran.h: Remove prototype.
4190         * symbol.c (gfc_new_undo_checkpoint): Remove unused function.
4192 2018-05-11  Steven G. Kargl  <kargl@gcc.gnu.org>
4194         PR fortran/85542
4195         * expr.c (check_inquiry): Avoid NULL pointer dereference.
4197 2018-05-10  Steven G. Kargl  <kargl@gcc.gnu.org>
4199         PR fortran/85687
4200         * check.c (gfc_check_rank): Check that the argument is a data object.
4202 2018-05-10  Steven G. Kargl  <kargl@gcc.gnu.org>
4204         PR fortran/85521
4205         * array.c (gfc_resolve_character_array_constructor): Substrings
4206         with upper bound smaller than lower bound are zero length strings.
4208 2018-05-10  Steven G. Kargl  <kargl@gcc.gnu.org>
4210         PR fortran/70870
4211         * data.c (gfc_assign_data_value): Check that a data object does
4212         not also have default initialization.
4214 2018-05-10  Marek Polacek  <polacek@redhat.com>
4216         PR fortran/85735
4217         * options.c (gfc_post_options): Set main_input_filename.
4219 2018-05-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
4221         PR fortran/54613
4222         * intrinsic.texi: Document BACK for MINLOC and MAXLOC.
4224 2018-05-10  Paul Thomas  <pault@gcc.gnu.org>
4226         PR fortran/68846
4227         PR fortran/70864
4228         * resolve.c (get_temp_from_expr): The temporary must not have
4229         dummy or intent attributes.
4231 2018-05-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
4233         PR fortran/54613
4234         * check.c (gfc_check_minmaxloc): Remove error for BACK not being
4235         implemented.  Use gfc_logical_4_kind for BACK.
4236         * simplify.c (min_max_choose): Add optional argument back_val.
4237         Handle it.
4238         (simplify_minmaxloc_to_scalar): Add argument back_val. Pass
4239         back_val to min_max_choose.
4240         (simplify_minmaxloc_to_nodim): Likewise.
4241         (simplify_minmaxloc_to_array): Likewise.
4242         (gfc_simplify_minmaxloc): Add argument back, handle it.
4243         Pass back_val to specific simplification functions.
4244         (gfc_simplify_minloc): Remove ATTRIBUTE_UNUSED from argument back,
4245         pass it on to gfc_simplify_minmaxloc.
4246         (gfc_simplify_maxloc): Likewise.
4247         * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Adjust
4248         comment. If BACK is true, use greater or equal (or lesser or
4249         equal) insteal of greater (or lesser). Mark the condition of
4250         having found a value which exceeds the limit as unlikely.
4252 2018-05-07  Jeff Law  <law@redhat.comg>
4254         * scanner.c (preprocessor_line): Call linemap_add after a line
4255         directive that changes the current filename.
4257 2018-05-06  Andre Vehreschild  <vehre@gcc.gnu.org>
4259         PR fortran/85507
4260         * dependency.c (gfc_dep_resolver): Revert looking at coarray dimension
4261         introduced by r259385.
4262         * trans-intrinsic.c (conv_caf_send): Always report a dependency for
4263         same variables in coarray assignments.
4265 2018-05-02  Tom de Vries  <tom@codesourcery.com>
4267         PR libgomp/82428
4268         * f95-lang.c (DEF_GOACC_BUILTIN_ONLY): Define.
4270 2018-04-24  Steven G. Kargl  <kargl@gcc.gnu.org>
4272         PR fortran/85520
4273         * decl.c (gfc_match_char_spec): Check for negative length and set to 0.
4275 2018-04-14  Andre Vehreschild  <vehre@gcc.gnu.org>
4277         PR fortran/81773
4278         PR fortran/83606
4279         * dependency.c (gfc_dep_resolver): Coarray indexes are to be ignored
4280         during dependency computation.  They define no data dependency.
4281         * trans-array.c (conv_array_index_offset): The stride can not be set
4282         here, prevent fail.
4283         * trans-intrinsic.c (conv_caf_send): Add creation of temporary array
4284         for caf_get's result and copying to the array with vectorial
4285         indexing.
4287 2018-04-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
4289         PR fortran/85387
4290         * frontend-passes.c (traverse_io_block): Check for start, end or
4291         stride being defined by an outer implied DO loop.
4293 2018-04-12  Thomas Koenig  <tkoenig@gcc.gnu.org>
4295         PR fortran/83064
4296         PR testsuite/85346
4297         * trans-stmt.c (gfc_trans_forall_loop): Use annot_expr_ivdep_kind
4298         for annotation and remove dependence on -ftree-parallelize-loops.
4300 2018-04-10  Jakub Jelinek  <jakub@redhat.com>
4302         PR fortran/85313
4303         * openmp.c (resolve_omp_do): Remove bogus if (j < i) break;.
4304         (resolve_oacc_nested_loops): Likewise.  Formatting fix.
4306 2018-04-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
4308         PR fortran/83064
4309         * trans-stmt.c (gfc_trans_forall_loop): Remove annotation for
4310         parallell processing of DO CONCURRENT -ftree-parallelize-loops
4311         is set.
4313 2018-04-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
4315         PR fortran/51260
4316         * resolve.c (resolve_variable): Simplify cases where access to a
4317         parameter array results in a single constant.
4319 2018-04-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
4321         PR fortran/85102
4322         * decl.c (variable_decl): If upper or lower bounds simplify
4323         to a constant, use that.
4325 2018-03-30  Paul Thomas  <pault@gcc.gnu.org>
4327         PR fortran/84931
4328         * simplify.c (gfc_convert_constant): Handle case of array
4329         constructors within an array that has no iterator and improve
4330         the conciseness of this section of code.
4332 2017-03-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
4334         PR fortran/85111
4335         * array.c (gfc_resolve_character_array_constructor): Early
4336         exit for zero-size arrays.
4337         * simplify.c (simplify_transformation_to_array): Exit early
4338         if the result size is zero.
4339         (simplify_minmaxloc_to_array): Likewise.
4341 2018-03-28  Mikael Morin  <mikael@gcc.gnu.org>
4343         PR fortran/69497
4344         * symbol.c (gfc_symbol_done_2): Start freeing namespaces
4345         from the root.
4346         (gfc_free_namespace): Restore assert (revert r258839).
4348 2018-03-28  Jakub Jelinek  <jakub@redhat.com>
4350         * gfortran.h (gfc_dt): Rename default_exp field to dec_ext.
4351         * ioparm.def (IOPARM_dt_default_exp): Rename to ...
4352         (IOPARM_dt_dec_ext): ... this.
4353         * trans-io.c (build_dt): Adjust for default_exp renaming to
4354         dec_ext and IOPARM_dt_default_exp renaming to IOPARM_dt_dec_ext.
4355         * io.c (match_io): Likewise.
4357 2018-03-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
4359         PR fortran/85084
4360         * frontend-passes.c (gfc_run_passes): Do not run front-end
4361         optimizations if a previous error occurred.
4363 2018-03-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
4364         Harald Anlauf  <anlauf@gmx.de>
4366         PR fortran/85083
4367         * primary.c (gfc_convert_to_structure_constructor): Check
4368         conformance of argument types in structure constructor.
4370 2018-03-26  Thomas Koenig  <tkoenig@gcc.gnu.org>
4372         PR fortran/66709
4373         * io.c: Include constructor.h.
4374         (resolve_tag_format): For a constant character array, concatenate
4375         into a single character expression.
4377 2018-03-25  Seth Johnson <johnsonsr@ornl.gov>
4378         Dominique d'Humieres  <dominiq@gcc.gnu.org>
4380         PR fortran/84924
4381         * check.c (gfc_check_c_f_pointer): Allow scalar noninteroperable
4382         scalar derived type with -std=f2003 and -std=f2008.
4384 2018-03-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
4385             Dominique d'Humieres  <dominiq@gcc.gnu.org>
4387         PR fortran/69497
4388         * symbol.c (gfc_free_namespace): Delete the assert and only if
4389         refs count is equals zero, free the namespace. Otherwise,
4390         something is halfway and other errors will resound.
4392 2018-03-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
4394         PR fortran/70068
4395         * expr.c (find_substring_ref): Change types of start, end
4396         and length variables to gfc_charlen_t. Set length to zero
4397         for empty substring.
4399 2018-03-24  Steven G. Kargl  <kargl@gcc.gnu.org>
4401         PR fortran/42651
4402         * decl.c (check_function_name): Improved error message
4403         (gfc_match_volatile, gfc_match_asynchronous) Use check_function_name.
4405 2018-03-22  Steven G. Kargl  <kargl@gcc.gnu.org>
4407         PR fortran/84922
4408         * decl.c (get_proc_name): If the MODULE prefix appears in interface
4409         body, then it must appear on the contained subroutine or function.
4410         While here, fix nearby mis-indented code.
4412 2018-03-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
4413         Harald Anlauf  <anlauf@gmx.de>
4415         PR fortran/84957
4416         * trans-types.c (gfc_sym_type): Do not dereference NULL pointer.
4418 2018-03-21  Janne Blomqvist  <jb@gcc.gnu.org>
4420         PR fortran/84615
4421         * trans-expr.c (gfc_conv_procedure_call): Convert charlen to
4422         gfc_charlen_type_node when calling procedure.
4424 2018-03-20  Steven G. Kargl  <kargl@gcc.gnu.org>
4426         PR fortran/85001
4427         * interface.c (symbol_rank): Remove bogus null pointer check that
4428         crept in when translating a ternary operator into an if-else
4429         constructor.
4431 2018-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
4433         PR fortran/84931
4434         * simplify.c (gfc_convert_constant): Correctly handle iterators
4435         for type conversion.
4437 2018-03-18  Steven G. Kargl  <kargl@gcc.gnu.org>
4439         PR fortran/77414
4440         * decl.c (get_proc_name):  Check for a subroutine re-defined in
4441         the contain portion of a subroutine.  Change language of existing
4442         error message to better describe the issue. While here fix whitespace
4443         issues.
4445 2018-03-18  Steven G. Kargl  <kargl@gcc.gnu.org>
4447         PR fortran/65453
4448         * decl.c (get_proc_name): Catch clash between a procedure statement
4449         and a contained subprogram
4451 2018-03-16  Steven G. Kargl  <kargl@gcc.gnu.org>
4453         PR fortran/69395
4454         * decl.c (merge_array_spec): Correct the error condition.
4456 2018-03-15  Steven G. Kargl  <kargl@gcc.gnu.org>
4458         PR fortran/78741
4459         * decl.c (get_proc_name):  Check for clash of entry name with
4460         subroutine name.
4462 2018-03-15  Steven G. Kargl  <kargl@gcc.gnu.org>
4464         PR fortran/69395
4465         * decl.c (merge_array_spec): Limit the merging to maximum allowed
4466         dimensions, and issue error message if limit is exceeded.
4468 2018-03-13  Steven G. Kargl  <kargl@gcc.gnu.org>
4470         * check.c (gfc_check_kill_sub):  Remove check for INTEGER(4) or (8).
4471         * intrinsic.c (add_functions): Remove reference to gfc_resolve_kill.
4472         (add_subroutines): Remove reference to gfc_resolve_kill_sub.
4473         * intrinsic.texi: Update documentation.
4474         * iresolve.c (gfc_resolve_kill, gfc_resolve_kill_sub): Remove.
4475         * trans-decl.c (gfc_build_intrinsic_function_decls):  Add
4476         gfor_fndecl_kill and gfor_fndecl_kill_sub
4477         * trans-intrinsic.c (conv_intrinsic_kill, conv_intrinsic_kill_sub): new
4478         functions.
4479         (gfc_conv_intrinsic_function): Use conv_intrinsic_kill.
4480         (gfc_conv_intrinsic_subroutine): Use conv_intrinsic_kill_sub.
4481         * trans.h: Declare gfor_fndecl_kill and gfor_fndecl_kill_sub.
4483 2018-03-11  Paul Thomas  <pault@gcc.gnu.org>
4485         PR fortran/84546
4486         * trans-array.c (structure_alloc_comps): Make sure that the
4487         vptr is copied and that the unlimited polymorphic _len is used
4488         to compute the size to be allocated.
4489         * trans-expr.c (gfc_get_class_array_ref): If unlimited, use the
4490         unlimited polymorphic _len for the offset to the element.
4491         (gfc_copy_class_to_class): Set the new 'unlimited' argument.
4492         * trans.h : Add the boolean 'unlimited' to the prototype.
4494 2018-03-11  Steven G. Kargl  <kargl@gcc.gnu.org>
4496         PR fortran/83939
4497         * resolve.c (resolve_fl_procedure): Enforce F2018:C15100.
4499 2018-03-11  Steven G. Kargl  <kargls@gcc.gnu.org>
4501         * check.c (gfc_check_kill):  Check pid and sig are scalar.
4502         (gfc_check_kill_sub): Restrict kind to 4 and 8.
4503         * intrinsic.c (add_function): Sort keyword list.  Add pid and sig
4504         keywords for KILL.  Remove redundant *back="back" in favor of the
4505         original *bck="back".
4506         (add_subroutines): Sort keyword list.  Add pid and sig keywords
4507         for KILL.
4508         * intrinsic.texi: Fix documentation to consistently use pid and sig.
4509         * iresolve.c (gfc_resolve_kill): Kind can only be 4 or 8.  Choose the
4510         correct function.
4511         (gfc_resolve_rename_sub): Add comment.
4513 2018-03-11  Thomas Koenig  <tkoenig@gcc.gnu.org>
4515         PR fortran/66128
4516         * simplify.c (simplify_transformation): Return default result for
4517         empty array argument.
4518         (gfc_simplify_all): Remove special-case handling for zerosize.
4519         (gfc_simplify_any): Likewise.
4520         (gfc_simplify_count): Likewise.
4521         (gfc_simplify_iall): Likewise.
4522         (gfc_simplify_iany): Likewise.
4523         (gfc_simplify_iparity): Likewise.
4524         (gfc_simplify_minval): Likewise.
4525         (gfc_simplify_maxval): Likewise.
4526         (gfc_simplify_norm2): Likewise.
4527         (gfc_simplify_product): Likewise.
4528         (gfc_simplify_sum): Likewise.
4530 2018-03-10  Steven G. Kargl  <kargl@gcc.gnu.org>
4532         PR fortran/84734
4533         * arith.c (check_result, eval_intrinsic):  If result overflows, pass
4534         the expression up the chain instead of a NULL pointer.
4536 2018-03-07  Steven G. Kargl  <kargl@gcc.gnu.org>
4538         PR fortran/64124
4539         PR fortran/70409
4540         * decl.c (gfc_match_char_spec): Try to reduce a charlen to a constant.
4542 2017-03-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
4544         PR fortran/84697
4545         PR fortran/66128
4546         * expr.c (simplify_parameter_variable): If p is a size zero array
4547         and not an ARRAY_EXPR insert an empty array constructor and
4548         return.
4549         * gfortran.h: Add prototype for gfc_is_size_zero_array.
4550         * simplify.c (is_size_zero_array): Make non-static and rename into
4551         (gfc_is_size_zero_array):  Check for parameter arrays of zero
4552         size by comparing shape and absence of constructor.
4553         (gfc_simplify_all): Use gfc_is_size_zero_array instead of
4554         is_size_zero_array.
4555         (gfc_simplify_count): Likewise.
4556         (gfc_simplify_iall): Likewise.
4557         (gfc_simplify_iany): Likewise.
4558         (gfc_simplify_iparity): Likewise.
4559         (gfc_simplify_minval): Likewise.
4560         (gfc_simplify_maxval): Likewise.
4561         (gfc_simplify_product): Likewise.
4562         (gfc_simplify_sum): Likewise.
4564 2018-03-06  Steven G. Kargl  <kargl@gcc.gnu.org>
4566         PR fortran/56667
4567         * primary.c (match_sym_complex_part): Give the matcher for an implied
4568         do-loop a chance to run.
4570 2018-03-03  Harald Anlauf  <anlauf@gmx.de>
4572         PR fortran/71085
4573         * trans-expr.c (gfc_apply_interface_mapping_to_expr): Do not
4574         dereference NULL pointer.
4576 2018-03-03  Steven G. Kargl  <kargl@gcc.gnu.org>
4578         PR fortran/66128
4579         * simplify.c (is_size_zero_array): New function to check for size
4580         zero array.
4581         (gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
4582          gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
4583          gfc_simplify_minval, gfc_simplify_maxval, gfc_simplify_norm2,
4584          gfc_simplify_product, gfc_simplify_sum): Use it, and implement
4585         requirements from F2018.
4587 2018-03-03  Steven G. Kargl  <kargl@gcc.gnu.org>
4589         PR fortran/51434
4590         * simplify.c (gfc_simplify_transfer): Resolve mold.
4592 2018-03-03  Paul Thomas  <pault@gcc.gnu.org>
4594         PR fortran/80965
4595         * resolve.c (build_loc_call): Change symtree name from 'loc' to
4596         '_loc'.
4598 2018-03-01  Paul Thomas  <pault@gcc.gnu.org>
4600         PR fortran/84219
4601         * target-memory.c (gfc_interpret_derived): Assert that BT_VOID
4602         components are caf tokens.
4603         (gfc_target_interpret_expr): Treat BT_VOID expressions as
4604         integers.
4606 2018-03-01  Paul Thomas  <pault@gcc.gnu.org>
4608         PR fortran/84538
4609         * class.c (class_array_ref_detected): Remove the condition that
4610         there be no reference after the array reference.
4611         (find_intrinsic_vtab): Remove excess whitespace.
4612         * trans-array.c (gfc_conv_scalarized_array_ref): Rename 'tmp'
4613         as 'base and call build_class_array_ref earlier.
4615 2018-02-28  Paul Thomas  <pault@gcc.gnu.org>
4617         PR fortran/83901
4618         * trans-stmt.c (trans_associate_var): Make sure that the se
4619         expression is a pointer type before converting it to the symbol
4620         backend_decl type.
4622 2018-02-25  Steven G. Kargl  <kargl@gcc.gnu.org>
4624         PR fortran/83633
4625         * decl.c (variable_decl): Check that an explicit-shape-array with
4626         nonconstant bounds is allowed.
4628 2018-02-25  Paul Thomas  <pault@gcc.gnu.org>
4630         PR fortran/84523
4631         * trans-intrinsic.c (gfc_conv_allocated): If the argument se
4632         has a pre block, add it to the expression pre block.
4634 2018-02-25  Thomas Koenig  <tkoenig@gcc.gnu.org>
4636         PR fortran/78238
4637         * gfortran.h (gfc_integer_4_kind): Define.
4638         * resolve.c (resolve_select_type): Make sure that the
4639         kind of c->high is gfc_integer_4_kind.
4641 2018-02-24  Steven G. Kargl <kargl@gcc.gnu.org>
4643         PR fortran/30792
4644         * decl.c (gfc_match_data): Check for invalid substring in
4645         data-implied-do
4647 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
4649         * intrinsic.texi: Arguments to MATMUL cannot both be rank one.
4651 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
4653         PR fortran/84511
4654         * trans-io.c (transfer_expr): Deal with C_LOC in transfer statement.
4656 2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>
4658         PR fortran/84346
4659         * interface.c (compare_actual_formal): Issue error if keyword is
4660         used in a statement function.
4662 2018-02-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
4664         PR fortran/84506
4665         * trans-io.c (set_parameter_value_inquire): Adjust range check of
4666         negative unit values for kind=8 units to the kind=4 negative limit.
4668 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
4670         PR fortran/83149
4671         * trans-types.c (gfc_sym_type): Test sym->ns->proc_name before
4672         accessing its components.
4674 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
4676         PR fortran/83149
4677         * trans-decl.c (gfc_finish_var_decl): Test sym->ns->proc_name
4678         before accessing its components.
4680 2018-02-23  Paul Thomas  <pault@gcc.gnu.org>
4682         PR fortran/83148
4683         * trans-const.c : Clean up some whitespace issues.
4684         * trans-expr.c (gfc_conv_initializer): If an iso_c_binding
4685         derived type has a kind value of zero, set it to the default
4686         integer kind.
4688 2018-02-23  Janne Blomqvist  <jb@gcc.gnu.org>
4690         PR fortran/84519
4691         * trans-decl.c (gfc_build_builtin_function_decls): Add bool
4692         argument to stop and error stop decls.
4693         * trans-stmt.c (gfc_trans_stop): Add false value to argument
4694         lists.
4696 2018-02-22  Janne Blomqvist  <jb@gcc.gnu.org>
4698         PR 78534
4699         PR 84509
4700         * trans-decl.c (gfc_build_builtin_function_decls): Pass
4701         gfc_int8_type node to pause_numeric, size_type_node to
4702         pause_string.
4703         * trans-stmt.c (gfc_trans_pause): Likewise.
4705 2018-02-22  Janne Blomqvist  <jb@gcc.gnu.org>
4707         * gfortran.texi: Update Coarray API description.
4708         * trans-decl.c (gfc_build_builtin_function_decls): Use size_t for
4709         character lengths, int for exit codes.
4710         (generate_coarray_sym_init): Use size_t for character length.
4711         * trans-intrinsic.c (conv_co_collective): Likewise.
4712         * trans-stmt.c (gfc_trans_lock_unlock): Likewise.
4713         (gfc_trans_event_post_wait): Likewise.
4714         (gfc_trans_sync): Likewise.
4715         (gfc_trans_stop): Use size_t for character lengths, int for exit
4716         codes.
4718 2018-02-20  Thomas Koenig  <tkoenig@gcc.gnu.org>
4720         PR fortran/48890
4721         PR fortran/83823
4722         * primary.c (gfc_convert_to_structure_constructor):
4723         For a constant string constructor, make sure the length
4724         is correct.
4726 2018-02-19  Paul Thomas  <pault@gcc.gnu.org>
4728         PR fortran/83344
4729         PR fortran/83975
4730         * resolve.c (resolve_assoc_var): Rearrange the logic for the
4731         determination of the character length of associate names. If
4732         the associate name is missing a length expression or the length
4733         expression is not a constant and the target is not a variable,
4734         make the associate name allocatable and deferred length.
4735         * trans-decl.c (gfc_get_symbol_decl): Null the character length
4736         backend_decl for deferred length associate names that are not
4737         variables. Set 'length' to gfc_index_zero_node for character
4738         associate names, whose character length is a PARM_DECL.
4740 2018-02-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
4742         PR fortran/35339
4743         * frontend-passes.c (traverse_io_block): Remove workaround for
4744         PR 80945.
4746 2018-02-19  Andre Vehreschild  <vehre@gcc.gnu.org>
4748         * gfortran.texi: Document additional src/dst_type.  Fix some typos.
4749         * trans-decl.c (gfc_build_builtin_function_decls): Declare the new
4750         argument of _caf_*_by_ref () with * e { get, send, sendget }.
4751         * trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Add the type of the
4752         data referenced when generating a call to caf_get_by_ref ().
4753         (conv_caf_send): Same but for caf_send_by_ref () and
4754         caf_sendget_by_ref ().
4756 2018-02-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
4758         PR fortran/84389
4759         * io.c (check_format): Allow FMT_COLON.
4761 2018-02-18  Paul Thomas  <pault@gcc.gnu.org>
4763         PR fortran/80945
4764         * trans-array.c (gfc_conv_expr_descriptor): Set parmtype from
4765         the typenode in the case of deferred length characters.
4767 2018-02-17  Thomas Koenig  <tkoenig@gcc.gnu.org>
4769         PR fortran/84270
4770         * frontend-passes (scalarized_expr):  If the expression
4771         is an assumed size array, leave in the last reference
4772         and pass AR_SECTION instead of AR_FULL to gfc_resolve
4773         in order to avoid an error.
4775 2018-02-17  Paul Thomas  <pault@gcc.gnu.org>
4777         PR fortran/84115
4778         * resolve.c (resolve_assoc_var): If a non-constant target expr.
4779         has no string length expression, make the associate variable
4780         into a deferred length, allocatable symbol.
4781         * trans-decl.c (gfc_is_reallocatable_lhs): Add and use a ptr to
4782         the symbol.
4783         * trans-stmt.c (trans_associate_var): Null and free scalar
4784         associate names that are allocatable. After assignment, remove
4785         the allocatable attribute to prevent reallocation.
4787 2018-02-16  Jakub Jelinek  <jakub@redhat.com>
4789         PR fortran/84418
4790         * trans-openmp.c (gfc_trans_omp_clauses): For OMP_CLAUSE_LINEAR_REF
4791         kind set OMP_CLAUSE_LINEAR_STEP to TYPE_SIZE_UNIT times last_step.
4793 2018-02-16  Dominique d'Humieres  <dominiq@gcc.gnu.org>
4795         PR fortran/84354
4796         * decl.c (gfc_get_pdt_instance): Replace '%qs' with %qs.
4798 2018-02-15  Janus Weil  <janus@gcc.gnu.org>
4800         PR fortran/84409
4801         * interface.c (check_dtio_arg_TKR_intent): Add a check for character
4802         length.
4804 2018-02-14  Janus Weil  <janus@gcc.gnu.org>
4806         PR fortran/84385
4807         * match.c (gfc_match_select_type): Fix check for selector in
4808         SELECT TYPE statement.
4810 2018-02-13  Janus Weil  <janus@gcc.gnu.org>
4812         PR fortran/84313
4813         * symbol.c (check_conflict): Reject procedure pointers in common blocks.
4815 2018-02-13  Alastair McKinstry  <alastair.mckinstry@sceal.ie>
4816             Janne Blomqvist  <jb@gcc.gnu.org>
4818         * module.c (dump_module): Use lbasename to ensure that module
4819         files are reproducible.
4821 2018-02-12  Janus Weil  <janus@gcc.gnu.org>
4823         PR fortran/84273
4824         * resolve.c (resolve_component): Fix checks of passed argument in
4825         procedure-pointer components.
4827 2018-02-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
4829         PR fortran/35299
4830         * resolve.c (resolve_formal_arglist): Update error message.
4832 2018-02-11  Andre Vehreschild  <vehre@gcc.gnu.org>
4834         * gfortran.texi: Fix typos in documentation of caf_register ().
4835         * trans-array.c (structure_alloc_comps): Only register a component of
4836         a derived typed corray, not of an ultimate component coarray.
4838 2018-02-11  Steven G. Kargl  <kargl@gcc.gnu.org>
4840         PR fortran/54223
4841         PR fortran/84276
4842         * interface.c (compare_actual_formal): Add in_statement_function
4843         bool parameter.  Skip check of INTENT attribute for statement
4844         functions.  Arguments to a statement function cannot be optional,
4845         issue error for missing argument.
4846         (gfc_procedure_use, gfc_ppc_use, gfc_arglist_matches_symbol): Use
4847          in_statement_function.
4849 2018-02-11  Paul Thomas  <pault@gcc.gnu.org>
4851         PR fortran/84074
4852         * trans-expr.c (gfc_conv_derived_to_class): Set the use_offset
4853         flag. If the is a vector subscript or the expression is not a
4854         variable, make the descriptor one-based.
4856 2018-02-10  Paul Thomas  <pault@gcc.gnu.org>
4858         PR fortran/84141
4859         PR fortran/84155
4860         * trans-array.c (gfc_array_init_size): Revert the change made
4861         in revision 257356 setting the dtype.
4862         * trans-types.c (gfc_get_dtype): Do not use the cached dtype.
4863         Call gfc_get_dtype_rank_type every time.
4865         PR fortran/56691
4866         * trans-array.c (gfc_conv_expr_descriptor): If the source array
4867         is a descriptor type, use its offset, removing the condition
4868         that is be a class expression.
4870 2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>
4872         PR fortran/82994
4873         * match.c (gfc_match_deallocate): Check for NULL pointer.
4875 2018-02-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
4877         PR fortran/68560
4878         * trans-intrinsic.c (gfc_conv_intrinsic_shape): New function.
4879         (gfc_conv_intrinsic_function): Call it.
4881 2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>
4883         PR fortran/82049
4884         * match.c (gfc_match_type_spec): If the charlen is non-NULL, then
4885         try to resolve it.  While here return early if possible.
4887 2018-02-04  Paul Thomas  <pault@gcc.gnu.org>
4889         PR fortran/84115
4890         * trans-decl.c (gfc_get_symbol_decl): Do not finish the decl of
4891         'length' if the symbol charlen backend_decl is an indirect ref.
4893 2018-02-03  Paul Thomas  <pault@gcc.gnu.org>
4895         PR fortran/84141
4896         PR fortran/84155
4897         * trans-array.c (gfc_array_init_size): Instead of gfc_get_dtype
4898         use gfc_get_dtype_rank_type.
4900 2018-02-01  Janne Blomqvist  <jb@gcc.gnu.org>
4902         PR 83975
4903         PR 83344
4904         * resolve.c (resolve_assoc_var): Generate an error if
4905         target length unknown.
4907 2018-02-01  Janne Blomqvist  <jb@gcc.gnu.org>
4909         PR fortran/83705
4910         * simplify.c (gfc_simplify_repeat): Increase limit for deferring
4911         to runtime, print a warning message.
4913 2018-01-31  Jakub Jelinek  <jakub@redhat.com>
4915         PR fortran/84116
4916         * openmp.c (gfc_match_omp_clauses): If all the linear
4917         gfc_match_omp_variable_list calls failed, don't gfc_free_omp_namelist
4918         nor set *head = NULL.  Formatting fixes.
4920 2018-01-31  Paul Thomas  <pault@gcc.gnu.org>
4922         PR fortran/84088
4923         * trans-expr.c (gfc_conv_procedure_call): If the parm expr is
4924         an address expression passed to an assumed rank dummy, convert
4925         to an indirect reference.
4927 2018-01-31  Thomas Koenig  <tkoenig@gcc.gnu.org>
4929         * dump-parse-tree.c (write_proc): Use sym_name (which may
4930         be sym->binding_label) instead of sym->name.
4932 2018-01-31  Janne Blomqvist  <jb@gcc.gnu.org>
4934         * trans-const.c (gfc_conv_string_init): Use gfc_charlen_t instead
4935         of int for slen.
4937 2018-01-31  Janne Blomqvist  <jb@gcc.gnu.org>
4939         PR fortran/78534
4940         * trans-expr.c (fill_with_spaces): Use memset instead of
4941         generating loop.
4942         (gfc_trans_string_copy): Improve opportunity to use builtins with
4943         constant lengths.
4945 2018-01-30  Jakub Jelinek  <jakub@redhat.com>
4947         PR debug/84131
4948         * trans-array.c (gfc_get_descriptor_offsets_for_info): Set *data_off
4949         to DATA_FIELD's offset rather than OFFSET_FIELD's offset.
4951 2018-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
4953         PR fortran/84134
4954         * array.c (gfc_ref_dimen_size): Whitespace fixes.  If stride is
4955         zero, return false.
4957 2018-01-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
4959         PR fortran/84133
4960         * frontend-passes (matmul_to_var_expr): Return early if
4961         in association list.
4962         (inline_matmul_assign): Likewise.
4964 2017-01-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
4966         PR fortran/84073
4967         * resolve.c (resolve_component): Ensure BIND(C) character
4968         components have length one.
4969         (resolve_symbol): Likewise for variables.
4971 2018-01-27  Jakub Jelinek  <jakub@redhat.com>
4973         PR fortran/84065
4974         * decl.c (add_init_expr_to_sym): Ignore initializers for too large
4975         lengths.
4977 2018-01-26  Damian Rouson  <damian@sourceryinstitute.org>
4978             Alessandro Fanfarillo  <fanfarillo.gcc@gmail.com>
4979             Soren Rasmussen  <s.c.rasmussen@gmail.com>
4981         Partial support for Fortran 2018 teams features.
4983         * array.c (gfc_match_array_ref): add team attribute in coarray
4984         transfers.
4985         * check.c (gfc_check_get_team, gfc_check_team_number): add new
4986         functions for get_team and team_number.
4987         * dump-parse-tree.c (show_code_node): add new statements: form team,
4988         change team, end team, and sync team.
4989         * expr.c (gfc_find_team_co): add new function.
4990         * gfortran.h: add new statements.
4991         * intrinsic.c (add_functions): add get_team and team_number functions.
4992         * intrinsic.h: add get_team and team_number prototypes for check,
4993         simplify, and resolve.
4994         * iresolve.c (gfc_resolve_get_team, gfc_resolve_team_number): add new
4995         functions.
4996         * iso-fortran-env.def: add the team_type derived type.
4997         * match.c (gfc_match_if, gfc_match_form_team, gfc_match_team_number)
4998         (gfc_match_end_team, gfc_match_sync_team, gfc_match_change_team):
4999         add change team, end team, form team, sync team match and functions.
5000         * match.h: add new prototypes for change team, end team, form team,
5001         and sync team.
5002         * parse.c (decode_statement): add cases for change team, end team,
5003         form team, and sync team.
5004         * resolve.c: add cases for exec form team, change team, end team, and
5005         sync team.
5006         * simplify.c (gfc_simplify_get_team): add new function for get team.
5007         * st.c (gfc_free_statement): add cases exec for change team, end team,
5008         form team, sync team.
5009         * trans-decl.c (gfor_fndecl_caf_form_team)
5010         (gfor_fndecl_caf_change_team, gfor_fndecl_caf_end_team)
5011         (gfor_fndecl_caf_sync_team, gfor_fndecl_caf_get_team)
5012         (gfor_fndecl_caf_team_number): add functions and definitions.
5013         * trans-intrinsic.c (conv_caf_send, conv_intrinsic_team_number): add
5014         new function and team_type argument support.
5015         * trans-stmt.c (gfc_trans_form_team, gfc_trans_change_team)
5016         (gfc_trans_end_team, gfc_trans_sync_team): add new functions.
5017         * trans-stmt.h: add new prototypes.
5018         * trans-types.c (gfc_get_derived_type): check condition for team_type.
5019         * trans.c (trans_code): new exec cases for form team, change team, end
5020         team, and sync team.
5021         * trans.h: add new prototypes.
5023 2018-01-26  Steven G. Kargl  <kargl@gcc.gnu.org>
5025         PR fortran/83998
5026         * simplify.c (compute_dot_product):  Initialize result to INTEGER(1) 0
5027         or .false.  The summation does the correct type conversion.
5028         (gfc_simplify_dot_product): Special case zero-sized arrays.
5030 2018-25-01  Paul Thomas  <pault@gcc.gnu.org>
5032         PR fortran/37577
5033         * array.c (gfc_match_array_ref): If standard earlier than F2008
5034         it is an error if the reference dimension is greater than 7.
5035         libgfortran.h : Increase GFC_MAX_DIMENSIONS to 15. Change the
5036         dtype masks and shifts accordingly.
5037         * trans-array.c (gfc_conv_descriptor_dtype): Use the dtype
5038         type node to check the field.
5039         (gfc_conv_descriptor_dtype): Access the rank field of dtype.
5040         (duplicate_allocatable_coarray): Access the rank field of the
5041         dtype descriptor rather than the dtype itself.
5042         * trans-expr.c (get_scalar_to_descriptor_type): Store the type
5043         of 'scalar' on entry and use its TREE_TYPE if it is ARRAY_TYPE
5044         (ie. a character).
5045         (gfc_conv_procedure_call): Pass TREE_OPERAND (tmp,0) to
5046         get_scalar_to_descriptor_type if the actual expression is a
5047         constant.
5048         (gfc_trans_structure_assign): Assign the rank directly to the
5049         dtype rank field.
5050         * trans-intrinsic.c (gfc_conv_intrinsic_rank): Cast the result
5051         to default integer kind.
5052         (gfc_conv_intrinsic_sizeof): Obtain the element size from the
5053         'elem_len' field of the dtype.
5054         * trans-io.c (gfc_build_io_library_fndecls): Replace
5055         gfc_int4_type_node with dtype_type_node where necessary.
5056         (transfer_namelist_element): Use gfc_get_dtype_rank_type for
5057         scalars.
5058         * trans-types.c : Provide 'get_dtype_type_node' to acces the
5059         dtype_type_node and, if necessary, build it.
5060         The maximum size of an array element is now determined by the
5061         maximum value of size_t.
5062         Update the description of the array descriptor, including the
5063         type def for the dtype_type.
5064         (gfc_get_dtype_rank_type): Build a constructor for the dtype.
5065         Distinguish RECORD_TYPEs that are BT_DERIVED or BT_CLASS.
5066         (gfc_get_array_descriptor_base): Change the type of the dtype
5067         field to dtype_type_node.
5068         (gfc_get_array_descr_info): Get the offset to the rank field of
5069         the dtype.
5070         * trans-types.h : Add a prototype for 'get_dtype_type_node ()'.
5071         * trans.h : Define the indices of the dtype fields.
5073 2018-23-01  Paul Thomas  <pault@gcc.gnu.org>
5075         PR fortran/83866
5076         * decl.c (gfc_match_derived_decl): If eos not matched, recover
5077         and emit error about garbage after declaration.
5079 2018-23-01  Paul Thomas  <pault@gcc.gnu.org>
5081         PR fortran/83898
5082         * trans-stmt.c (trans_associate_var): Do not set cst_array_ctor
5083         for characters.
5085 2018-01-22  Janne Blomqvist  <jb@gcc.gnu.org>
5087         PR 78534
5088         PR 83704
5089         * arith.c (gfc_arith_concat): Use size_t for string length.
5090         (gfc_compare_string): Likewise.
5091         (gfc_compare_with_Cstring): Likewise.
5092         * array.c (gfc_resolve_character_array_constructor): Use
5093         HOST_WIDE_INT, gfc_mpz_get_hwi.
5094         * check.c (gfc_check_fe_runtime_error): Use size_t.
5095         * data.c (create_character_initializer): Use HOST_WIDE_INT,
5096         gfc_extract_hwi.
5097         * decl.c (gfc_set_constant_character_len): Use gfc_charlen_t.
5098         (add_init_expr_to_sym): Use HOST_WIDE_INT.
5099         * expr.c (gfc_build_init_expr): Use HOST_WIDE_INT,
5100         gfc_extract_hwi.
5101         (gfc_apply_init): Likewise.
5102         * match.h (gfc_set_constant_character_len): Update prototype.
5103         * primary.c (match_string_constant): Use size_t.
5104         * resolve.c (resolve_ordinary_assign): Use HOST_WIDE_INT,
5105         gfc_mpz_get_hwi.
5106         * simplify.c (init_result_expr): Likewise.
5107         (gfc_simplify_len_trim): Use size_t.
5108         * target-memory.c (gfc_encode_character): Use size_t.
5109         (gfc_target_encode_expr): Use HOST_WIDE_INT, gfc_mpz_get_hwi.
5110         (interpret_array): Use size_t.
5111         (gfc_interpret_character): Likewise.
5112         * target-memory.h (gfc_encode_character): Update prototype.
5113         (gfc_interpret_character): Likewise.
5114         (gfc_target_interpret_expr): Likewise.
5115         * trans-const.c (gfc_build_string_const): Use size_t for length
5116         argument.
5117         (gfc_build_wide_string_const): Likewise.
5118         * trans-const.h (gfc_build_string_const): Likewise.
5119         (gfc_build_wide_string_const): Likewise.
5121 2018-01-20  Steven G. Kargl  <kargl@gcc.gnu.org>
5123         PR fortran/83900
5124     * simplify.c (gfc_simplify_matmul): Set return type correctly.
5126 2018-01-19  Steven G. Kargl  <kargl@gcc.gnu.org>
5128         PR fortran/83900
5129         * simplify.c (gfc_simplify_matmul): Delete bogus assertion.
5131 2018-01-17  Harald Anlauf  <anlauf@gmx.de>
5133         PR fortran/83864
5134         * expr.c (add_init_expr_to_sym): Do not dereference NULL pointer.
5136 2018-01-17  Harald Anlauf  <anlauf@gmx.de>
5138         PR fortran/83874
5139         * decl.c (add_init_expr_to_sym): Do not dereference NULL pointer.
5141 2018-01-15  Louis Krupp  <louis.krupp@zoho.com>
5143         PR fortran/82257
5144         * interface.c (compare_rank): Don't try to retrieve CLASS_DATA
5145         from symbol marked unlimited polymorphic.
5146         * resolve.c (resolve_structure_cons): Likewise.
5147         * misc.c (gfc_typename): Don't dereference derived->components
5148         if it's NULL.
5150 2018-01-15  Thomas Koenig  <tkoenig@gcc.gnu.org>
5152         PR fortran/54613
5153         * gfortran.h (gfc_check_f): Rename f4ml to f5ml.
5154         (gfc_logical_4_kind): New macro
5155         * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument.
5156         (gfc_simplify_maxloc): Likewise.
5157         (gfc_resolve_maxloc): Likewise.
5158         (gfc_resolve_minloc): Likewise.
5159         * check.c (gfc_check_minloc_maxloc): Add checking for "back"
5160         argument; also raise error if it is used (for now). Add it
5161         if it isn't present.
5162         * intrinsic.c (add_sym_4ml): Rename to
5163         (add_sym_5ml), adjust for extra argument.
5164         (add_functions): Add "back" constant. Adjust maxloc and minloc
5165         for back argument.
5166         * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is
5167         not of gfc_logical_4_kind, convert.
5168         (gfc_resolve_minloc): Likewise.
5169         * simplify.c (gfc_simplify_minloc): Add back argument.
5170         (gfc_simplify_maxloc): Likewise.
5171         * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last
5172         argument to %VAL to ensure passing by value.
5173         (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc
5174         also for library calls.
5176 2018-01-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
5178         PR fortran/82007
5179         * resolve.c (resolve_transfer): Delete code looking for 'DT'
5180         format specifiers in format strings. Set formatted to true if a
5181         format string or format label is present.
5182         * trans-io.c (get_dtio_proc): Likewise. (transfer_expr): Fix
5183         whitespace.
5185 2018-01-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
5187         PR fortran/83744
5188         * dump-parse-tree.c (get_c_type_name): Remove extra line.
5189         Change for loop to use declaration in for loop. Handle BT_LOGICAL
5190         and BT_CHARACTER.
5191         (write_decl): Add where argument. Fix indentation. Replace
5192         assert with error message. Add typename to warning
5193         in comment.
5194         (write_type): Adjust locus to call of write_decl.
5195         (write_variable): Likewise.
5196         (write_proc): Likewise. Replace assert with error message.
5198 2018-01-13  Paul Thomas  <pault@gcc.gnu.org>
5200         PR fortran/52162
5201         * trans-expr.c (gfc_trans_scalar_assign): Flag is_alloc_lhs if
5202         the rhs expression is neither an elemental nor a conversion
5203         function.
5205         PR fortran/83622
5206         * trans-array.c (is_pointer_array): Remove unconditional return
5207         of false for -fopenmp.
5209 2018-01-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
5210         <emsr@gcc.gnu.org>
5212         PR fortran/83803
5213         * dump-parse-tree.c (write_proc): Always emit closing parenthesis
5214         for functions.
5216 2018-01-10  Steven G. Kargl  <kargl@gcc.gnu.org>
5218         PR fortran/82367
5219         * resolve.c (resolve_allocate_expr): Check for NULL pointer.
5221 2018-01-10  Steven G. Kargl  <kargl@gcc.gnu.org>
5223         PR fortran/83093
5224         * resolve.c (resolve_charlen): Check the type of cl->length
5225         after resolution.
5227 2018-01-10  Janne Blomqvist  <jb@gcc.gnu.org>
5229         PR fortran/83740
5230         * trans-array.c (gfc_trans_array_ctor_element): Fix formatting.
5232 2018-01-10  Janne Blomqvist  <jb@gcc.gnu.org>
5234         PR fortran/83740
5235         * trans-array.c (gfc_trans_array_ctor_element): Convert RHS to the
5236         LHS type when assigning.
5238 2018-01-09  Steven G. Kargl  <kargl@gcc.gnu.org>
5240         PR fortran/83742
5241         * expr.c (gfc_is_simply_contiguous): Check for NULL pointer.
5243 2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>
5245         * match.c (gfc_match_allocate): Check for NULL pointer.
5247 2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>
5249         * expr.c (gfc_check_pointer_assign): Fix typo in comment.
5251 2018-01-08  Paul Thomas  <pault@gcc.gnu.org>
5253         PR fortran/83611
5254         * decl.c (gfc_get_pdt_instance): If parameterized arrays have
5255         an initializer, convert the kind parameters and add to the
5256         component if the instance.
5257         * trans-array.c (structure_alloc_comps): Add 'is_pdt_type' and
5258         use it with case COPY_ALLOC_COMP. Call 'duplicate_allocatable'
5259         for parameterized arrays. Clean up typos in comments. Convert
5260         parameterized array initializers and copy into the array.
5261         * trans-expr.c (gfc_trans_scalar_assign): Do a deep copy for
5262         parameterized types.
5263         *trans-stmt.c (trans_associate_var): Deallocate associate vars
5264         as necessary, when they are PDT function results for example.
5266         PR fortran/83731
5267         * trans-array.c (structure_alloc_comps): Only compare len parms
5268         when they are declared explicitly.
5270 2018-01-06  Janne Blomqvist  <jb@gcc.gnu.org>
5272         PR fortran/50892
5273         * trans-expr.c (gfc_trans_pointer_assignment): fold_convert rhs to
5274         lhs type.
5276 2018-01-05  Janne Blomqvist  <jb@gcc.gnu.org>
5278         PR fortran/78534
5279         PR fortran/66310
5280         * array.c (got_charlen): Use gfc_charlen_int_kind.
5281         * class.c (gfc_find_derived_vtab): Use gfc_size_kind instead of
5282         hardcoded kind.
5283         (find_intrinsic_vtab): Likewise.
5284         * decl.c (match_char_length): Use gfc_charlen_int_kind.
5285         (add_init_expr_to_sym): Use gfc_charlen_t and gfc_charlen_int_kind.
5286         (gfc_match_implicit): Use gfc_charlen_int_kind.
5287         * dump-parse-tree.c (show_char_const): Use gfc_charlen_t and size_t.
5288         (show_expr): Use HOST_WIDE_INT_PRINT_DEC.
5289         * expr.c (gfc_get_character_expr): Length parameter of type
5290         gfc_charlen_t.
5291         (gfc_get_int_expr): Value argument of type HOST_WIDE_INT.
5292         (gfc_extract_hwi): New function.
5293         (simplify_const_ref): Make string_len of type gfc_charlen_t.
5294         (gfc_simplify_expr): Use HOST_WIDE_INT for substring refs.
5295         * frontend-passes.c (optimize_trim): Use gfc_charlen_int_kind.
5296         * gfortran.h (gfc_mpz_get_hwi): New prototype.
5297         (gfc_mpz_set_hwi): Likewise.
5298         (gfc_charlen_t): New typedef.
5299         (gfc_expr): Use gfc_charlen_t for character lengths.
5300         (gfc_size_kind): New extern variable.
5301         (gfc_extract_hwi): New prototype.
5302         (gfc_get_character_expr): Use gfc_charlen_t for character length.
5303         (gfc_get_int_expr): Use HOST_WIDE_INT type for value argument.
5304         * gfortran.texi: Update description of hidden string length argument.
5305         * iresolve.c (check_charlen_present): Use gfc_charlen_int_kind.
5306         (gfc_resolve_char_achar): Likewise.
5307         (gfc_resolve_repeat): Pass string length directly without
5308         temporary, use gfc_charlen_int_kind.
5309         (gfc_resolve_transfer): Use gfc_charlen_int_kind.
5310         * match.c (select_intrinsic_set_tmp): Use HOST_WIDE_INT for charlen.
5311         * misc.c (gfc_mpz_get_hwi): New function.
5312         (gfc_mpz_set_hwi): New function.
5313         * module.c (atom_int): Change type from int to HOST_WIDE_INT.
5314         (parse_integer): Don't complain about large integers.
5315         (write_atom): Use HOST_WIDE_INT for integers.
5316         (mio_integer): Handle integer type mismatch.
5317         (mio_hwi): New function.
5318         (mio_intrinsic_op): Use HOST_WIDE_INT.
5319         (mio_array_ref): Likewise.
5320         (mio_expr): Likewise.
5321         * primary.c (match_substring): Use gfc_charlen_int_kind.
5322         * resolve.c (resolve_substring_charlen): Use gfc_charlen_int_kind.
5323         (resolve_character_operator): Likewise.
5324         (resolve_assoc_var): Likewise.
5325         (resolve_select_type): Use HOST_WIDE_INT for charlen, use snprintf.
5326         (resolve_charlen): Use mpz_sgn to determine sign.
5327         * simplify.c (gfc_simplify_repeat): Use HOST_WIDE_INT/gfc_charlen_t
5328         instead of long.
5329         * symbol.c (generate_isocbinding_symbol): Use gfc_charlen_int_kind.
5330         * target-memory.c (size_character): Length argument of type
5331         gfc_charlen_t.
5332         (gfc_encode_character): Likewise.
5333         (gfc_interpret_character): Use gfc_charlen_t.
5334         * target-memory.h (gfc_encode_character): Modify prototype.
5335         * trans-array.c (gfc_trans_array_ctor_element): Use existing type.
5336         (get_array_ctor_var_strlen): Use gfc_conv_mpz_to_tree_type.
5337         (trans_array_constructor): Use existing type.
5338         (get_array_charlen): Likewise.
5339         * trans-const.c (gfc_conv_mpz_to_tree_type): New function.
5340         * trans-const.h (gfc_conv_mpz_to_tree_type): New prototype.
5341         * trans-decl.c (gfc_trans_deferred_vars): Use existing type.
5342         (add_argument_checking): Likewise.
5343         * trans-expr.c (gfc_class_len_or_zero_get): Build const of type
5344         gfc_charlen_type_node.
5345         (gfc_conv_intrinsic_to_class): Use gfc_charlen_int_kind instead of
5346         4, fold_convert to correct type.
5347         (gfc_conv_class_to_class): Build const of type size_type_node for
5348         size.
5349         (gfc_copy_class_to_class): Likewise.
5350         (gfc_conv_string_length): Use same type in expression.
5351         (gfc_conv_substring): Likewise, use HOST_WIDE_INT for charlen.
5352         (gfc_conv_string_tmp): Make sure len is of the right type.
5353         (gfc_conv_concat_op): Use same type in expression.
5354         (gfc_conv_procedure_call): Likewise.
5355         (fill_with_spaces): Comment out memset() block due to spurious
5356         -Wstringop-overflow warnings.
5357         (gfc_trans_string_copy): Use gfc_charlen_type_node.
5358         (alloc_scalar_allocatable_for_subcomponent_assignment):
5359         fold_convert to right type.
5360         (gfc_trans_subcomponent_assign): Likewise.
5361         (trans_class_vptr_len_assignment): Build const of correct type.
5362         (gfc_trans_pointer_assignment): Likewise.
5363         (alloc_scalar_allocatable_for_assignment): fold_convert to right
5364         type in expr.
5365         (trans_class_assignment): Build const of correct type.
5366         * trans-intrinsic.c (gfc_conv_associated): Likewise.
5367         (gfc_conv_intrinsic_repeat): Do calculation in sizetype.
5368         * trans-io.c (gfc_build_io_library_fndecls): Use
5369         gfc_charlen_type_node for character lengths.
5370         (set_string): Convert to right type in assignment.
5371         * trans-stmt.c (gfc_trans_label_assign): Build const of
5372         gfc_charlen_type_node.
5373         (trans_associate_var): Likewise.
5374         (gfc_trans_character_select): Likewise.
5375         (gfc_trans_allocate): Likewise, don't typecast strlen result.
5376         (gfc_trans_deallocate): Don't typecast strlen result.
5377         * trans-types.c (gfc_size_kind): New variable.
5378         (gfc_init_types): Determine gfc_charlen_int_kind and gfc_size_kind
5379         from size_type_node.
5380         * trans-types.h: Fix comment.
5382 2018-01-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
5384         PR fortran/83683
5385         PR fortran/45689
5386         * check.c (gfc_check_eoshift): Check for string length and
5387         for conformance of boundary.
5388         * intrinsic.c (add_functions): Add gfc_simplify_eoshift.
5389         * intrinsic.h: Add prototype for gfc_simplify_eoshift.
5390         * simplify.c (gfc_simplify_eoshift): New function.
5392 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5393             Alan Hayward  <alan.hayward@arm.com>
5394             David Sherwood  <david.sherwood@arm.com>
5396         * trans-types.c (gfc_type_for_mode): Handle MODE_VECTOR_BOOL.
5398 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
5399             Alan Hayward  <alan.hayward@arm.com>
5400             David Sherwood  <david.sherwood@arm.com>
5402         * trans-types.c (gfc_type_for_mode): Check valid_vector_subparts_p.
5404 2018-01-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
5406         PR fortran/83664
5407         * check.c (gfc_check_eoshift): Error for missing boundary if array
5408         is not one of the standard types.
5410 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
5412         Update copyright years.
5414         * gfortranspec.c (lang_specific_driver): Update copyright notice
5415         dates.
5416         * gfc-internals.texi: Bump @copying's copyright year.
5417         * gfortran.texi: Ditto.
5418         * intrinsic.texi: Ditto.
5419         * invoke.texi: Ditto.
5421 2017-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
5423         PR fortran/45689
5424         * intrinsic.c (add_function): Add gfc_simplify_maxloc and
5425         gfc_simplify_minloc to maxloc and minloc, respectively.
5426         * intrinsic.h: Add prototypes for gfc_simplify_minloc
5427         and gfc_simplify_maxloc.
5428         * simplify.c (min_max_chose): Adjust prototype.  Modify function
5429         to have a return value which indicates if the extremum was found.
5430         (is_constant_array_expr): Fix typo in comment.
5431         (simplify_minmaxloc_to_scalar): New function.
5432         (simplify_minmaxloc_nodim): New function.
5433         (new_array): New function.
5434         (simplify_minmaxloc_to_array): New function.
5435         (gfc_simplify_minmaxloc): New function.
5436         (simplify_minloc): New function.
5437         (simplify_maxloc): New function.
5439 2018-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
5441         PR fortran/45689
5442         PR fortran/83650
5443         * simplify.c (gfc_simplify_cshift): Re-implement to allow full
5444         range of arguments.
5446 2018-01-01  Paul Thomas  <pault@gcc.gnu.org>
5448         PR fortran/83076
5449         * resolve.c (resolve_fl_derived0): Add caf_token fields for
5450         allocatable and pointer scalars, when -fcoarray selected.
5451         * trans-types.c (gfc_copy_dt_decls_ifequal): Copy the token
5452         field as well as the backend_decl.
5453         (gfc_get_derived_type): Flag GFC_FCOARRAY_LIB for module
5454         derived types that are not vtypes. Components with caf_token
5455         attribute are pvoid types. For a component requiring it, find
5456         the caf_token field and have the component token field point to
5457         its backend_decl.
5459         PR fortran/83319
5460         *trans-types.c (gfc_get_array_descriptor_base): Add the token
5461         field to the descriptor even when codimen not set.
5463 Copyright (C) 2018 Free Software Foundation, Inc.
5465 Copying and distribution of this file, with or without modification,
5466 are permitted in any medium without royalty provided the copyright
5467 notice and this notice are preserved.