1 2018-07-18 Janus Weil <janus@gcc.gnu.org>
2 Thomas Koenig <tkoenig@gcc.gnu.org>
5 * dump-parse-tree.c (show_attr): Add handling of implicit_pure.
6 * frontend-passes.c (do_warn_function_elimination): Do not warn for
8 * gfortran.h: Add prototypes for gfc_pure_function and
9 gfc_implicit_pure_function.
10 * gfortran.texi: Add chapter on evaluation of logical expressions.
11 * invoke.texi: Mention that -Wfunction-elimination is implied
13 * lang.opt: Make -Wextra imply -Wfunction-elimination.
14 * resolve.c (pure_function): Rename to gfc_pure_function.
15 (gfc_implicit_pure_function): New function.
16 (check_pure_function): Use it here.
17 (impure_function_callback): New function.
18 (resolve_operator): Call it via gfc_expr_walker.
20 2018-07-16 Fritz Reese <fritzoreese@gmail.com>
23 * decl.c (match_old_style_init): Initialize locus of variable expr when
24 creating a data variable.
25 (match_clist_expr): Verify array is explicit shape/size before
26 attempting to allocate constant array constructor.
28 2018-07-16 Fritz Reese <fritzoreese@gmail.com>
31 * module.c (mio_component): Set component->loc when loading from module.
33 2018-07-10 Jakub Jelinek <jakub@redhat.com>
36 * module.c (omp_declare_simd_clauses): Add LINEAR with _REF, _VAL and
38 (mio_omp_declare_simd): Save and restore ref, val and uval modifiers
39 on linear clauses. Initialize n->where to gfc_current_locus.
41 2018-07-05 Paul Thomas <pault@gcc.gnu.org>
44 * resolve.c.c (resolve_contained_fntype): Reference to C418 is
45 in F2008 and not F2003.
46 (resolve_function): Ditto in error message. Also, exclude
47 deferred character length results from the error.
49 2018-07-05 Fritz Reese <fritzoreese@gmail.com>
53 * expr.c (class_allocatable, class_pointer, comp_allocatable,
54 comp_pointer): New helpers.
55 (component_initializer): Generate EXPR_NULL for allocatable or pointer
56 components. Do not generate initializers for components within BT_CLASS.
57 Do not assign to comp->initializer.
58 (gfc_generate_initializer): Use new helpers; move code to generate
59 EXPR_NULL for class allocatable components into component_initializer().
61 2018-07-04 Jerry DeLisle <jvdelisle@gcc.gnu.org>
64 * trans-decl.c (gfc_process_block_locals): Delete assert and set
65 saved_local_decls = NULL_TREE.
67 2018-07-02 Richard Biener <rguenther@suse.de>
70 * trans-types.c (gfc_get_array_type_bounds): Unshare TYPE_FIELDs
71 for the distinct type copy.
73 2018-07-02 Paul Thomas <pault@gcc.gnu.org>
77 * trans-array.c (structure_alloc_comps): Do not explicitly copy
78 procedure pointer components.
80 2018-07-02 Paul Thomas <pault@gcc.gnu.org>
83 * expr.c : Add a prototype for scalarize_intrinsic_call.
84 (gfc_simplify_expr): Use scalarize_intrinsic_call for elemental
85 intrinsic function calls.
86 (scalarize_intrinsic_call): Add 'init_flag' argument. Check if
87 the expression or any of the actual argument expressions are
88 NULL. Before calling gfc_check_init_expr, check 'init_flag'.
89 Only simplify the scalarized expressions if there are no errors
91 (gfc_check_init_expr): Set 'init_flag' true in the call to
92 scalarize_intrinsic_call.
94 2018-06-28 Fritz Reese <fritzoreese@gmail.com>
97 * decl.c (gfc_match_type): Refactor and check for PDT declarations.
99 2018-06-28 Martin Liska <mliska@suse.cz>
101 * gfortranspec.c: Include opt-suggestions.h.
103 2018-06-25 Fritz Reese <fritzoreese@gmail.com>
108 * expr.c (component_initializer): Assign init expr to c->initializer.
109 (generate_isocbinding_initializer): New.
110 (gfc_generate_initializer): Call generate_isocbinding_initializer to
111 generate initializers for c_ptr and c_funptr with -finit-derived.
113 2018-06-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
116 * interface.c (check_dtio_interface1): Delete assert.
118 2018-06-22 Paul Thomas <pault@gcc.gnu.org>
119 Rainer Orth <ro@gcc.gnu.org>
122 * resolve.c (resolve_contained_fntype): Check for the charlen
123 before testing the length.
125 2018-06-21 Paul Thomas <pault@gcc.gnu.org>
128 * resolve.c (resolve_contained_fntype): Change standard ref.
129 from F95 to F2003: C418. Correct a spelling error in a comment.
130 It is an error for an abstract interface to have an assumed
131 character length result.
132 * trans-expr.c (gfc_conv_procedure_call): Likewise change the
135 2018-06-21 Paul Thomas <pault@gcc.gnu.org>
138 * resolve.c (resolve_ordinary_assign): Force the creation of a
139 vtable for assignment of non-polymorphic expressions to an
140 unlimited polymorphic object.
141 * trans-array.c (gfc_alloc_allocatable_for_assignment): Use the
142 size of the rhs type for such assignments. Set the dtype, _len
143 and vptrs appropriately.
144 * trans-expr.c (gfc_trans_assignment): Force the use of the
145 _copy function for these assignments.
147 2018-06-20 Chung-Lin Tang <cltang@codesourcery.com>
148 Thomas Schwinge <thomas@codesourcery.com>
149 Cesar Philippidis <cesar@codesourcery.com>
151 * gfortran.h (gfc_omp_clauses): Add unsigned if_present, finalize
153 * openmp.c (enum omp_mask2): Remove OMP_CLAUSE_PRESENT_OR_*. Add
154 OMP_CLAUSE_{IF_PRESENT,FINALIZE}.
155 (gfc_match_omp_clauses): Update handling of copy, copyin, copyout,
156 create, deviceptr, present_of_*. Add support for finalize and
158 (OACC_PARALLEL_CLAUSES): Remove PRESENT_OR_* clauses.
159 (OACC_KERNELS_CLAUSES): Likewise.
160 (OACC_DATA_CLAUSES): Likewise.
161 (OACC_DECLARE_CLAUSES): Likewise.
162 (OACC_UPDATE_CLAUSES): Add IF_PRESENT clause.
163 (OACC_ENTER_DATA_CLAUSES): Remove PRESENT_OR_* clauses.
164 (OACC_EXIT_DATA_CLAUSES): Add FINALIZE clause.
165 (gfc_match_oacc_declare): Update to OpenACC 2.5 semantics.
166 * trans-openmp.c (gfc_trans_omp_clauses): Add support for IF_PRESENT
169 2018-06-18 Eric Botcazou <ebotcazou@adacore.com>
171 * trans-decl.c (gfc_get_fake_result_decl): Revert latest change.
173 2018-06-17 Eric Botcazou <ebotcazou@adacore.com>
175 * trans-decl.c (nonlocal_dummy_decl_pset): Delete.
176 (nonlocal_dummy_decls): Likewise.
177 (gfc_nonlocal_dummy_array_decl): Likewise.
178 (gfc_get_symbol_decl): Do not call gfc_nonlocal_dummy_array_decl.
179 (gfc_get_fake_result_decl): Do not generate a new DECL if simply
180 reusing the result of a recursive call.
181 (gfc_generate_function_code): Do not create, insert and destroy
182 nonlocal_dummy_decls.
184 2018-06-13 Steven G. Kargl <kargl@gcc.gnu.org>
187 * array.c (gfc_resolve_character_array_constructor): Avoid NULL
190 2018-06-13 Cesar Philippidis <cesar@codesourcery.com>
193 * parse.c (decode_oacc_directive): Set gfc_matching_function
195 (decode_omp_directive): Likewise.
197 2018-06-13 Cesar Philippidis <cesar@codesourcery.com>
200 * openmp.c (gfc_match_oacc_wait): Use %C to report error location.
202 2018-06-12 David Malcolm <dmalcolm@redhat.com>
205 * misc.c (gfc_closest_fuzzy_match): Update for renaming of
206 levenshtein_distance to get_edit_distance.
208 2018-06-12 Steven G. Kargl <kargl@gcc.gnu.org>
211 * expr.c (gfc_check_assign): Select non-NULL locus.
213 2018-06-11 Janus Weil <janus@gcc.gnu.org>
216 * interface.c (compare_ptr_alloc): New function.
217 (generic_correspondence): Call it.
219 2018-06-10 Thomas Koenig <tkoenig@gcc.gnu.org>
221 * gfortran.h (gfc_expr): Add no_bounds_check field.
222 * frontend-passes.c (get_array_inq_function): Set no_bounds_check
223 on function and function argument.
224 (inline_matmul_assign): Set no_bounds_check on zero expression
225 and on lhs of zero expression.
226 Also handle A1B2 case if realloc on assigment is active.
227 * trans-array.c (gfc_conv_array_ref): Don't do range checking
228 if expr has no_bounds_check set.
229 (gfc_conv_expr_descriptor): Set no_bounds_check on ss if expr
231 * trans-expr.c (gfc_trans_assignment_1): Set no_bounds_check
232 on lss and lss if the corresponding expressions have it set.
234 2018-06-10 Dominique d'Humieres <dominiq@gcc.gnu.org>
237 * trans-const.c: Remove include "diagnostic-core.h".
238 (gfc_conv_constant_to_tree): Replace fatal_error with gcc_unreachable.
240 2018-06-10 Janus Weil <janus@gcc.gnu.org>
243 * decl.c (match_attr_spec): Synchronize the DECL_* enum values with the
244 INTENT_* values from the enum 'sym_intent'. Call 'match_intent_spec'
245 and remove a TODO note.
246 * gfortran.h: Add a comment to sym_intent.
248 2018-06-09 Steven G. Kargl <kargl@gcc.gnu.org>
251 * resolve.c (resolve_operator): Provide better error message for
252 derived type entity used in an binary intrinsic numeric operator.
254 2018-06-09 Steven G. Kargl <kargl@gcc.gnu.org>
259 * decl.c (gfc_match_char_spec): Use private namespace in attempt to
260 reduce a charlen to a constant.
262 2018-06-09 Steven G. Kargl <kargl@gcc.gnu.org>
265 * data.c (gfc_assign_data_value): Re-arrange code to allow for
266 an error for double initialization of CHARACTER entities.
268 2018-06-09 Steven G. Kargl <kargl@gcc.gnu.org>
271 * symbol.c (gfc_add_volatile): Enforce F2008:C1282 and F2018:C1588.
273 2018-06-08 Thomas Koenig <tkoenig@gcc.gnu.org>
276 * trans.h (gfc_ss): Add field no_bounds_check.
277 * trans-array.c (gfc_conv_ss_startstride): If flag_realloc_lhs and
278 ss->no_bounds_check is set, do not use runtime checks.
279 * trans-expr.c (gfc_trans_assignment_1): Set lss->no_bounds_check
280 for reallocatable lhs.
282 2018-06-08 Steven G. Kargl <kargl@gcc.gnu.org>
285 * array.c (match_array_cons_element): NULL() cannot be in an
288 2018-06-08 Steven G. Kargl <kargl@gcc.gnu.org>
291 * data.c (create_character_initializer): Return early if type is
292 incompatible with CHARACTER.
294 2018-06-07 Steven G. Kargl <kargl@gcc.gnu.org>
297 * simplify.c (gfc_simplify_mod): Re-arrange code to test whether
298 'P' is zero and issue an error if it is.
300 2018-06-06 Thomas Koenig <tkoenig@gcc.gnu.org>
303 * frontend-passes.c (is_fe_temp): Add prototype.
304 (realloc_string_callback): Early return for frontend-generated
307 2018-06-05 Cesar Philippidis <cesar@codesourcery.com>
311 * openmp.c (gfc_resolve_oacc_declare): Error on functions and
312 subroutine data clause arguments.
314 2018-06-04 Steven G. Kargl <kargl@gcc.gnu.org>
317 * resolve.c (resolve_allocate_deallocate): Check errmsg is default
320 2018-06-03 Paul Thomas <pault@gcc.gnu.org>
323 * decl.c (variable_decl): Use gfc_add_type for cray pointees.
325 2018-06-01 Steven G. Kargl <kargl@gcc.gnu.org>
328 * check.c (gfc_check_random_init): New function. Check arguments of
330 * gfortran.h (GFC_ISYM_RANDOM_INIT): New enum token.
331 * intrinsic.c (add_subroutines): Add RANDOM_INIT to list of
333 (gfc_check_intrinsic_standard): Introduce Fortran 2018 check.
334 * intrinsic.h: Add prototypes for gfc_check_random_init and
335 gfc_resolve_random_init
336 * intrinsic.texi: Document new intrinsic subprogram.
337 * iresolve.c (gfc_resolve_random_init): Resolve routine name.
338 * trans-decl.c: Declare gfor_fndecl_random_init
339 * trans-intrinsic.c (conv_intrinsic_random_init): New function.
340 Translate call to RANDOM_INIT.
341 (gfc_conv_intrinsic_subroutine): Call it.
342 * trans.h: Declare gfor_fndecl_random_init
344 2018-05-27 Steven G. Kargl <kargl@gcc.gnu.org>
346 * decl.c (match_data_constant): Fortran 2018 allows pointer
347 initialization in a data statement.
349 2018-05-25 Janus Weil <janus@gcc.gnu.org>
352 * match.c (gfc_match_block_data): Call gfc_notify_std to warn about
353 an obsolescent feature in Fortran 2018.
354 (gfc_match_equivalence): Ditto.
355 * resolve.c (resolve_common_blocks): Ditto.
356 (gfc_resolve_forall): Ditto.
357 * symbol.c (gfc_define_st_label): Ditto.
359 2018-05-24 Steven G. Kargl <kargl@gcc.gnu.org>
362 * resolve.c (update_current_proc_array_outer_dependency): Avoid NULL
365 2018-05-24 Steven G. Kargl <kargl@gcc.gnu.org>
368 * resolve.c (resolve_fl_procedure): Avoid NULL dereference.
370 2018-05-24 Steven G. Kargl <kargl@gcc.gnu.org>
373 * decl.c (gfc_match_derived_decl): Fix NULL point dereference.
375 2018-05-24 Steven G. Kargl <kargl@gcc.gnu.org>
378 * resolve.c (resolve_sync): Resolve expression before checking for
381 2018-05-22 Janus Weil <janus@gcc.gnu.org>
384 * libgfortran.h: Remove the macros GFC_STD_F2008_TS and
386 * error.c (notify_std_msg): Remove GFC_STD_F2008_TS.
387 * options.c (set_default_std_flags): Ditto.
388 (gfc_handle_option): Make -std=f2008ts an alias for -std=f2018.
389 * array.c (gfc_match_array_spec): Replace GFC_STD_F2008_TS by
391 * check.c (gfc_check_atomic, gfc_check_event_query,
392 gfc_check_c_f_pointer, gfc_check_c_f_procpointer, gfc_check_c_funloc,
393 gfc_check_c_loc, gfc_check_num_images, gfc_check_this_image): Ditto.
394 * decl.c (gfc_verify_c_interop_param, gfc_match_decl_type_spec): Ditto.
395 * intrinsic.c (add_functions, add_subroutines,
396 gfc_check_intrinsic_standard): Ditto.
397 * iso-c-binding.def: Ditto.
398 * iso-fortran-env.def: Ditto.
399 * match.c (gfc_match_event_post, gfc_match_event_wait,
400 gfc_match_fail_image, gfc_match_form_team, gfc_match_change_team,
401 gfc_match_end_team, gfc_match_sync_team): Ditto.
402 * gfortran.texi: Remove mention of -std=f2008ts.
403 Move TSs into F2018 section.
404 * invoke.texi: Update documentation of -std=f2008ts.
406 2018-05-21 Janus Weil <janus@gcc.gnu.org>
409 * libgfortran.h: New macros GFC_STD_OPT_*.
410 * error.c (notify_std_msg): New function.
411 (gfc_notify_std): Adjust such that it can handle combinations of
412 GFC_STD_* flags in the 'std' argument, not just a single one.
413 * match.c (match_arithmetic_if, gfc_match_if): Reject arithmetic if
415 (gfc_match_stopcode): Use GFC_STD_OPT_* macros.
416 * options.c (set_default_std_flags): Warn for F2018 deleted features
418 (gfc_handle_option): F2018 deleted features are allowed in earlier
420 * symbol.c (gfc_define_st_label, gfc_reference_st_label): Reject
421 nonblock do constructs in Fortran 2018.
423 2018-05-20 Paul Thomas <pault@gcc.gnu.org>
426 * resolve.c (flag_fn_result_spec): Use the 'sym' argument to
427 test for self refs to the function result in the character len
428 expression. If a self reference is found, emit an error and
430 (resolve_fntype): Use the function symbol in the calls to the
433 2018-05-20 Paul Thomas <pault@gcc.gnu.org>
436 * trans-array.c (gfc_get_array_span): Renamed from
438 (gfc_conv_expr_descriptor): Change references to above.
439 * trans-array.h : Add prototype for 'gfc_get_array_span'.
440 * trans-intrinsic.c (gfc_conv_associated): Add pre and post
442 * trans-stmt.c (trans_associate_var): If the associate name is
443 a subref array pointer, use gfc_get_array_span for the span.
445 2018-05-20 Paul Thomas <pault@gcc.gnu.org>
448 * match.c (gfc_match_type_spec): Go through the array ref and
449 decrement 'rank' for every dimension that is an element.
451 2018-05-19 Paul Thomas <pault@gcc.gnu.org>
456 * trans-array.c (gfc_alloc_allocatable_for_assignment): Set the
457 charlen backend_decl of the rhs expr to ss->info->string_length
458 so that the value in the current scope is used.
460 2018-05-13 Steven G. Kargl <kargl@gcc.gnu.org>
463 * gfortran.texi: Clarify documentation for Cray pointer and
466 2018-05-13 Paul Thomas <pault@gcc.gnu.org>
469 * trans-types.c (gfc_get_dtype_rank_type): Reorder evaluation
470 of 'size'. If the element type is a pointer use the size of the
471 TREE_TYPE of the type, unless it is VOID_TYPE. In this latter
472 case, set the size to zero.
474 2018-05-13 Steven G. Kargl <kargl@gcc.gnu.org>
476 * gfortran.h: Remove prototype.
477 * symbol.c (gfc_new_undo_checkpoint): Remove unused function.
479 2018-05-11 Steven G. Kargl <kargl@gcc.gnu.org>
482 * expr.c (check_inquiry): Avoid NULL pointer dereference.
484 2018-05-10 Steven G. Kargl <kargl@gcc.gnu.org>
487 * check.c (gfc_check_rank): Check that the argument is a data object.
489 2018-05-10 Steven G. Kargl <kargl@gcc.gnu.org>
492 * array.c (gfc_resolve_character_array_constructor): Substrings
493 with upper bound smaller than lower bound are zero length strings.
495 2018-05-10 Steven G. Kargl <kargl@gcc.gnu.org>
498 * data.c (gfc_assign_data_value): Check that a data object does
499 not also have default initialization.
501 2018-05-10 Marek Polacek <polacek@redhat.com>
504 * options.c (gfc_post_options): Set main_input_filename.
506 2018-05-10 Thomas Koenig <tkoenig@gcc.gnu.org>
509 * intrinsic.texi: Document BACK for MINLOC and MAXLOC.
511 2018-05-10 Paul Thomas <pault@gcc.gnu.org>
515 * resolve.c (get_temp_from_expr): The temporary must not have
516 dummy or intent attributes.
518 2018-05-08 Thomas Koenig <tkoenig@gcc.gnu.org>
521 * check.c (gfc_check_minmaxloc): Remove error for BACK not being
522 implemented. Use gfc_logical_4_kind for BACK.
523 * simplify.c (min_max_choose): Add optional argument back_val.
525 (simplify_minmaxloc_to_scalar): Add argument back_val. Pass
526 back_val to min_max_choose.
527 (simplify_minmaxloc_to_nodim): Likewise.
528 (simplify_minmaxloc_to_array): Likewise.
529 (gfc_simplify_minmaxloc): Add argument back, handle it.
530 Pass back_val to specific simplification functions.
531 (gfc_simplify_minloc): Remove ATTRIBUTE_UNUSED from argument back,
532 pass it on to gfc_simplify_minmaxloc.
533 (gfc_simplify_maxloc): Likewise.
534 * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Adjust
535 comment. If BACK is true, use greater or equal (or lesser or
536 equal) insteal of greater (or lesser). Mark the condition of
537 having found a value which exceeds the limit as unlikely.
539 2018-05-07 Jeff Law <law@redhat.comg>
541 * scanner.c (preprocessor_line): Call linemap_add after a line
542 directive that changes the current filename.
544 2018-05-06 Andre Vehreschild <vehre@gcc.gnu.org>
547 * dependency.c (gfc_dep_resolver): Revert looking at coarray dimension
548 introduced by r259385.
549 * trans-intrinsic.c (conv_caf_send): Always report a dependency for
550 same variables in coarray assignments.
552 2018-05-02 Tom de Vries <tom@codesourcery.com>
555 * f95-lang.c (DEF_GOACC_BUILTIN_ONLY): Define.
557 2018-04-24 Steven G. Kargl <kargl@gcc.gnu.org>
560 * decl.c (gfc_match_char_spec): Check for negative length and set to 0.
562 2018-04-14 Andre Vehreschild <vehre@gcc.gnu.org>
566 * dependency.c (gfc_dep_resolver): Coarray indexes are to be ignored
567 during dependency computation. They define no data dependency.
568 * trans-array.c (conv_array_index_offset): The stride can not be set
570 * trans-intrinsic.c (conv_caf_send): Add creation of temporary array
571 for caf_get's result and copying to the array with vectorial
574 2018-04-14 Thomas Koenig <tkoenig@gcc.gnu.org>
577 * frontend-passes.c (traverse_io_block): Check for start, end or
578 stride being defined by an outer implied DO loop.
580 2018-04-12 Thomas Koenig <tkoenig@gcc.gnu.org>
584 * trans-stmt.c (gfc_trans_forall_loop): Use annot_expr_ivdep_kind
585 for annotation and remove dependence on -ftree-parallelize-loops.
587 2018-04-10 Jakub Jelinek <jakub@redhat.com>
590 * openmp.c (resolve_omp_do): Remove bogus if (j < i) break;.
591 (resolve_oacc_nested_loops): Likewise. Formatting fix.
593 2018-04-09 Thomas Koenig <tkoenig@gcc.gnu.org>
596 * trans-stmt.c (gfc_trans_forall_loop): Remove annotation for
597 parallell processing of DO CONCURRENT -ftree-parallelize-loops
600 2018-04-09 Thomas Koenig <tkoenig@gcc.gnu.org>
603 * resolve.c (resolve_variable): Simplify cases where access to a
604 parameter array results in a single constant.
606 2018-04-02 Thomas Koenig <tkoenig@gcc.gnu.org>
609 * decl.c (variable_decl): If upper or lower bounds simplify
610 to a constant, use that.
612 2018-03-30 Paul Thomas <pault@gcc.gnu.org>
615 * simplify.c (gfc_convert_constant): Handle case of array
616 constructors within an array that has no iterator and improve
617 the conciseness of this section of code.
619 2017-03-30 Thomas Koenig <tkoenig@gcc.gnu.org>
622 * array.c (gfc_resolve_character_array_constructor): Early
623 exit for zero-size arrays.
624 * simplify.c (simplify_transformation_to_array): Exit early
625 if the result size is zero.
626 (simplify_minmaxloc_to_array): Likewise.
628 2018-03-28 Mikael Morin <mikael@gcc.gnu.org>
631 * symbol.c (gfc_symbol_done_2): Start freeing namespaces
633 (gfc_free_namespace): Restore assert (revert r258839).
635 2018-03-28 Jakub Jelinek <jakub@redhat.com>
637 * gfortran.h (gfc_dt): Rename default_exp field to dec_ext.
638 * ioparm.def (IOPARM_dt_default_exp): Rename to ...
639 (IOPARM_dt_dec_ext): ... this.
640 * trans-io.c (build_dt): Adjust for default_exp renaming to
641 dec_ext and IOPARM_dt_default_exp renaming to IOPARM_dt_dec_ext.
642 * io.c (match_io): Likewise.
644 2018-03-27 Thomas Koenig <tkoenig@gcc.gnu.org>
647 * frontend-passes.c (gfc_run_passes): Do not run front-end
648 optimizations if a previous error occurred.
650 2018-03-27 Thomas Koenig <tkoenig@gcc.gnu.org>
651 Harald Anlauf <anlauf@gmx.de>
654 * primary.c (gfc_convert_to_structure_constructor): Check
655 conformance of argument types in structure constructor.
657 2018-03-26 Thomas Koenig <tkoenig@gcc.gnu.org>
660 * io.c: Include constructor.h.
661 (resolve_tag_format): For a constant character array, concatenate
662 into a single character expression.
664 2018-03-25 Seth Johnson <johnsonsr@ornl.gov>
665 Dominique d'Humieres <dominiq@gcc.gnu.org>
668 * check.c (gfc_check_c_f_pointer): Allow scalar noninteroperable
669 scalar derived type with -std=f2003 and -std=f2008.
671 2018-03-24 Jerry DeLisle <jvdelisle@gcc.gnu.org>
672 Dominique d'Humieres <dominiq@gcc.gnu.org>
675 * symbol.c (gfc_free_namespace): Delete the assert and only if
676 refs count is equals zero, free the namespace. Otherwise,
677 something is halfway and other errors will resound.
679 2018-03-24 Thomas Koenig <tkoenig@gcc.gnu.org>
682 * expr.c (find_substring_ref): Change types of start, end
683 and length variables to gfc_charlen_t. Set length to zero
686 2018-03-24 Steven G. Kargl <kargl@gcc.gnu.org>
689 * decl.c (check_function_name): Improved error message
690 (gfc_match_volatile, gfc_match_asynchronous) Use check_function_name.
692 2018-03-22 Steven G. Kargl <kargl@gcc.gnu.org>
695 * decl.c (get_proc_name): If the MODULE prefix appears in interface
696 body, then it must appear on the contained subroutine or function.
697 While here, fix nearby mis-indented code.
699 2018-03-21 Thomas Koenig <tkoenig@gcc.gnu.org>
700 Harald Anlauf <anlauf@gmx.de>
703 * trans-types.c (gfc_sym_type): Do not dereference NULL pointer.
705 2018-03-21 Janne Blomqvist <jb@gcc.gnu.org>
708 * trans-expr.c (gfc_conv_procedure_call): Convert charlen to
709 gfc_charlen_type_node when calling procedure.
711 2018-03-20 Steven G. Kargl <kargl@gcc.gnu.org>
714 * interface.c (symbol_rank): Remove bogus null pointer check that
715 crept in when translating a ternary operator into an if-else
718 2018-03-19 Thomas Koenig <tkoenig@gcc.gnu.org>
721 * simplify.c (gfc_convert_constant): Correctly handle iterators
724 2018-03-18 Steven G. Kargl <kargl@gcc.gnu.org>
727 * decl.c (get_proc_name): Check for a subroutine re-defined in
728 the contain portion of a subroutine. Change language of existing
729 error message to better describe the issue. While here fix whitespace
732 2018-03-18 Steven G. Kargl <kargl@gcc.gnu.org>
735 * decl.c (get_proc_name): Catch clash between a procedure statement
736 and a contained subprogram
738 2018-03-16 Steven G. Kargl <kargl@gcc.gnu.org>
741 * decl.c (merge_array_spec): Correct the error condition.
743 2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
746 * decl.c (get_proc_name): Check for clash of entry name with
749 2018-03-15 Steven G. Kargl <kargl@gcc.gnu.org>
752 * decl.c (merge_array_spec): Limit the merging to maximum allowed
753 dimensions, and issue error message if limit is exceeded.
755 2018-03-13 Steven G. Kargl <kargl@gcc.gnu.org>
757 * check.c (gfc_check_kill_sub): Remove check for INTEGER(4) or (8).
758 * intrinsic.c (add_functions): Remove reference to gfc_resolve_kill.
759 (add_subroutines): Remove reference to gfc_resolve_kill_sub.
760 * intrinsic.texi: Update documentation.
761 * iresolve.c (gfc_resolve_kill, gfc_resolve_kill_sub): Remove.
762 * trans-decl.c (gfc_build_intrinsic_function_decls): Add
763 gfor_fndecl_kill and gfor_fndecl_kill_sub
764 * trans-intrinsic.c (conv_intrinsic_kill, conv_intrinsic_kill_sub): new
766 (gfc_conv_intrinsic_function): Use conv_intrinsic_kill.
767 (gfc_conv_intrinsic_subroutine): Use conv_intrinsic_kill_sub.
768 * trans.h: Declare gfor_fndecl_kill and gfor_fndecl_kill_sub.
770 2018-03-11 Paul Thomas <pault@gcc.gnu.org>
773 * trans-array.c (structure_alloc_comps): Make sure that the
774 vptr is copied and that the unlimited polymorphic _len is used
775 to compute the size to be allocated.
776 * trans-expr.c (gfc_get_class_array_ref): If unlimited, use the
777 unlimited polymorphic _len for the offset to the element.
778 (gfc_copy_class_to_class): Set the new 'unlimited' argument.
779 * trans.h : Add the boolean 'unlimited' to the prototype.
781 2018-03-11 Steven G. Kargl <kargl@gcc.gnu.org>
784 * resolve.c (resolve_fl_procedure): Enforce F2018:C15100.
786 2018-03-11 Steven G. Kargl <kargls@gcc.gnu.org>
788 * check.c (gfc_check_kill): Check pid and sig are scalar.
789 (gfc_check_kill_sub): Restrict kind to 4 and 8.
790 * intrinsic.c (add_function): Sort keyword list. Add pid and sig
791 keywords for KILL. Remove redundant *back="back" in favor of the
792 original *bck="back".
793 (add_subroutines): Sort keyword list. Add pid and sig keywords
795 * intrinsic.texi: Fix documentation to consistently use pid and sig.
796 * iresolve.c (gfc_resolve_kill): Kind can only be 4 or 8. Choose the
798 (gfc_resolve_rename_sub): Add comment.
800 2018-03-11 Thomas Koenig <tkoenig@gcc.gnu.org>
803 * simplify.c (simplify_transformation): Return default result for
804 empty array argument.
805 (gfc_simplify_all): Remove special-case handling for zerosize.
806 (gfc_simplify_any): Likewise.
807 (gfc_simplify_count): Likewise.
808 (gfc_simplify_iall): Likewise.
809 (gfc_simplify_iany): Likewise.
810 (gfc_simplify_iparity): Likewise.
811 (gfc_simplify_minval): Likewise.
812 (gfc_simplify_maxval): Likewise.
813 (gfc_simplify_norm2): Likewise.
814 (gfc_simplify_product): Likewise.
815 (gfc_simplify_sum): Likewise.
817 2018-03-10 Steven G. Kargl <kargl@gcc.gnu.org>
820 * arith.c (check_result, eval_intrinsic): If result overflows, pass
821 the expression up the chain instead of a NULL pointer.
823 2018-03-07 Steven G. Kargl <kargl@gcc.gnu.org>
827 * decl.c (gfc_match_char_spec): Try to reduce a charlen to a constant.
829 2017-03-06 Thomas Koenig <tkoenig@gcc.gnu.org>
833 * expr.c (simplify_parameter_variable): If p is a size zero array
834 and not an ARRAY_EXPR insert an empty array constructor and
836 * gfortran.h: Add prototype for gfc_is_size_zero_array.
837 * simplify.c (is_size_zero_array): Make non-static and rename into
838 (gfc_is_size_zero_array): Check for parameter arrays of zero
839 size by comparing shape and absence of constructor.
840 (gfc_simplify_all): Use gfc_is_size_zero_array instead of
842 (gfc_simplify_count): Likewise.
843 (gfc_simplify_iall): Likewise.
844 (gfc_simplify_iany): Likewise.
845 (gfc_simplify_iparity): Likewise.
846 (gfc_simplify_minval): Likewise.
847 (gfc_simplify_maxval): Likewise.
848 (gfc_simplify_product): Likewise.
849 (gfc_simplify_sum): Likewise.
851 2018-03-06 Steven G. Kargl <kargl@gcc.gnu.org>
854 * primary.c (match_sym_complex_part): Give the matcher for an implied
855 do-loop a chance to run.
857 2018-03-03 Harald Anlauf <anlauf@gmx.de>
860 * trans-expr.c (gfc_apply_interface_mapping_to_expr): Do not
861 dereference NULL pointer.
863 2018-03-03 Steven G. Kargl <kargl@gcc.gnu.org>
866 * simplify.c (is_size_zero_array): New function to check for size
868 (gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
869 gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
870 gfc_simplify_minval, gfc_simplify_maxval, gfc_simplify_norm2,
871 gfc_simplify_product, gfc_simplify_sum): Use it, and implement
872 requirements from F2018.
874 2018-03-03 Steven G. Kargl <kargl@gcc.gnu.org>
877 * simplify.c (gfc_simplify_transfer): Resolve mold.
879 2018-03-03 Paul Thomas <pault@gcc.gnu.org>
882 * resolve.c (build_loc_call): Change symtree name from 'loc' to
885 2018-03-01 Paul Thomas <pault@gcc.gnu.org>
888 * target-memory.c (gfc_interpret_derived): Assert that BT_VOID
889 components are caf tokens.
890 (gfc_target_interpret_expr): Treat BT_VOID expressions as
893 2018-03-01 Paul Thomas <pault@gcc.gnu.org>
896 * class.c (class_array_ref_detected): Remove the condition that
897 there be no reference after the array reference.
898 (find_intrinsic_vtab): Remove excess whitespace.
899 * trans-array.c (gfc_conv_scalarized_array_ref): Rename 'tmp'
900 as 'base and call build_class_array_ref earlier.
902 2018-02-28 Paul Thomas <pault@gcc.gnu.org>
905 * trans-stmt.c (trans_associate_var): Make sure that the se
906 expression is a pointer type before converting it to the symbol
909 2018-02-25 Steven G. Kargl <kargl@gcc.gnu.org>
912 * decl.c (variable_decl): Check that an explicit-shape-array with
913 nonconstant bounds is allowed.
915 2018-02-25 Paul Thomas <pault@gcc.gnu.org>
918 * trans-intrinsic.c (gfc_conv_allocated): If the argument se
919 has a pre block, add it to the expression pre block.
921 2018-02-25 Thomas Koenig <tkoenig@gcc.gnu.org>
924 * gfortran.h (gfc_integer_4_kind): Define.
925 * resolve.c (resolve_select_type): Make sure that the
926 kind of c->high is gfc_integer_4_kind.
928 2018-02-24 Steven G. Kargl <kargl@gcc.gnu.org>
931 * decl.c (gfc_match_data): Check for invalid substring in
934 2018-02-23 Steven G. Kargl <kargl@gcc.gnu.org>
936 * intrinsic.texi: Arguments to MATMUL cannot both be rank one.
938 2018-02-23 Steven G. Kargl <kargl@gcc.gnu.org>
941 * trans-io.c (transfer_expr): Deal with C_LOC in transfer statement.
943 2018-02-23 Steven G. Kargl <kargl@gcc.gnu.org>
946 * interface.c (compare_actual_formal): Issue error if keyword is
947 used in a statement function.
949 2018-02-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
952 * trans-io.c (set_parameter_value_inquire): Adjust range check of
953 negative unit values for kind=8 units to the kind=4 negative limit.
955 2018-02-23 Paul Thomas <pault@gcc.gnu.org>
958 * trans-types.c (gfc_sym_type): Test sym->ns->proc_name before
959 accessing its components.
961 2018-02-23 Paul Thomas <pault@gcc.gnu.org>
964 * trans-decl.c (gfc_finish_var_decl): Test sym->ns->proc_name
965 before accessing its components.
967 2018-02-23 Paul Thomas <pault@gcc.gnu.org>
970 * trans-const.c : Clean up some whitespace issues.
971 * trans-expr.c (gfc_conv_initializer): If an iso_c_binding
972 derived type has a kind value of zero, set it to the default
975 2018-02-23 Janne Blomqvist <jb@gcc.gnu.org>
978 * trans-decl.c (gfc_build_builtin_function_decls): Add bool
979 argument to stop and error stop decls.
980 * trans-stmt.c (gfc_trans_stop): Add false value to argument
983 2018-02-22 Janne Blomqvist <jb@gcc.gnu.org>
987 * trans-decl.c (gfc_build_builtin_function_decls): Pass
988 gfc_int8_type node to pause_numeric, size_type_node to
990 * trans-stmt.c (gfc_trans_pause): Likewise.
992 2018-02-22 Janne Blomqvist <jb@gcc.gnu.org>
994 * gfortran.texi: Update Coarray API description.
995 * trans-decl.c (gfc_build_builtin_function_decls): Use size_t for
996 character lengths, int for exit codes.
997 (generate_coarray_sym_init): Use size_t for character length.
998 * trans-intrinsic.c (conv_co_collective): Likewise.
999 * trans-stmt.c (gfc_trans_lock_unlock): Likewise.
1000 (gfc_trans_event_post_wait): Likewise.
1001 (gfc_trans_sync): Likewise.
1002 (gfc_trans_stop): Use size_t for character lengths, int for exit
1005 2018-02-20 Thomas Koenig <tkoenig@gcc.gnu.org>
1009 * primary.c (gfc_convert_to_structure_constructor):
1010 For a constant string constructor, make sure the length
1013 2018-02-19 Paul Thomas <pault@gcc.gnu.org>
1017 * resolve.c (resolve_assoc_var): Rearrange the logic for the
1018 determination of the character length of associate names. If
1019 the associate name is missing a length expression or the length
1020 expression is not a constant and the target is not a variable,
1021 make the associate name allocatable and deferred length.
1022 * trans-decl.c (gfc_get_symbol_decl): Null the character length
1023 backend_decl for deferred length associate names that are not
1024 variables. Set 'length' to gfc_index_zero_node for character
1025 associate names, whose character length is a PARM_DECL.
1027 2018-02-19 Thomas Koenig <tkoenig@gcc.gnu.org>
1030 * frontend-passes.c (traverse_io_block): Remove workaround for
1033 2018-02-19 Andre Vehreschild <vehre@gcc.gnu.org>
1035 * gfortran.texi: Document additional src/dst_type. Fix some typos.
1036 * trans-decl.c (gfc_build_builtin_function_decls): Declare the new
1037 argument of _caf_*_by_ref () with * e { get, send, sendget }.
1038 * trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Add the type of the
1039 data referenced when generating a call to caf_get_by_ref ().
1040 (conv_caf_send): Same but for caf_send_by_ref () and
1041 caf_sendget_by_ref ().
1043 2018-02-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1046 * io.c (check_format): Allow FMT_COLON.
1048 2018-02-18 Paul Thomas <pault@gcc.gnu.org>
1051 * trans-array.c (gfc_conv_expr_descriptor): Set parmtype from
1052 the typenode in the case of deferred length characters.
1054 2018-02-17 Thomas Koenig <tkoenig@gcc.gnu.org>
1057 * frontend-passes (scalarized_expr): If the expression
1058 is an assumed size array, leave in the last reference
1059 and pass AR_SECTION instead of AR_FULL to gfc_resolve
1060 in order to avoid an error.
1062 2018-02-17 Paul Thomas <pault@gcc.gnu.org>
1065 * resolve.c (resolve_assoc_var): If a non-constant target expr.
1066 has no string length expression, make the associate variable
1067 into a deferred length, allocatable symbol.
1068 * trans-decl.c (gfc_is_reallocatable_lhs): Add and use a ptr to
1070 * trans-stmt.c (trans_associate_var): Null and free scalar
1071 associate names that are allocatable. After assignment, remove
1072 the allocatable attribute to prevent reallocation.
1074 2018-02-16 Jakub Jelinek <jakub@redhat.com>
1077 * trans-openmp.c (gfc_trans_omp_clauses): For OMP_CLAUSE_LINEAR_REF
1078 kind set OMP_CLAUSE_LINEAR_STEP to TYPE_SIZE_UNIT times last_step.
1080 2018-02-16 Dominique d'Humieres <dominiq@gcc.gnu.org>
1083 * decl.c (gfc_get_pdt_instance): Replace '%qs' with %qs.
1085 2018-02-15 Janus Weil <janus@gcc.gnu.org>
1088 * interface.c (check_dtio_arg_TKR_intent): Add a check for character
1091 2018-02-14 Janus Weil <janus@gcc.gnu.org>
1094 * match.c (gfc_match_select_type): Fix check for selector in
1095 SELECT TYPE statement.
1097 2018-02-13 Janus Weil <janus@gcc.gnu.org>
1100 * symbol.c (check_conflict): Reject procedure pointers in common blocks.
1102 2018-02-13 Alastair McKinstry <alastair.mckinstry@sceal.ie>
1103 Janne Blomqvist <jb@gcc.gnu.org>
1105 * module.c (dump_module): Use lbasename to ensure that module
1106 files are reproducible.
1108 2018-02-12 Janus Weil <janus@gcc.gnu.org>
1111 * resolve.c (resolve_component): Fix checks of passed argument in
1112 procedure-pointer components.
1114 2018-02-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1117 * resolve.c (resolve_formal_arglist): Update error message.
1119 2018-02-11 Andre Vehreschild <vehre@gcc.gnu.org>
1121 * gfortran.texi: Fix typos in documentation of caf_register ().
1122 * trans-array.c (structure_alloc_comps): Only register a component of
1123 a derived typed corray, not of an ultimate component coarray.
1125 2018-02-11 Steven G. Kargl <kargl@gcc.gnu.org>
1129 * interface.c (compare_actual_formal): Add in_statement_function
1130 bool parameter. Skip check of INTENT attribute for statement
1131 functions. Arguments to a statement function cannot be optional,
1132 issue error for missing argument.
1133 (gfc_procedure_use, gfc_ppc_use, gfc_arglist_matches_symbol): Use
1134 in_statement_function.
1136 2018-02-11 Paul Thomas <pault@gcc.gnu.org>
1139 * trans-expr.c (gfc_conv_derived_to_class): Set the use_offset
1140 flag. If the is a vector subscript or the expression is not a
1141 variable, make the descriptor one-based.
1143 2018-02-10 Paul Thomas <pault@gcc.gnu.org>
1147 * trans-array.c (gfc_array_init_size): Revert the change made
1148 in revision 257356 setting the dtype.
1149 * trans-types.c (gfc_get_dtype): Do not use the cached dtype.
1150 Call gfc_get_dtype_rank_type every time.
1153 * trans-array.c (gfc_conv_expr_descriptor): If the source array
1154 is a descriptor type, use its offset, removing the condition
1155 that is be a class expression.
1157 2018-02-07 Steven G. Kargl <kargl@gcc.gnu.org>
1160 * match.c (gfc_match_deallocate): Check for NULL pointer.
1162 2018-02-07 Thomas Koenig <tkoenig@gcc.gnu.org>
1165 * trans-intrinsic.c (gfc_conv_intrinsic_shape): New function.
1166 (gfc_conv_intrinsic_function): Call it.
1168 2018-02-07 Steven G. Kargl <kargl@gcc.gnu.org>
1171 * match.c (gfc_match_type_spec): If the charlen is non-NULL, then
1172 try to resolve it. While here return early if possible.
1174 2018-02-04 Paul Thomas <pault@gcc.gnu.org>
1177 * trans-decl.c (gfc_get_symbol_decl): Do not finish the decl of
1178 'length' if the symbol charlen backend_decl is an indirect ref.
1180 2018-02-03 Paul Thomas <pault@gcc.gnu.org>
1184 * trans-array.c (gfc_array_init_size): Instead of gfc_get_dtype
1185 use gfc_get_dtype_rank_type.
1187 2018-02-01 Janne Blomqvist <jb@gcc.gnu.org>
1191 * resolve.c (resolve_assoc_var): Generate an error if
1192 target length unknown.
1194 2018-02-01 Janne Blomqvist <jb@gcc.gnu.org>
1197 * simplify.c (gfc_simplify_repeat): Increase limit for deferring
1198 to runtime, print a warning message.
1200 2018-01-31 Jakub Jelinek <jakub@redhat.com>
1203 * openmp.c (gfc_match_omp_clauses): If all the linear
1204 gfc_match_omp_variable_list calls failed, don't gfc_free_omp_namelist
1205 nor set *head = NULL. Formatting fixes.
1207 2018-01-31 Paul Thomas <pault@gcc.gnu.org>
1210 * trans-expr.c (gfc_conv_procedure_call): If the parm expr is
1211 an address expression passed to an assumed rank dummy, convert
1212 to an indirect reference.
1214 2018-01-31 Thomas Koenig <tkoenig@gcc.gnu.org>
1216 * dump-parse-tree.c (write_proc): Use sym_name (which may
1217 be sym->binding_label) instead of sym->name.
1219 2018-01-31 Janne Blomqvist <jb@gcc.gnu.org>
1221 * trans-const.c (gfc_conv_string_init): Use gfc_charlen_t instead
1224 2018-01-31 Janne Blomqvist <jb@gcc.gnu.org>
1227 * trans-expr.c (fill_with_spaces): Use memset instead of
1229 (gfc_trans_string_copy): Improve opportunity to use builtins with
1232 2018-01-30 Jakub Jelinek <jakub@redhat.com>
1235 * trans-array.c (gfc_get_descriptor_offsets_for_info): Set *data_off
1236 to DATA_FIELD's offset rather than OFFSET_FIELD's offset.
1238 2018-01-30 Thomas Koenig <tkoenig@gcc.gnu.org>
1241 * array.c (gfc_ref_dimen_size): Whitespace fixes. If stride is
1244 2018-01-30 Thomas Koenig <tkoenig@gcc.gnu.org>
1247 * frontend-passes (matmul_to_var_expr): Return early if
1248 in association list.
1249 (inline_matmul_assign): Likewise.
1251 2017-01-29 Thomas Koenig <tkoenig@gcc.gnu.org>
1254 * resolve.c (resolve_component): Ensure BIND(C) character
1255 components have length one.
1256 (resolve_symbol): Likewise for variables.
1258 2018-01-27 Jakub Jelinek <jakub@redhat.com>
1261 * decl.c (add_init_expr_to_sym): Ignore initializers for too large
1264 2018-01-26 Damian Rouson <damian@sourceryinstitute.org>
1265 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
1266 Soren Rasmussen <s.c.rasmussen@gmail.com>
1268 Partial support for Fortran 2018 teams features.
1270 * array.c (gfc_match_array_ref): add team attribute in coarray
1272 * check.c (gfc_check_get_team, gfc_check_team_number): add new
1273 functions for get_team and team_number.
1274 * dump-parse-tree.c (show_code_node): add new statements: form team,
1275 change team, end team, and sync team.
1276 * expr.c (gfc_find_team_co): add new function.
1277 * gfortran.h: add new statements.
1278 * intrinsic.c (add_functions): add get_team and team_number functions.
1279 * intrinsic.h: add get_team and team_number prototypes for check,
1280 simplify, and resolve.
1281 * iresolve.c (gfc_resolve_get_team, gfc_resolve_team_number): add new
1283 * iso-fortran-env.def: add the team_type derived type.
1284 * match.c (gfc_match_if, gfc_match_form_team, gfc_match_team_number)
1285 (gfc_match_end_team, gfc_match_sync_team, gfc_match_change_team):
1286 add change team, end team, form team, sync team match and functions.
1287 * match.h: add new prototypes for change team, end team, form team,
1289 * parse.c (decode_statement): add cases for change team, end team,
1290 form team, and sync team.
1291 * resolve.c: add cases for exec form team, change team, end team, and
1293 * simplify.c (gfc_simplify_get_team): add new function for get team.
1294 * st.c (gfc_free_statement): add cases exec for change team, end team,
1295 form team, sync team.
1296 * trans-decl.c (gfor_fndecl_caf_form_team)
1297 (gfor_fndecl_caf_change_team, gfor_fndecl_caf_end_team)
1298 (gfor_fndecl_caf_sync_team, gfor_fndecl_caf_get_team)
1299 (gfor_fndecl_caf_team_number): add functions and definitions.
1300 * trans-intrinsic.c (conv_caf_send, conv_intrinsic_team_number): add
1301 new function and team_type argument support.
1302 * trans-stmt.c (gfc_trans_form_team, gfc_trans_change_team)
1303 (gfc_trans_end_team, gfc_trans_sync_team): add new functions.
1304 * trans-stmt.h: add new prototypes.
1305 * trans-types.c (gfc_get_derived_type): check condition for team_type.
1306 * trans.c (trans_code): new exec cases for form team, change team, end
1307 team, and sync team.
1308 * trans.h: add new prototypes.
1310 2018-01-26 Steven G. Kargl <kargl@gcc.gnu.org>
1313 * simplify.c (compute_dot_product): Initialize result to INTEGER(1) 0
1314 or .false. The summation does the correct type conversion.
1315 (gfc_simplify_dot_product): Special case zero-sized arrays.
1317 2018-25-01 Paul Thomas <pault@gcc.gnu.org>
1320 * array.c (gfc_match_array_ref): If standard earlier than F2008
1321 it is an error if the reference dimension is greater than 7.
1322 libgfortran.h : Increase GFC_MAX_DIMENSIONS to 15. Change the
1323 dtype masks and shifts accordingly.
1324 * trans-array.c (gfc_conv_descriptor_dtype): Use the dtype
1325 type node to check the field.
1326 (gfc_conv_descriptor_dtype): Access the rank field of dtype.
1327 (duplicate_allocatable_coarray): Access the rank field of the
1328 dtype descriptor rather than the dtype itself.
1329 * trans-expr.c (get_scalar_to_descriptor_type): Store the type
1330 of 'scalar' on entry and use its TREE_TYPE if it is ARRAY_TYPE
1332 (gfc_conv_procedure_call): Pass TREE_OPERAND (tmp,0) to
1333 get_scalar_to_descriptor_type if the actual expression is a
1335 (gfc_trans_structure_assign): Assign the rank directly to the
1337 * trans-intrinsic.c (gfc_conv_intrinsic_rank): Cast the result
1338 to default integer kind.
1339 (gfc_conv_intrinsic_sizeof): Obtain the element size from the
1340 'elem_len' field of the dtype.
1341 * trans-io.c (gfc_build_io_library_fndecls): Replace
1342 gfc_int4_type_node with dtype_type_node where necessary.
1343 (transfer_namelist_element): Use gfc_get_dtype_rank_type for
1345 * trans-types.c : Provide 'get_dtype_type_node' to acces the
1346 dtype_type_node and, if necessary, build it.
1347 The maximum size of an array element is now determined by the
1348 maximum value of size_t.
1349 Update the description of the array descriptor, including the
1350 type def for the dtype_type.
1351 (gfc_get_dtype_rank_type): Build a constructor for the dtype.
1352 Distinguish RECORD_TYPEs that are BT_DERIVED or BT_CLASS.
1353 (gfc_get_array_descriptor_base): Change the type of the dtype
1354 field to dtype_type_node.
1355 (gfc_get_array_descr_info): Get the offset to the rank field of
1357 * trans-types.h : Add a prototype for 'get_dtype_type_node ()'.
1358 * trans.h : Define the indices of the dtype fields.
1360 2018-23-01 Paul Thomas <pault@gcc.gnu.org>
1363 * decl.c (gfc_match_derived_decl): If eos not matched, recover
1364 and emit error about garbage after declaration.
1366 2018-23-01 Paul Thomas <pault@gcc.gnu.org>
1369 * trans-stmt.c (trans_associate_var): Do not set cst_array_ctor
1372 2018-01-22 Janne Blomqvist <jb@gcc.gnu.org>
1376 * arith.c (gfc_arith_concat): Use size_t for string length.
1377 (gfc_compare_string): Likewise.
1378 (gfc_compare_with_Cstring): Likewise.
1379 * array.c (gfc_resolve_character_array_constructor): Use
1380 HOST_WIDE_INT, gfc_mpz_get_hwi.
1381 * check.c (gfc_check_fe_runtime_error): Use size_t.
1382 * data.c (create_character_initializer): Use HOST_WIDE_INT,
1384 * decl.c (gfc_set_constant_character_len): Use gfc_charlen_t.
1385 (add_init_expr_to_sym): Use HOST_WIDE_INT.
1386 * expr.c (gfc_build_init_expr): Use HOST_WIDE_INT,
1388 (gfc_apply_init): Likewise.
1389 * match.h (gfc_set_constant_character_len): Update prototype.
1390 * primary.c (match_string_constant): Use size_t.
1391 * resolve.c (resolve_ordinary_assign): Use HOST_WIDE_INT,
1393 * simplify.c (init_result_expr): Likewise.
1394 (gfc_simplify_len_trim): Use size_t.
1395 * target-memory.c (gfc_encode_character): Use size_t.
1396 (gfc_target_encode_expr): Use HOST_WIDE_INT, gfc_mpz_get_hwi.
1397 (interpret_array): Use size_t.
1398 (gfc_interpret_character): Likewise.
1399 * target-memory.h (gfc_encode_character): Update prototype.
1400 (gfc_interpret_character): Likewise.
1401 (gfc_target_interpret_expr): Likewise.
1402 * trans-const.c (gfc_build_string_const): Use size_t for length
1404 (gfc_build_wide_string_const): Likewise.
1405 * trans-const.h (gfc_build_string_const): Likewise.
1406 (gfc_build_wide_string_const): Likewise.
1408 2018-01-20 Steven G. Kargl <kargl@gcc.gnu.org>
1411 * simplify.c (gfc_simplify_matmul): Set return type correctly.
1413 2018-01-19 Steven G. Kargl <kargl@gcc.gnu.org>
1416 * simplify.c (gfc_simplify_matmul): Delete bogus assertion.
1418 2018-01-17 Harald Anlauf <anlauf@gmx.de>
1421 * expr.c (add_init_expr_to_sym): Do not dereference NULL pointer.
1423 2018-01-17 Harald Anlauf <anlauf@gmx.de>
1426 * decl.c (add_init_expr_to_sym): Do not dereference NULL pointer.
1428 2018-01-15 Louis Krupp <louis.krupp@zoho.com>
1431 * interface.c (compare_rank): Don't try to retrieve CLASS_DATA
1432 from symbol marked unlimited polymorphic.
1433 * resolve.c (resolve_structure_cons): Likewise.
1434 * misc.c (gfc_typename): Don't dereference derived->components
1437 2018-01-15 Thomas Koenig <tkoenig@gcc.gnu.org>
1440 * gfortran.h (gfc_check_f): Rename f4ml to f5ml.
1441 (gfc_logical_4_kind): New macro
1442 * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument.
1443 (gfc_simplify_maxloc): Likewise.
1444 (gfc_resolve_maxloc): Likewise.
1445 (gfc_resolve_minloc): Likewise.
1446 * check.c (gfc_check_minloc_maxloc): Add checking for "back"
1447 argument; also raise error if it is used (for now). Add it
1448 if it isn't present.
1449 * intrinsic.c (add_sym_4ml): Rename to
1450 (add_sym_5ml), adjust for extra argument.
1451 (add_functions): Add "back" constant. Adjust maxloc and minloc
1453 * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is
1454 not of gfc_logical_4_kind, convert.
1455 (gfc_resolve_minloc): Likewise.
1456 * simplify.c (gfc_simplify_minloc): Add back argument.
1457 (gfc_simplify_maxloc): Likewise.
1458 * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last
1459 argument to %VAL to ensure passing by value.
1460 (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc
1461 also for library calls.
1463 2018-01-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1466 * resolve.c (resolve_transfer): Delete code looking for 'DT'
1467 format specifiers in format strings. Set formatted to true if a
1468 format string or format label is present.
1469 * trans-io.c (get_dtio_proc): Likewise. (transfer_expr): Fix
1472 2018-01-13 Thomas Koenig <tkoenig@gcc.gnu.org>
1475 * dump-parse-tree.c (get_c_type_name): Remove extra line.
1476 Change for loop to use declaration in for loop. Handle BT_LOGICAL
1478 (write_decl): Add where argument. Fix indentation. Replace
1479 assert with error message. Add typename to warning
1481 (write_type): Adjust locus to call of write_decl.
1482 (write_variable): Likewise.
1483 (write_proc): Likewise. Replace assert with error message.
1485 2018-01-13 Paul Thomas <pault@gcc.gnu.org>
1488 * trans-expr.c (gfc_trans_scalar_assign): Flag is_alloc_lhs if
1489 the rhs expression is neither an elemental nor a conversion
1493 * trans-array.c (is_pointer_array): Remove unconditional return
1494 of false for -fopenmp.
1496 2018-01-13 Thomas Koenig <tkoenig@gcc.gnu.org>
1500 * dump-parse-tree.c (write_proc): Always emit closing parenthesis
1503 2018-01-10 Steven G. Kargl <kargl@gcc.gnu.org>
1506 * resolve.c (resolve_allocate_expr): Check for NULL pointer.
1508 2018-01-10 Steven G. Kargl <kargl@gcc.gnu.org>
1511 * resolve.c (resolve_charlen): Check the type of cl->length
1514 2018-01-10 Janne Blomqvist <jb@gcc.gnu.org>
1517 * trans-array.c (gfc_trans_array_ctor_element): Fix formatting.
1519 2018-01-10 Janne Blomqvist <jb@gcc.gnu.org>
1522 * trans-array.c (gfc_trans_array_ctor_element): Convert RHS to the
1523 LHS type when assigning.
1525 2018-01-09 Steven G. Kargl <kargl@gcc.gnu.org>
1528 * expr.c (gfc_is_simply_contiguous): Check for NULL pointer.
1530 2018-01-08 Steven G. Kargl <kargl@gcc.gnu.org>
1532 * match.c (gfc_match_allocate): Check for NULL pointer.
1534 2018-01-08 Steven G. Kargl <kargl@gcc.gnu.org>
1536 * expr.c (gfc_check_pointer_assign): Fix typo in comment.
1538 2018-01-08 Paul Thomas <pault@gcc.gnu.org>
1541 * decl.c (gfc_get_pdt_instance): If parameterized arrays have
1542 an initializer, convert the kind parameters and add to the
1543 component if the instance.
1544 * trans-array.c (structure_alloc_comps): Add 'is_pdt_type' and
1545 use it with case COPY_ALLOC_COMP. Call 'duplicate_allocatable'
1546 for parameterized arrays. Clean up typos in comments. Convert
1547 parameterized array initializers and copy into the array.
1548 * trans-expr.c (gfc_trans_scalar_assign): Do a deep copy for
1549 parameterized types.
1550 *trans-stmt.c (trans_associate_var): Deallocate associate vars
1551 as necessary, when they are PDT function results for example.
1554 * trans-array.c (structure_alloc_comps): Only compare len parms
1555 when they are declared explicitly.
1557 2018-01-06 Janne Blomqvist <jb@gcc.gnu.org>
1560 * trans-expr.c (gfc_trans_pointer_assignment): fold_convert rhs to
1563 2018-01-05 Janne Blomqvist <jb@gcc.gnu.org>
1567 * array.c (got_charlen): Use gfc_charlen_int_kind.
1568 * class.c (gfc_find_derived_vtab): Use gfc_size_kind instead of
1570 (find_intrinsic_vtab): Likewise.
1571 * decl.c (match_char_length): Use gfc_charlen_int_kind.
1572 (add_init_expr_to_sym): Use gfc_charlen_t and gfc_charlen_int_kind.
1573 (gfc_match_implicit): Use gfc_charlen_int_kind.
1574 * dump-parse-tree.c (show_char_const): Use gfc_charlen_t and size_t.
1575 (show_expr): Use HOST_WIDE_INT_PRINT_DEC.
1576 * expr.c (gfc_get_character_expr): Length parameter of type
1578 (gfc_get_int_expr): Value argument of type HOST_WIDE_INT.
1579 (gfc_extract_hwi): New function.
1580 (simplify_const_ref): Make string_len of type gfc_charlen_t.
1581 (gfc_simplify_expr): Use HOST_WIDE_INT for substring refs.
1582 * frontend-passes.c (optimize_trim): Use gfc_charlen_int_kind.
1583 * gfortran.h (gfc_mpz_get_hwi): New prototype.
1584 (gfc_mpz_set_hwi): Likewise.
1585 (gfc_charlen_t): New typedef.
1586 (gfc_expr): Use gfc_charlen_t for character lengths.
1587 (gfc_size_kind): New extern variable.
1588 (gfc_extract_hwi): New prototype.
1589 (gfc_get_character_expr): Use gfc_charlen_t for character length.
1590 (gfc_get_int_expr): Use HOST_WIDE_INT type for value argument.
1591 * gfortran.texi: Update description of hidden string length argument.
1592 * iresolve.c (check_charlen_present): Use gfc_charlen_int_kind.
1593 (gfc_resolve_char_achar): Likewise.
1594 (gfc_resolve_repeat): Pass string length directly without
1595 temporary, use gfc_charlen_int_kind.
1596 (gfc_resolve_transfer): Use gfc_charlen_int_kind.
1597 * match.c (select_intrinsic_set_tmp): Use HOST_WIDE_INT for charlen.
1598 * misc.c (gfc_mpz_get_hwi): New function.
1599 (gfc_mpz_set_hwi): New function.
1600 * module.c (atom_int): Change type from int to HOST_WIDE_INT.
1601 (parse_integer): Don't complain about large integers.
1602 (write_atom): Use HOST_WIDE_INT for integers.
1603 (mio_integer): Handle integer type mismatch.
1604 (mio_hwi): New function.
1605 (mio_intrinsic_op): Use HOST_WIDE_INT.
1606 (mio_array_ref): Likewise.
1607 (mio_expr): Likewise.
1608 * primary.c (match_substring): Use gfc_charlen_int_kind.
1609 * resolve.c (resolve_substring_charlen): Use gfc_charlen_int_kind.
1610 (resolve_character_operator): Likewise.
1611 (resolve_assoc_var): Likewise.
1612 (resolve_select_type): Use HOST_WIDE_INT for charlen, use snprintf.
1613 (resolve_charlen): Use mpz_sgn to determine sign.
1614 * simplify.c (gfc_simplify_repeat): Use HOST_WIDE_INT/gfc_charlen_t
1616 * symbol.c (generate_isocbinding_symbol): Use gfc_charlen_int_kind.
1617 * target-memory.c (size_character): Length argument of type
1619 (gfc_encode_character): Likewise.
1620 (gfc_interpret_character): Use gfc_charlen_t.
1621 * target-memory.h (gfc_encode_character): Modify prototype.
1622 * trans-array.c (gfc_trans_array_ctor_element): Use existing type.
1623 (get_array_ctor_var_strlen): Use gfc_conv_mpz_to_tree_type.
1624 (trans_array_constructor): Use existing type.
1625 (get_array_charlen): Likewise.
1626 * trans-const.c (gfc_conv_mpz_to_tree_type): New function.
1627 * trans-const.h (gfc_conv_mpz_to_tree_type): New prototype.
1628 * trans-decl.c (gfc_trans_deferred_vars): Use existing type.
1629 (add_argument_checking): Likewise.
1630 * trans-expr.c (gfc_class_len_or_zero_get): Build const of type
1631 gfc_charlen_type_node.
1632 (gfc_conv_intrinsic_to_class): Use gfc_charlen_int_kind instead of
1633 4, fold_convert to correct type.
1634 (gfc_conv_class_to_class): Build const of type size_type_node for
1636 (gfc_copy_class_to_class): Likewise.
1637 (gfc_conv_string_length): Use same type in expression.
1638 (gfc_conv_substring): Likewise, use HOST_WIDE_INT for charlen.
1639 (gfc_conv_string_tmp): Make sure len is of the right type.
1640 (gfc_conv_concat_op): Use same type in expression.
1641 (gfc_conv_procedure_call): Likewise.
1642 (fill_with_spaces): Comment out memset() block due to spurious
1643 -Wstringop-overflow warnings.
1644 (gfc_trans_string_copy): Use gfc_charlen_type_node.
1645 (alloc_scalar_allocatable_for_subcomponent_assignment):
1646 fold_convert to right type.
1647 (gfc_trans_subcomponent_assign): Likewise.
1648 (trans_class_vptr_len_assignment): Build const of correct type.
1649 (gfc_trans_pointer_assignment): Likewise.
1650 (alloc_scalar_allocatable_for_assignment): fold_convert to right
1652 (trans_class_assignment): Build const of correct type.
1653 * trans-intrinsic.c (gfc_conv_associated): Likewise.
1654 (gfc_conv_intrinsic_repeat): Do calculation in sizetype.
1655 * trans-io.c (gfc_build_io_library_fndecls): Use
1656 gfc_charlen_type_node for character lengths.
1657 (set_string): Convert to right type in assignment.
1658 * trans-stmt.c (gfc_trans_label_assign): Build const of
1659 gfc_charlen_type_node.
1660 (trans_associate_var): Likewise.
1661 (gfc_trans_character_select): Likewise.
1662 (gfc_trans_allocate): Likewise, don't typecast strlen result.
1663 (gfc_trans_deallocate): Don't typecast strlen result.
1664 * trans-types.c (gfc_size_kind): New variable.
1665 (gfc_init_types): Determine gfc_charlen_int_kind and gfc_size_kind
1666 from size_type_node.
1667 * trans-types.h: Fix comment.
1669 2018-01-04 Thomas Koenig <tkoenig@gcc.gnu.org>
1673 * check.c (gfc_check_eoshift): Check for string length and
1674 for conformance of boundary.
1675 * intrinsic.c (add_functions): Add gfc_simplify_eoshift.
1676 * intrinsic.h: Add prototype for gfc_simplify_eoshift.
1677 * simplify.c (gfc_simplify_eoshift): New function.
1679 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1680 Alan Hayward <alan.hayward@arm.com>
1681 David Sherwood <david.sherwood@arm.com>
1683 * trans-types.c (gfc_type_for_mode): Handle MODE_VECTOR_BOOL.
1685 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
1686 Alan Hayward <alan.hayward@arm.com>
1687 David Sherwood <david.sherwood@arm.com>
1689 * trans-types.c (gfc_type_for_mode): Check valid_vector_subparts_p.
1691 2018-01-03 Thomas Koenig <tkoenig@gcc.gnu.org>
1694 * check.c (gfc_check_eoshift): Error for missing boundary if array
1695 is not one of the standard types.
1697 2018-01-03 Jakub Jelinek <jakub@redhat.com>
1699 Update copyright years.
1701 * gfortranspec.c (lang_specific_driver): Update copyright notice
1703 * gfc-internals.texi: Bump @copying's copyright year.
1704 * gfortran.texi: Ditto.
1705 * intrinsic.texi: Ditto.
1706 * invoke.texi: Ditto.
1708 2017-01-02 Thomas Koenig <tkoenig@gcc.gnu.org>
1711 * intrinsic.c (add_function): Add gfc_simplify_maxloc and
1712 gfc_simplify_minloc to maxloc and minloc, respectively.
1713 * intrinsic.h: Add prototypes for gfc_simplify_minloc
1714 and gfc_simplify_maxloc.
1715 * simplify.c (min_max_chose): Adjust prototype. Modify function
1716 to have a return value which indicates if the extremum was found.
1717 (is_constant_array_expr): Fix typo in comment.
1718 (simplify_minmaxloc_to_scalar): New function.
1719 (simplify_minmaxloc_nodim): New function.
1720 (new_array): New function.
1721 (simplify_minmaxloc_to_array): New function.
1722 (gfc_simplify_minmaxloc): New function.
1723 (simplify_minloc): New function.
1724 (simplify_maxloc): New function.
1726 2018-01-02 Thomas Koenig <tkoenig@gcc.gnu.org>
1730 * simplify.c (gfc_simplify_cshift): Re-implement to allow full
1733 2018-01-01 Paul Thomas <pault@gcc.gnu.org>
1736 * resolve.c (resolve_fl_derived0): Add caf_token fields for
1737 allocatable and pointer scalars, when -fcoarray selected.
1738 * trans-types.c (gfc_copy_dt_decls_ifequal): Copy the token
1739 field as well as the backend_decl.
1740 (gfc_get_derived_type): Flag GFC_FCOARRAY_LIB for module
1741 derived types that are not vtypes. Components with caf_token
1742 attribute are pvoid types. For a component requiring it, find
1743 the caf_token field and have the component token field point to
1747 *trans-types.c (gfc_get_array_descriptor_base): Add the token
1748 field to the descriptor even when codimen not set.
1750 Copyright (C) 2018 Free Software Foundation, Inc.
1752 Copying and distribution of this file, with or without modification,
1753 are permitted in any medium without royalty provided the copyright
1754 notice and this notice are preserved.