1 2023-05-26 Tobias Burnus <tobias@codesourcery.com>
3 * dump-parse-tree.cc (show_omp_namelist): Update allocator, fix
5 (show_omp_node, show_code_node): Handle EXEC_OMP_ALLOCATE.
6 * gfortran.h (enum gfc_statement): Add ST_OMP_ALLOCATE and ..._EXEC.
7 (enum gfc_exec_op): Add EXEC_OMP_ALLOCATE.
8 (struct gfc_omp_namelist): Add 'allocator' to 'u2' union.
9 (struct gfc_namespace): Add omp_allocate.
10 (gfc_resolve_omp_allocate): New.
11 * match.cc (gfc_free_omp_namelist): Free 'u2.allocator'.
12 * match.h (gfc_match_omp_allocate, gfc_match_omp_allocators): New.
13 * openmp.cc (gfc_omp_directives): Uncomment allocate/allocators.
14 (gfc_match_omp_variable_list): Add bool arg for
15 rejecting listening common-block vars separately.
16 (gfc_match_omp_clauses): Update for u2.allocators.
17 (OMP_ALLOCATORS_CLAUSES, gfc_match_omp_allocate,
18 gfc_match_omp_allocators, is_predefined_allocator,
19 gfc_resolve_omp_allocate): New.
20 (resolve_omp_clauses): Update 'allocate' clause checks.
21 (omp_code_to_statement, gfc_resolve_omp_directive): Handle
22 OMP ALLOCATE/ALLOCATORS.
23 * parse.cc (in_exec_part): New global var.
24 (check_omp_allocate_stmt, parse_openmp_allocate_block): New.
25 (decode_omp_directive, case_exec_markers, case_omp_decl,
26 gfc_ascii_statement, parse_omp_structured_block): Handle
27 OMP allocate/allocators.
28 (verify_st_order, parse_executable): Set in_exec_part.
29 * resolve.cc (gfc_resolve_blocks, resolve_codes): Handle
31 * st.cc (gfc_free_statement): Likewise.
32 * trans.cc (trans_code): Likewise.
33 * trans-openmp.cc (gfc_trans_omp_directive): Likewise.
34 (gfc_trans_omp_clauses, gfc_split_omp_clauses): Update for
35 u2.allocator, fix for u.align.
37 2023-05-24 Harald Anlauf <anlauf@gmx.de>
40 * simplify.cc (simplify_size): Reject DIM argument of intrinsic SIZE
41 with error when out of valid range.
43 2023-05-24 Harald Anlauf <anlauf@gmx.de>
46 * check.cc (gfc_check_reshape): Expand constant arguments SHAPE and
47 ORDER before checking.
48 * gfortran.h (gfc_is_constant_array_expr): Add prototype.
49 * iresolve.cc (gfc_resolve_reshape): Expand constant argument SHAPE.
50 * simplify.cc (is_constant_array_expr): If array is determined to be
51 constant, expand small array constructors if needed.
52 (gfc_is_constant_array_expr): Wrapper for is_constant_array_expr.
53 (gfc_simplify_reshape): Fix check for insufficient elements in SOURCE
54 when no padding specified.
56 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
59 * resolve.cc (gfc_resolve_ref): Conversion of array_ref into an
60 element should be done for all characters without a len expr,
61 not just deferred lens, and for integer expressions.
62 * trans-expr.cc (conv_inquiry): For len and kind inquiry refs,
63 set the se string_length to NULL_TREE.
65 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
66 Steven G. Kargl <kargl@gcc.gnu.org>
69 * decl.cc (variable_decl): Clean up white space issues.
70 (gfc_match_final_decl): Declaration of finalizable derived type
71 is allowed in a submodule.
73 2023-05-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
75 * expr.cc (gfc_get_corank): Use CLASS_DATA from gfortran.h.
76 * resolve.cc (resolve_component): Same.
77 (resolve_fl_derived0): Same.
78 * simplify.cc (gfc_simplify_extends_type_of): Same.
79 (simplify_cobound): Same.
81 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
83 * trans-array.cc (is_pointer_array): Use _P() defines from tree.h.
84 (gfc_conv_scalarized_array_ref): Ditto.
85 (gfc_conv_array_ref): Ditto.
86 * trans-decl.cc (gfc_finish_decl): Ditto.
87 (gfc_get_symbol_decl): Ditto.
88 * trans-expr.cc (gfc_trans_pointer_assignment): Ditto.
89 (gfc_trans_arrayfunc_assign): Ditto.
90 (gfc_trans_assignment_1): Ditto.
91 * trans-intrinsic.cc (gfc_conv_intrinsic_minmax): Ditto.
92 (conv_intrinsic_ieee_value): Ditto.
93 * trans-io.cc (gfc_convert_array_to_string): Ditto.
94 * trans-openmp.cc (gfc_omp_is_optional_argument): Ditto.
95 (gfc_trans_omp_clauses): Ditto.
96 * trans-stmt.cc (gfc_conv_label_variable): Ditto.
97 * trans.cc (gfc_build_addr_expr): Ditto.
98 (get_array_span): Ditto.
100 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
103 * array.cc (compare_bounds): Use narrower return type.
104 (gfc_compare_array_spec): Likewise.
105 (is_constant_element): Likewise.
106 (gfc_constant_ac): Likewise.
107 * check.cc (dim_rank_check): Likewise.
108 * cpp.cc (gfc_cpp_init_options): Likewise.
109 (dump_macro): Likewise.
110 * cpp.h (gfc_cpp_handle_option): Likewise.
111 * dependency.cc (gfc_ref_needs_temporary_p): Likewise.
112 (gfc_check_argument_dependency): Likewise.
113 (gfc_check_fncall_dependency): Likewise.
114 (ref_same_as_full_array): Likewise.
115 * dependency.h (gfc_check_fncall_dependency): Likewise.
116 (gfc_dep_resolver): Likewise.
117 (gfc_are_equivalenced_arrays): Likewise.
118 * expr.cc (gfc_copy_ref): Likewise.
119 (gfc_kind_max): Likewise.
120 (numeric_type): Likewise.
121 * gfortran.h (gfc_at_end): Likewise.
122 (gfc_at_eof): Likewise.
123 (gfc_at_bol): Likewise.
124 (gfc_at_eol): Likewise.
125 (gfc_define_undef_line): Likewise.
126 (gfc_wide_is_printable): Likewise.
127 (gfc_wide_is_digit): Likewise.
128 (gfc_wide_fits_in_byte): Likewise.
129 (gfc_find_sym_tree): Likewise.
130 (gfc_generic_intrinsic): Likewise.
131 (gfc_specific_intrinsic): Likewise.
132 (gfc_intrinsic_actual_ok): Likewise.
133 (gfc_has_vector_index): Likewise.
134 (gfc_numeric_ts): Likewise.
135 (gfc_impure_variable): Likewise.
136 (gfc_pure): Likewise.
137 (gfc_implicit_pure): Likewise.
138 (gfc_elemental): Likewise.
139 (gfc_pure_function): Likewise.
140 (gfc_implicit_pure_function): Likewise.
141 (gfc_compare_array_spec): Likewise.
142 (gfc_constant_ac): Likewise.
143 (gfc_expanded_ac): Likewise.
144 (gfc_check_digit): Likewise.
145 * intrinsic.cc (gfc_find_subroutine): Likewise.
146 (gfc_generic_intrinsic): Likewise.
147 (gfc_specific_intrinsic): Likewise.
148 * io.cc (compare_to_allowed_values): Likewise. And remove
149 unneeded forward declaration.
150 * parse.cc: Likewise.
151 * parse.h (gfc_check_do_variable): Likewise.
152 * primary.cc (gfc_check_digit): Likewise.
153 * resolve.cc (resolve_structure_cons): Likewise.
154 (pure_stmt_function): Likewise.
155 (gfc_pure_function): Likewise.
156 (impure_stmt_fcn): Likewise.
157 (resolve_forall_iterators): Likewise.
158 (resolve_data): Likewise.
159 (gfc_impure_variable): Likewise.
160 (gfc_pure): Likewise.
161 (gfc_unset_implicit_pure): Likewise.
162 * scanner.cc (wide_is_ascii): Likewise.
163 (gfc_wide_toupper): Likewise.
164 (gfc_open_included_file): Likewise.
165 (gfc_at_end): Likewise.
166 (gfc_at_eof): Likewise.
167 (gfc_at_bol): Likewise.
168 (skip_comment_line): Likewise.
169 (gfc_gobble_whitespace): Likewise.
170 * symbol.cc (gfc_find_symtree_in_proc): Likewise.
171 * trans-array.cc: Likewise.
172 * trans-decl.cc (gfc_set_decl_assembler_name): Likewise.
173 * trans-types.cc (gfc_get_element_type): Likewise.
174 (gfc_add_field_to_struct): Likewise.
175 * trans-types.h (gfc_copy_dt_decls_ifequal): Likewise.
176 (gfc_return_by_reference): Likewise.
177 (gfc_is_nodesc_array): Likewise.
178 * trans.h (gfc_can_put_var_on_stack): Likewise.
180 2023-05-17 Harald Anlauf <anlauf@gmx.de>
184 * decl.cc (add_init_expr_to_sym): Set shape of initializer also for
185 zero-sized arrays, so that bounds violations can be detected later.
187 2023-05-17 Tobias Burnus <tobias@codesourcery.com>
189 * trans-decl.cc (gfc_get_symbol_decl): Add attributes
190 such as 'declare target' also to hidden artificial
191 variable for deferred-length character variables.
192 * trans-openmp.cc (gfc_trans_omp_array_section,
193 gfc_trans_omp_clauses, gfc_trans_omp_target_exit_data):
194 Improve mapping of array descriptors and deferred-length
197 2023-05-16 Paul Thomas <pault@gcc.gnu.org>
205 * interface.cc (gfc_compare_actual_formal): Emit an error if an
206 unlimited polymorphic actual is not matched either to an
207 unlimited or assumed type formal argument.
208 * resolve.cc (resolve_ordinary_assign): Emit an error if the
209 var expression of an ordinary assignment is a proc pointer
211 * trans-array.cc (gfc_walk_array_ref): Provide assumed shape
212 arrays coming from interface mapping with a viable arrayspec.
213 * trans-expr.cc (gfc_conv_intrinsic_to_class): Tidy up flagging
214 of unlimited polymorphic 'class_ts'.
215 (gfc_conv_gfc_desc_to_cfi_desc): Assumed type is unlimited
216 polymorphic and should accept any actual type.
217 (gfc_conv_procedure_call): Replace dreadful kludge with a call
218 to gfc_finalize_tree_expr. Avoid dereferencing a void pointer
219 by giving it the pointer type of the actual argument.
220 (alloc_scalar_allocatable_subcomponent): Shorten the function
221 name and replace the symbol argument with the se string length.
222 If a deferred length character length is either not present or
223 is not a variable, give the typespec a variable and assign the
224 string length to that. Use gfc_deferred_strlen to find the
225 hidden string length component.
226 (gfc_trans_subcomponent_assign): Convert the expression before
227 the call to alloc_scalar_allocatable_subcomponent so that a
228 good string length is provided.
229 (gfc_trans_structure_assign): Remove the unneeded derived type
230 symbol from calls to gfc_trans_subcomponent_assign.
232 2023-05-15 Harald Anlauf <anlauf@gmx.de>
235 * expr.cc (gfc_check_vardef_context): Check appropriate pointer
236 attribute for CLASS vs. non-CLASS function result in variable
239 2023-05-11 Xi Ruoyao <xry111@xry111.site>
241 * Make-lang.in: Use grep instead of fgrep.
243 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
245 * dump-parse-tree.cc (gfc_debug_expr): Remove forward declaration.
246 (debug): Add DEBUG_FUNCTION.
247 (show_code_node): Remove erroneous whitespace.
249 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
252 * dump-parse-tree.cc (debug): New function for gfc_namespace.
253 (gfc_debug_code): Delete forward declaration.
254 (show_attr): Make sure to print balanced braces.
256 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
258 * resolve.cc (resolve_select_type): Fix coding style.
260 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
262 * resolve.cc (resolve_select_type): Call free() unconditionally.
264 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
267 * expr.cc (find_array_section): Fix mpz memory leak.
268 * simplify.cc (gfc_simplify_reshape): Fix mpz memory leaks in
271 2023-05-05 Harald Anlauf <anlauf@gmx.de>
274 * arith.cc (eval_intrinsic): Check conformability of ranks of operands
275 for intrinsic binary operators before performing type conversions.
276 * gfortran.h (gfc_op_rank_conformable): Add prototype.
277 * resolve.cc (resolve_operator): Check conformability of ranks of
278 operands for intrinsic binary operators before performing type
280 (gfc_op_rank_conformable): New helper function to compare ranks of
281 operands of binary operator.
283 2023-05-04 Julian Brown <julian@codesourcery.com>
286 * openmp.cc (resolve_omp_clauses): Add diagnostic for
287 non-pointer/non-allocatable attach/detach.
288 * trans-openmp.cc (gfc_trans_omp_clauses): Remove dereference for
289 pointer-to-scalar derived type component attach/detach. Fix
290 attach/detach handling for descriptors.
292 2023-04-28 Julian Brown <julian@codesourcery.com>
295 * trans-openmp.cc (gfc_trans_omp_clauses): Attach/detach clause fixes.
297 2023-04-28 Tobias Burnus <tobias@codesourcery.com>
299 * gfortran.texi: Fix typos.
300 * decl.cc: Fix typos in comments and in a variable name.
301 * arith.cc: Fix comment typos.
302 * check.cc: Likewise.
303 * class.cc: Likewise.
304 * dependency.cc: Likewise.
306 * frontend-passes.cc: Likewise.
307 * gfortran.h: Likewise.
308 * intrinsic.cc: Likewise.
309 * iresolve.cc: Likewise.
310 * match.cc: Likewise.
311 * module.cc: Likewise.
312 * primary.cc: Likewise.
313 * resolve.cc: Likewise.
314 * simplify.cc: Likewise.
315 * trans-array.cc: Likewise.
316 * trans-decl.cc: Likewise.
317 * trans-expr.cc: Likewise.
318 * trans-intrinsic.cc: Likewise.
319 * trans-openmp.cc: Likewise.
320 * trans-stmt.cc: Likewise.
322 2023-04-25 Tobias Burnus <tobias@codesourcery.com>
324 * openmp.cc (gfc_resolve_omp_do_blocks): Handle zero
325 or more than one exec statements before/after 'omp scan'.
326 * trans-openmp.cc (gfc_trans_omp_do): Likewise.
328 2023-04-22 Harald Anlauf <anlauf@gmx.de>
329 Steven G. Kargl <kargl@gcc.gnu.org>
332 * interface.cc (gfc_compare_actual_formal): Reject allocatable
333 functions being used as actual argument for allocable dummy.
335 2023-04-14 Harald Anlauf <anlauf@gmx.de>
338 * simplify.cc (gfc_simplify_set_exponent): Fix implementation of
339 compile-time simplification of intrinsic SET_EXPONENT for argument
342 2023-04-14 Paul Thomas <pault@gcc.gnu.org>
345 * gfortran.h : Add expr3_not_explicit bit field to gfc_code.
346 * resolve.cc (resolve_allocate_expr): Set bit field when the
347 default initializer is applied to expr3.
348 * trans-stmt.cc (gfc_trans_allocate): If expr3_not_explicit is
349 set, do not deallocate expr3.
351 2023-04-13 Harald Anlauf <anlauf@gmx.de>
354 * trans-expr.cc (gfc_conv_power_op): Use absu_hwi and
355 unsigned HOST_WIDE_INT for portability.
357 2023-04-12 Harald Anlauf <anlauf@gmx.de>
360 * resolve.cc (resolve_entries): Handle functions with ENTRY and
362 * trans-expr.cc (gfc_conv_procedure_call): Functions with a result
363 with the POINTER or ALLOCATABLE attribute shall not get any special
364 treatment with -ff2c, as they cannot be written in Fortran 77.
365 * trans-types.cc (gfc_return_by_reference): Likewise.
366 (gfc_get_function_type): Likewise.
368 2023-04-12 Harald Anlauf <anlauf@gmx.de>
372 * interface.cc (compare_parameter): Enable type and rank checks for
373 arguments of derived type from the intrinsic module ISO_C_BINDING.
375 2023-04-08 Paul Thomas <pault@gcc.gnu.org>
378 * iresolve.cc (gfc_resolve_adjustl, gfc_resolve_adjustr): if
379 string length is deferred use the string typespec for result.
380 * resolve.cc (resolve_assoc_var): Handle parentheses around the
382 (resolve_block_construct): Remove unnecessary static decls.
383 * trans-array.cc (gfc_conv_expr_descriptor): Guard string len
384 expression in condition. Improve handling of string length and
385 span, especially for substrings of the descriptor.
386 (duplicate_allocatable): Make element type more explicit with
388 * trans-decl.cc (gfc_get_symbol_decl): Emit a fatal error with
389 appropriate message instead of ICE if symbol type is unknown.
390 (gfc_generate_function_code): Set current locus to proc_sym
392 * trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in
393 'previous' and use if end expression in substring reference is
395 (gfc_conv_string_length): Use gfc_conv_expr_descriptor if
396 'expr_flat' is an array. Add post block to catch deallocation
398 (gfc_conv_procedure_call): Assign the parmse string length to
399 the expression string length, if it is deferred.
400 (gfc_trans_alloc_subarray_assign): If this is a deferred string
401 length component, store the string length in the hidden comp.
402 Update the typespec length accordingly. Generate a new type
403 spec for the call to gfc_duplicate-allocatable in this case.
404 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
405 deferred character array components.
407 2023-04-04 Harald Anlauf <anlauf@gmx.de>
410 * expr.cc (check_restricted): Adjust check for valid variables in
411 restricted expressions: make no exception for module variables.
413 2023-04-01 Thomas Koenig <tkoenig@gcc.gnu.org>
415 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
416 type name to be "long long".
418 2023-03-30 Andrew Pinski <apinski@marvell.com>
420 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
421 type name to be "long long". Add a comment on why adding
424 2023-03-28 Jakub Jelinek <jakub@redhat.com>
427 * openmp.cc (gfc_omp_absent_contains_clause): Fix typo in diagnostics
428 - composit -> composite.
430 2023-03-25 Harald Anlauf <anlauf@gmx.de>
433 * trans-decl.cc (gfc_conv_cfi_to_gfc): Remove dead code.
435 2023-03-24 Harald Anlauf <anlauf@gmx.de>
437 * expr.cc (free_expr0): Free also BOZ strings as part of an expression.
439 2023-03-24 Haochen Gui <guihaoc@gcc.gnu.org>
440 Tobias Burnus <tobias@codesourcery.com>
443 * target-memory.cc (gfc_interpret_float): Return FAIL when
444 native_interpret_expr gets a NULL tree.
445 * arith.cc (gfc_hollerith2real): Return NULL when
446 gfc_interpret_float fails.
447 * error.cc (gfc_buffered_p): Define.
448 * gfortran.h (gfc_buffered_p): Declare.
449 * intrinsic.cc: Add diagnostic.h to include list.
450 (do_simplify): Save errorcount and check it at finish. Report a
451 "Cannot simplify expression" error on a bad result if error count
452 doesn't change and no other errors buffered.
454 2023-03-22 Harald Anlauf <anlauf@gmx.de>
455 Steven G. Kargl <kargl@gcc.gnu.org>
458 * resolve.cc (gfc_resolve_finalizers): Argument of a FINAL subroutine
459 cannot be an alternate return.
461 2023-03-21 Harald Anlauf <anlauf@gmx.de>
464 * decl.cc (gfc_match_modproc): Reject MODULE PROCEDURE if not in a
465 generic module interface.
467 2023-03-21 Arsen Arsenović <arsen@aarsen.me>
469 * invoke.texi: Remove usages of @gol.
470 * intrinsic.texi: Ditto.
472 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
475 * trans-array.cc (gfc_trans_array_constructor_value): Correct
476 incorrect setting of typespec.
478 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
481 * resolve.cc (generate_component_assignments): Restore the
482 exclusion of allocatable components from the loop.
484 2023-03-20 Harald Anlauf <anlauf@gmx.de>
487 * invoke.texi: Correct documentation of how underscores are appended
490 2023-03-20 Harald Anlauf <anlauf@gmx.de>
493 * simplify.cc (gfc_simplify_nearest): Fix off-by-one error in setting
494 up real kind-specific maximum exponent for mpfr.
496 2023-03-20 Paul Thomas <pault@gcc.gnu.org>
499 * resolve.cc (check_host_association): If an external function
500 is typed but not declared explicitly to be external, change the
501 old symbol from a variable to an external function.
503 2023-03-19 Harald Anlauf <anlauf@gmx.de>
506 * resolve.cc (resolve_fl_procedure): Check for an explicit interface
507 of procedures with the BIND(C) attribute (F2018:15.4.2.2).
509 2023-03-19 Thomas Koenig <tkoenig@gcc.gnu.org>
511 * gfortran.texi: Mention behavior on overflow.
513 2023-03-18 Paul Thomas <pault@gcc.gnu.org>
518 * class.cc (finalize_component): Include the missing arguments
519 in the call to the component's finalizer wrapper.
520 (has_finalizer_component): Do not return true for procedure
522 (finalizer_insert_packed_call): Remove the redundant argument
523 in the call to the final subroutine.
524 (generate_finalization_wrapper): Add support for assumed rank
526 (gfc_may_be_finalized): New helper function.
527 * dump-parse-tree.cc (write_proc): Whitespace.
528 * gfortran.h : Add prototype for gfc_may_be_finalized.
529 * resolve.cc (resolve_function): Correct derived types that
530 have an incomplete namespace.
531 (resolve_where, gfc_resolve_where_code_in_forall,
532 gfc_resolve_forall_body, gfc_resolve_code): Check that the op
533 code is still EXEC_ASSIGN. If it is set lhs to must finalize.
534 (is_finalizable_type): New function.
535 (generate_component_assignments): Set must_finalize if needed.
536 (gfc_resolve_finalizers): Error if assumed rank finalizer is
537 not the only one. Warning on lack of scalar finalizer modified
538 to account for assumed rank finalizers.
539 (generate_final_call): New function.
540 (generate_component_assignments): Enclose the outermost call in
541 a block to capture automatic deallocation and final calls.
542 Set must_finalize as required to satisfy the standards. Use an
543 explicit pointer assignment for pointer components to capture
544 finalization of the target. Likewise use explicit assignment
545 for allocatable components. Do not use the temporary copy of
546 the lhs in defined assignment if the component is allocatable.
547 Put the temporary in the same namespace as the lhs symbol if
548 the component may be finalized. Remove the leading assignment
549 from the expansion of assignment of components that have their
550 own defined assignment components. Suppress finalization of
551 assignment of temporary components to the lhs. Make an explicit
552 final call for the rhs function temporary if it exists.
553 (gfc_resolve_code): Set must_finalize for assignments with an
554 array constructor on the rhs.
555 (gfc_resolve_finalizers): Ensure that an assumed rank finalizer
556 is the only finalizer for that type and correct the surprising
557 warning for the lack of a scalar finalizer.
558 (check_defined_assignments): Handle allocatable components.
559 (resolve_fl_derived): Set referenced the vtab for use
561 (resolve_symbol): Set referenced an unreferenced symbol that
563 * trans-array.cc (gfc_trans_array_constructor_value): Add code
564 to finalize the constructor result. Warn that this feature was
565 removed in F2018 and that it is suppressed by -std=2018.
566 (trans_array_constructor): Add finalblock, pass to previous
567 and apply to loop->post if filled.
568 (gfc_add_loop_ss_code): Add se finalblock to outer loop post.
569 (gfc_trans_array_cobounds, gfc_trans_array_bounds): Add any
570 generated finalization code to the main block.
571 (structure_alloc_comps): Add boolean argument to suppress
572 finalization and use it for calls from
573 gfc_deallocate_alloc_comp_no_caf. Otherwise it defaults to
575 (gfc_copy_alloc_comp_no_fini): New wrapper for
576 structure_alloc_comps.
577 (gfc_alloc_allocatable_for_assignment): Suppress finalization
578 by setting new arg in call to gfc_deallocate_alloc_comp_no_caf.
579 (gfc_trans_deferred_array): Use gfc_may_be_finalized and do not
580 deallocate the components of entities with a leading '_' in the
581 name that are also marked as artificial.
582 * trans-array.h : Add the new boolean argument to the prototype
583 of gfc_deallocate_alloc_comp_no_caf with a default of false.
584 Add prototype for gfc_copy_alloc_comp_no_fini.
585 * trans-decl.cc(init_intent_out_dt): Tidy up the code.
586 * trans-expr.cc (gfc_init_se): Initialize finalblock.
587 (gfc_conv_procedure_call): Use gfc_finalize_tree_expr to
588 finalize function results. Replace in-line block for class
589 results with call to new function.
590 (gfc_conv_expr): Finalize structure constructors for F2003 and
591 F2008. Warn that this feature was deleted in F2018 and, unlike
592 array constructors, is not default. Add array constructor
593 finalblock to the post block.
594 (gfc_trans_scalar_assign): Suppress finalization by setting new
595 argument in call to gfc_deallocate_alloc_comp_no_caf. Add the
596 finalization blocks to the main block.
597 (gfc_trans_arrayfunc_assign): Use gfc_assignment_finalizer_call
598 and ensure that finalization occurs after the evaluation of the
599 rhs but using the initial value for the lhs. Finalize rhs
600 function results using gfc_finalize_tree_expr.
601 (trans_class_assignment, gfc_trans_assignment_1): As previous
602 function, taking care to order evaluation, assignment and
603 finalization correctly.
604 * trans-io.cc (gfc_trans_transfer): Add the final block.
605 * trans-stmt.cc (gfc_trans_call, gfc_trans_allocate): likewise.
606 (trans_associate_var): Nullify derived allocatable components
607 and finalize function targets with defined assignment
608 components on leaving the block scope.
609 (trans_allocate): Finalize source expressions, if required,
610 and set init_expr artificial temporarily to suppress the
611 finalization in gfc_trans_assignment.
612 * trans.cc (gfc_add_finalizer_call): Do not finalize the
613 temporaries generated in type assignment with defined
614 assignment components.
615 (gfc_assignment_finalizer_call): New function.
616 (gfc_finalize_tree_expr): New function.
617 * trans.h: Add finalblock to gfc_se. Add the prototypes for
618 gfc_finalize_tree_expr and gfc_assignment_finalizer_call.
620 2023-03-15 Harald Anlauf <anlauf@gmx.de>
621 Tobias Burnus <tobias@codesourcery.com>
624 * interface.cc (compare_parameter): Adjust check of array dummy
625 arguments to handle the case of CLASS variables.
627 2023-03-11 Harald Anlauf <anlauf@gmx.de>
630 * trans-expr.cc (gfc_copy_class_to_class): Convert element counts in
631 bounds check to common type for comparison.
633 2023-03-10 Harald Anlauf <anlauf@gmx.de>
636 * resolve.cc (resolve_symbol): Avoid NULL pointer dereference while
637 checking a symbol with the BIND(C) attribute.
639 2023-03-05 Harald Anlauf <anlauf@gmx.de>
640 Tobias Burnus <tobias@codesourcery.com>
643 * class.cc (gfc_build_class_symbol): Handle update of attributes of
644 existing class container.
645 (gfc_find_derived_vtab): Fix several memory leaks.
646 (find_intrinsic_vtab): Ditto.
647 * decl.cc (attr_decl1): Manage update of symbol attributes from
649 * primary.cc (gfc_variable_attr): OPTIONAL shall not be taken or
650 updated from the class container.
651 * symbol.cc (free_old_symbol): Adjust management of symbol versions
652 to not prematurely free array specs while working on the declation
655 2023-03-01 Tobias Burnus <tobias@codesourcery.com>
658 * trans-openmp.cc (gfc_trans_omp_clauses): Fix mapping of
659 type(C_ptr) variables.
661 2023-02-27 Harald Anlauf <anlauf@gmx.de>
664 * trans-intrinsic.cc (gfc_conv_intrinsic_ibits): Handle corner case
665 LEN argument of IBITS equal to BITSIZE(I).
667 2023-02-25 Mikael Morin <mikael@gcc.gnu.org>
670 * intrinsic.cc (get_intrinsic_dummy_arg,
671 set_intrinsic_dummy_arg): Rename the former to the latter.
672 Remove the return value, add a reference to the lhs as argument,
673 and do the pointer assignment inside the function. Don't do
674 it if the pointer is already non-NULL.
675 (sort_actual): Update caller.
677 2023-02-25 Harald Anlauf <anlauf@gmx.de>
679 * arith.cc (gfc_real2int): Clear mpfr variable after use.
681 2023-02-25 Tobias Burnus <tobias@codesourcery.com>
684 * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Skip setting of
685 bounds of CFI desc for 'pointer,intent(out)'.
687 2023-02-24 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
689 * trans-decl.cc (gfc_finish_var_decl): Apply attribute.
690 (generate_local_decl): Add diagnostic for dummy and local variables.
692 2023-02-24 Mikael Morin <mikael@gcc.gnu.org>
695 * expr.cc (gfc_free_actual_arglist): Free associated_dummy
697 (gfc_copy_actual_arglist): Make a copy of the associated_dummy
698 field if it is set in the original element.
700 2023-02-24 Harald Anlauf <anlauf@gmx.de>
703 * frontend-passes.cc (do_subscript): Clear used gmp variable.
705 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
707 * invoke.texi: Reorder index entries around @items.
709 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
711 * invoke.texi: Reorder @opindex commands to precede @items they
714 2023-02-22 Harald Anlauf <anlauf@gmx.de>
717 * resolve.cc (resolve_component): The type of a CHARACTER length
718 expression must be INTEGER.
720 2023-02-21 Harald Anlauf <anlauf@gmx.de>
723 * parse.cc (check_function_result_typed): Improve type check of
724 specification expression for character length and return status.
725 (parse_spec): Use status from above.
726 * resolve.cc (resolve_fntype): Prevent use of invalid specification
727 expression for character length.
729 2023-02-16 Patrick Palka <ppalka@redhat.com>
731 * gfortran.h: Mechanically drop static from static inline
732 functions via s/^static inline/inline/g.
734 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
737 * frontend-passes.cc (do_intent): Catch NULL pointer dereference on
738 reference to invalid formal argument.
740 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
743 * resolve.cc (check_assumed_size_reference): Avoid NULL pointer
746 2023-02-15 Tobias Burnus <tobias@codesourcery.com>
749 * openmp.cc (gfc_resolve_omp_parallel_blocks): Handle combined 'loop'
751 (gfc_resolve_do_iterator): Set a source location for added
752 'private'-clause arguments.
753 * resolve.cc (gfc_resolve_code): Call gfc_resolve_omp_do_blocks
754 also for EXEC_OMP_LOOP and gfc_resolve_omp_parallel_blocks for
755 combined directives with loop + '{masked,master} taskloop (simd)'.
757 2023-02-13 Harald Anlauf <anlauf@gmx.de>
760 * primary.cc (gfc_expr_attr): Avoid NULL pointer dereference for
761 invalid use of CLASS variable.
763 2023-02-13 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
765 * decl.cc: Add EXT_ATTR_NOINLINE, EXT_ATTR_NORETURN, EXT_ATTR_WEAK.
766 * gfortran.h (ext_attr_id_t): Ditto.
767 * gfortran.texi (GCC$ ATTRIBUTES): Document them.
768 * trans-decl.cc (build_function_decl): Apply them.
770 2023-02-09 Harald Anlauf <anlauf@gmx.de>
771 Steven G. Kargl <kargl@gcc.gnu.org>
775 * intrinsic.cc (gfc_convert_chartype): Recover on invalid character
776 kind in conversion instead of generating an internal error.
778 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
781 * trans-openmp.cc (struct dovar_init_d): Add 'sym' and
782 'non_unit_incr' members.
783 (gfc_nonrect_loop_expr): New.
784 (gfc_trans_omp_do): Call it; use normal loop bounds
785 for unit stride - and only create local loop var.
787 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
789 * parse.cc (decode_omp_directive): Really ignore 'assumes' with
792 2023-02-08 Steve Kargl <kargl@gcc.gnu.org>
795 * resolve.cc (resolve_common_vars): Avoid NULL pointer dereference
796 when a symbol's location is not set.
798 2023-02-07 Harald Anlauf <anlauf@gmx.de>
801 * trans-decl.cc (gfc_finish_var_decl): With -fno-automatic, do not
802 make ASSOCIATE variables TREE_STATIC.
804 2023-02-05 Harald Anlauf <anlauf@gmx.de>
807 * arith.cc (gfc_arith_divide): Emit integer division truncation
808 warnings using gfc_warning instead of gfc_warning_now to prevent
811 2023-02-03 Jakub Jelinek <jakub@redhat.com>
814 * trans-decl.cc (gfc_trans_use_stmts): Call clear_slot before
817 2023-02-01 Harald Anlauf <anlauf@gmx.de>
820 * expr.cc (find_array_section): Add check to prevent interpreting an
821 mpz non-integer constant as an integer.
823 2023-02-01 Tobias Burnus <tobias@codesourcery.com>
825 * openmp.cc (resolve_omp_clauses): Check also for
828 2023-01-29 Mikael Morin <mikael@gcc.gnu.org>
831 * check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
832 (gfc_check_findloc): Ditto.
834 2023-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
837 * parse.cc (parse_module): Remove use of a bool error value
838 that prevented proper setting of the namespace pointer.
840 2023-01-28 Harald Anlauf <anlauf@gmx.de>
841 Steven G. Kargl <kargl@gcc.gnu.org>
844 * resolve.cc (compare_bound_int): Expression to compare must be of
846 (compare_bound_mpz_t): Likewise.
847 (check_dimension): Fix comment on checks applied to array section
848 and clean up associated logic.
850 2023-01-28 Harald Anlauf <anlauf@gmx.de>
853 * match.cc (gfc_match_common): A USE associated name shall not appear
854 in a COMMON block (F2018:C8121).
856 2023-01-27 Tobias Burnus <tobias@codesourcery.com>
859 * trans-openmp.cc (gfc_split_omp_clauses): Handle has_device_addr.
861 2023-01-26 Harald Anlauf <anlauf@gmx.de>
864 * resolve.cc (check_host_association): Extend host association check
865 so that it is not restricted to functions. Also prevent NULL pointer
868 2023-01-25 Steve Kargl <kargl@gcc.gnu.org>
871 * array.cc (compare_bounds): Return false instead of generating an
872 internal error on an invalid argument type.
874 2023-01-24 Harald Anlauf <anlauf@gmx.de>
877 * simplify.cc (simplify_transformation): Do not try to simplify
878 transformational intrinsic when the ARRAY argument has a NULL shape.
880 2023-01-23 Harald Anlauf <anlauf@gmx.de>
883 * dependency.cc (gfc_check_dependency): Prevent NULL pointer
884 dereference while recursively checking expressions.
886 2023-01-23 Harald Anlauf <anlauf@gmx.de>
889 * interface.cc (get_expr_storage_size): Check array subscript triplets
890 that we actually have integer values before trying to extract with
893 2023-01-23 Harald Anlauf <anlauf@gmx.de>
896 * iresolve.cc (check_charlen_present): Preserve character length if
897 there is no array constructor.
899 2023-01-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
902 * data.cc (gfc_assign_data_value): Remove check for PARAMETER in DATA.
903 * primary.cc (match_variable): Add check for PARAMETER in DATA.
905 2023-01-19 Harald Anlauf <anlauf@gmx.de>
908 * expr.cc (class_allocatable): Prevent NULL pointer dereference
910 (class_pointer): Likewise.
912 2023-01-17 Harald Anlauf <anlauf@gmx.de>
915 * interface.cc (get_expr_storage_size): Check that we actually have
916 an integer value before trying to extract it with mpz_get_si.
918 2023-01-12 Tobias Burnus <tobias@codesourcery.com>
921 * openmp.cc (gfc_resolve_omp_assumptions): Reject nonscalars.
923 2023-01-11 Jakub Jelinek <jakub@redhat.com>
926 * f95-lang.cc (gfc_init_builtin_function): Fix up function types
927 for BUILT_IN_REALLOC and BUILT_IN_SINCOS{F,,L}. Formatting fixes.
929 2023-01-10 Harald Anlauf <anlauf@gmx.de>
932 * frontend-passes.cc (do_subscript): Clear used gmp variables.
934 2023-01-02 Jakub Jelinek <jakub@redhat.com>
936 * gfortranspec.cc (lang_specific_driver): Update copyright notice
938 * gfc-internals.texi: Bump @copying's copyright year.
939 * gfortran.texi: Ditto.
940 * intrinsic.texi: Ditto.
941 * invoke.texi: Ditto.
944 Copyright (C) 2023 Free Software Foundation, Inc.
946 Copying and distribution of this file, with or without modification,
947 are permitted in any medium without royalty provided the copyright
948 notice and this notice are preserved.