1 2023-06-09 Jakub Jelinek <jakub@redhat.com>
4 * primary.cc (gfc_convert_to_structure_constructor): Only do
5 constant string ctor length verification and truncation/padding
6 if constant length has INTEGER type.
8 2023-06-08 Paul Thomas <pault@gcc.gnu.org>
14 * decl.cc (char_len_param_value): Simplify a copy of the expr
15 and replace the original if there is no error.
16 * gfortran.h : Remove the redundant field 'rankguessed' from
17 'gfc_association_list'.
18 * resolve.cc (resolve_assoc_var): Remove refs to 'rankguessed'.
19 (resolve_variable): Associate names with constant or structure
20 constructor targets cannot have array refs.
21 * trans-array.cc (gfc_conv_expr_descriptor): Guard expression
22 character length backend decl before using it. Suppress the
23 assignment if lhs equals rhs.
24 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
25 associate variables pointing to a variable. Add comment.
26 * trans-stmt.cc (trans_associate_var): Remove requirement that
27 the character length be deferred before assigning the value
28 returned by gfc_conv_expr_descriptor. Also, guard the backend
29 decl before testing with VAR_P.
31 2023-06-06 Kwok Cheung Yeung <kcy@codesourcery.com>
32 Tobias Burnus <tobias@codesourcery.com>
34 * dump-parse-tree.cc (show_omp_namelist): Display 'present' map
36 (show_omp_clauses): Display 'present' motion modifier for 'to'
38 * gfortran.h (enum gfc_omp_map_op): Add entries with 'present'
40 (struct gfc_omp_namelist): Add 'present_modifer'.
41 * openmp.cc (gfc_match_motion_var_list): New, handles optional
42 'present' modifier for to/from clauses.
43 (gfc_match_omp_clauses): Call it for to/from clauses; parse 'present'
44 in defaultmap and map clauses.
45 (resolve_omp_clauses): Allow 'present' modifiers on 'target',
46 'target data', 'target enter' and 'target exit' directives.
47 * trans-openmp.cc (gfc_trans_omp_clauses): Apply 'present' modifiers
48 to tree node for 'map', 'to' and 'from' clauses. Apply 'present' for
51 2023-06-02 Steve Kargl <kargl@gcc.gnu.org>
54 * resolve.cc (resolve_select_rank): Remove duplicate error.
55 (resolve_fl_var_and_proc): Prevent NULL pointer dereference and
56 suppress error message for temporary.
58 2023-06-02 Paul Thomas <pault@gcc.gnu.org>
61 * parse.cc (parse_associate): Replace the existing evaluation
62 of the target rank with calls to gfc_resolve_ref and
63 gfc_expression_rank. Identify untyped target function results
64 with structure constructors by finding the appropriate derived
66 * resolve.cc (resolve_symbol): Allow associate variables to be
69 2023-06-01 Harald Anlauf <anlauf@gmx.de>
72 * decl.cc (gfc_match_kind_spec): Use error path on missing right
74 (gfc_match_decl_type_spec): Use error return when an error occurred
75 during matching a KIND specifier.
77 2023-06-01 Tobias Burnus <tobias@codesourcery.com>
79 * parse.cc (decode_omp_directive): Accept all pure directives
80 inside a PURE procedures; handle 'error at(execution).
82 2023-05-26 Tobias Burnus <tobias@codesourcery.com>
84 * dump-parse-tree.cc (show_omp_namelist): Update allocator, fix
86 (show_omp_node, show_code_node): Handle EXEC_OMP_ALLOCATE.
87 * gfortran.h (enum gfc_statement): Add ST_OMP_ALLOCATE and ..._EXEC.
88 (enum gfc_exec_op): Add EXEC_OMP_ALLOCATE.
89 (struct gfc_omp_namelist): Add 'allocator' to 'u2' union.
90 (struct gfc_namespace): Add omp_allocate.
91 (gfc_resolve_omp_allocate): New.
92 * match.cc (gfc_free_omp_namelist): Free 'u2.allocator'.
93 * match.h (gfc_match_omp_allocate, gfc_match_omp_allocators): New.
94 * openmp.cc (gfc_omp_directives): Uncomment allocate/allocators.
95 (gfc_match_omp_variable_list): Add bool arg for
96 rejecting listening common-block vars separately.
97 (gfc_match_omp_clauses): Update for u2.allocators.
98 (OMP_ALLOCATORS_CLAUSES, gfc_match_omp_allocate,
99 gfc_match_omp_allocators, is_predefined_allocator,
100 gfc_resolve_omp_allocate): New.
101 (resolve_omp_clauses): Update 'allocate' clause checks.
102 (omp_code_to_statement, gfc_resolve_omp_directive): Handle
103 OMP ALLOCATE/ALLOCATORS.
104 * parse.cc (in_exec_part): New global var.
105 (check_omp_allocate_stmt, parse_openmp_allocate_block): New.
106 (decode_omp_directive, case_exec_markers, case_omp_decl,
107 gfc_ascii_statement, parse_omp_structured_block): Handle
108 OMP allocate/allocators.
109 (verify_st_order, parse_executable): Set in_exec_part.
110 * resolve.cc (gfc_resolve_blocks, resolve_codes): Handle
112 * st.cc (gfc_free_statement): Likewise.
113 * trans.cc (trans_code): Likewise.
114 * trans-openmp.cc (gfc_trans_omp_directive): Likewise.
115 (gfc_trans_omp_clauses, gfc_split_omp_clauses): Update for
116 u2.allocator, fix for u.align.
118 2023-05-24 Harald Anlauf <anlauf@gmx.de>
121 * simplify.cc (simplify_size): Reject DIM argument of intrinsic SIZE
122 with error when out of valid range.
124 2023-05-24 Harald Anlauf <anlauf@gmx.de>
127 * check.cc (gfc_check_reshape): Expand constant arguments SHAPE and
128 ORDER before checking.
129 * gfortran.h (gfc_is_constant_array_expr): Add prototype.
130 * iresolve.cc (gfc_resolve_reshape): Expand constant argument SHAPE.
131 * simplify.cc (is_constant_array_expr): If array is determined to be
132 constant, expand small array constructors if needed.
133 (gfc_is_constant_array_expr): Wrapper for is_constant_array_expr.
134 (gfc_simplify_reshape): Fix check for insufficient elements in SOURCE
135 when no padding specified.
137 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
140 * resolve.cc (gfc_resolve_ref): Conversion of array_ref into an
141 element should be done for all characters without a len expr,
142 not just deferred lens, and for integer expressions.
143 * trans-expr.cc (conv_inquiry): For len and kind inquiry refs,
144 set the se string_length to NULL_TREE.
146 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
147 Steven G. Kargl <kargl@gcc.gnu.org>
150 * decl.cc (variable_decl): Clean up white space issues.
151 (gfc_match_final_decl): Declaration of finalizable derived type
152 is allowed in a submodule.
154 2023-05-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
156 * expr.cc (gfc_get_corank): Use CLASS_DATA from gfortran.h.
157 * resolve.cc (resolve_component): Same.
158 (resolve_fl_derived0): Same.
159 * simplify.cc (gfc_simplify_extends_type_of): Same.
160 (simplify_cobound): Same.
162 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
164 * trans-array.cc (is_pointer_array): Use _P() defines from tree.h.
165 (gfc_conv_scalarized_array_ref): Ditto.
166 (gfc_conv_array_ref): Ditto.
167 * trans-decl.cc (gfc_finish_decl): Ditto.
168 (gfc_get_symbol_decl): Ditto.
169 * trans-expr.cc (gfc_trans_pointer_assignment): Ditto.
170 (gfc_trans_arrayfunc_assign): Ditto.
171 (gfc_trans_assignment_1): Ditto.
172 * trans-intrinsic.cc (gfc_conv_intrinsic_minmax): Ditto.
173 (conv_intrinsic_ieee_value): Ditto.
174 * trans-io.cc (gfc_convert_array_to_string): Ditto.
175 * trans-openmp.cc (gfc_omp_is_optional_argument): Ditto.
176 (gfc_trans_omp_clauses): Ditto.
177 * trans-stmt.cc (gfc_conv_label_variable): Ditto.
178 * trans.cc (gfc_build_addr_expr): Ditto.
179 (get_array_span): Ditto.
181 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
184 * array.cc (compare_bounds): Use narrower return type.
185 (gfc_compare_array_spec): Likewise.
186 (is_constant_element): Likewise.
187 (gfc_constant_ac): Likewise.
188 * check.cc (dim_rank_check): Likewise.
189 * cpp.cc (gfc_cpp_init_options): Likewise.
190 (dump_macro): Likewise.
191 * cpp.h (gfc_cpp_handle_option): Likewise.
192 * dependency.cc (gfc_ref_needs_temporary_p): Likewise.
193 (gfc_check_argument_dependency): Likewise.
194 (gfc_check_fncall_dependency): Likewise.
195 (ref_same_as_full_array): Likewise.
196 * dependency.h (gfc_check_fncall_dependency): Likewise.
197 (gfc_dep_resolver): Likewise.
198 (gfc_are_equivalenced_arrays): Likewise.
199 * expr.cc (gfc_copy_ref): Likewise.
200 (gfc_kind_max): Likewise.
201 (numeric_type): Likewise.
202 * gfortran.h (gfc_at_end): Likewise.
203 (gfc_at_eof): Likewise.
204 (gfc_at_bol): Likewise.
205 (gfc_at_eol): Likewise.
206 (gfc_define_undef_line): Likewise.
207 (gfc_wide_is_printable): Likewise.
208 (gfc_wide_is_digit): Likewise.
209 (gfc_wide_fits_in_byte): Likewise.
210 (gfc_find_sym_tree): Likewise.
211 (gfc_generic_intrinsic): Likewise.
212 (gfc_specific_intrinsic): Likewise.
213 (gfc_intrinsic_actual_ok): Likewise.
214 (gfc_has_vector_index): Likewise.
215 (gfc_numeric_ts): Likewise.
216 (gfc_impure_variable): Likewise.
217 (gfc_pure): Likewise.
218 (gfc_implicit_pure): Likewise.
219 (gfc_elemental): Likewise.
220 (gfc_pure_function): Likewise.
221 (gfc_implicit_pure_function): Likewise.
222 (gfc_compare_array_spec): Likewise.
223 (gfc_constant_ac): Likewise.
224 (gfc_expanded_ac): Likewise.
225 (gfc_check_digit): Likewise.
226 * intrinsic.cc (gfc_find_subroutine): Likewise.
227 (gfc_generic_intrinsic): Likewise.
228 (gfc_specific_intrinsic): Likewise.
229 * io.cc (compare_to_allowed_values): Likewise. And remove
230 unneeded forward declaration.
231 * parse.cc: Likewise.
232 * parse.h (gfc_check_do_variable): Likewise.
233 * primary.cc (gfc_check_digit): Likewise.
234 * resolve.cc (resolve_structure_cons): Likewise.
235 (pure_stmt_function): Likewise.
236 (gfc_pure_function): Likewise.
237 (impure_stmt_fcn): Likewise.
238 (resolve_forall_iterators): Likewise.
239 (resolve_data): Likewise.
240 (gfc_impure_variable): Likewise.
241 (gfc_pure): Likewise.
242 (gfc_unset_implicit_pure): Likewise.
243 * scanner.cc (wide_is_ascii): Likewise.
244 (gfc_wide_toupper): Likewise.
245 (gfc_open_included_file): Likewise.
246 (gfc_at_end): Likewise.
247 (gfc_at_eof): Likewise.
248 (gfc_at_bol): Likewise.
249 (skip_comment_line): Likewise.
250 (gfc_gobble_whitespace): Likewise.
251 * symbol.cc (gfc_find_symtree_in_proc): Likewise.
252 * trans-array.cc: Likewise.
253 * trans-decl.cc (gfc_set_decl_assembler_name): Likewise.
254 * trans-types.cc (gfc_get_element_type): Likewise.
255 (gfc_add_field_to_struct): Likewise.
256 * trans-types.h (gfc_copy_dt_decls_ifequal): Likewise.
257 (gfc_return_by_reference): Likewise.
258 (gfc_is_nodesc_array): Likewise.
259 * trans.h (gfc_can_put_var_on_stack): Likewise.
261 2023-05-17 Harald Anlauf <anlauf@gmx.de>
265 * decl.cc (add_init_expr_to_sym): Set shape of initializer also for
266 zero-sized arrays, so that bounds violations can be detected later.
268 2023-05-17 Tobias Burnus <tobias@codesourcery.com>
270 * trans-decl.cc (gfc_get_symbol_decl): Add attributes
271 such as 'declare target' also to hidden artificial
272 variable for deferred-length character variables.
273 * trans-openmp.cc (gfc_trans_omp_array_section,
274 gfc_trans_omp_clauses, gfc_trans_omp_target_exit_data):
275 Improve mapping of array descriptors and deferred-length
278 2023-05-16 Paul Thomas <pault@gcc.gnu.org>
286 * interface.cc (gfc_compare_actual_formal): Emit an error if an
287 unlimited polymorphic actual is not matched either to an
288 unlimited or assumed type formal argument.
289 * resolve.cc (resolve_ordinary_assign): Emit an error if the
290 var expression of an ordinary assignment is a proc pointer
292 * trans-array.cc (gfc_walk_array_ref): Provide assumed shape
293 arrays coming from interface mapping with a viable arrayspec.
294 * trans-expr.cc (gfc_conv_intrinsic_to_class): Tidy up flagging
295 of unlimited polymorphic 'class_ts'.
296 (gfc_conv_gfc_desc_to_cfi_desc): Assumed type is unlimited
297 polymorphic and should accept any actual type.
298 (gfc_conv_procedure_call): Replace dreadful kludge with a call
299 to gfc_finalize_tree_expr. Avoid dereferencing a void pointer
300 by giving it the pointer type of the actual argument.
301 (alloc_scalar_allocatable_subcomponent): Shorten the function
302 name and replace the symbol argument with the se string length.
303 If a deferred length character length is either not present or
304 is not a variable, give the typespec a variable and assign the
305 string length to that. Use gfc_deferred_strlen to find the
306 hidden string length component.
307 (gfc_trans_subcomponent_assign): Convert the expression before
308 the call to alloc_scalar_allocatable_subcomponent so that a
309 good string length is provided.
310 (gfc_trans_structure_assign): Remove the unneeded derived type
311 symbol from calls to gfc_trans_subcomponent_assign.
313 2023-05-15 Harald Anlauf <anlauf@gmx.de>
316 * expr.cc (gfc_check_vardef_context): Check appropriate pointer
317 attribute for CLASS vs. non-CLASS function result in variable
320 2023-05-11 Xi Ruoyao <xry111@xry111.site>
322 * Make-lang.in: Use grep instead of fgrep.
324 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
326 * dump-parse-tree.cc (gfc_debug_expr): Remove forward declaration.
327 (debug): Add DEBUG_FUNCTION.
328 (show_code_node): Remove erroneous whitespace.
330 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
333 * dump-parse-tree.cc (debug): New function for gfc_namespace.
334 (gfc_debug_code): Delete forward declaration.
335 (show_attr): Make sure to print balanced braces.
337 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
339 * resolve.cc (resolve_select_type): Fix coding style.
341 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
343 * resolve.cc (resolve_select_type): Call free() unconditionally.
345 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
348 * expr.cc (find_array_section): Fix mpz memory leak.
349 * simplify.cc (gfc_simplify_reshape): Fix mpz memory leaks in
352 2023-05-05 Harald Anlauf <anlauf@gmx.de>
355 * arith.cc (eval_intrinsic): Check conformability of ranks of operands
356 for intrinsic binary operators before performing type conversions.
357 * gfortran.h (gfc_op_rank_conformable): Add prototype.
358 * resolve.cc (resolve_operator): Check conformability of ranks of
359 operands for intrinsic binary operators before performing type
361 (gfc_op_rank_conformable): New helper function to compare ranks of
362 operands of binary operator.
364 2023-05-04 Julian Brown <julian@codesourcery.com>
367 * openmp.cc (resolve_omp_clauses): Add diagnostic for
368 non-pointer/non-allocatable attach/detach.
369 * trans-openmp.cc (gfc_trans_omp_clauses): Remove dereference for
370 pointer-to-scalar derived type component attach/detach. Fix
371 attach/detach handling for descriptors.
373 2023-04-28 Julian Brown <julian@codesourcery.com>
376 * trans-openmp.cc (gfc_trans_omp_clauses): Attach/detach clause fixes.
378 2023-04-28 Tobias Burnus <tobias@codesourcery.com>
380 * gfortran.texi: Fix typos.
381 * decl.cc: Fix typos in comments and in a variable name.
382 * arith.cc: Fix comment typos.
383 * check.cc: Likewise.
384 * class.cc: Likewise.
385 * dependency.cc: Likewise.
387 * frontend-passes.cc: Likewise.
388 * gfortran.h: Likewise.
389 * intrinsic.cc: Likewise.
390 * iresolve.cc: Likewise.
391 * match.cc: Likewise.
392 * module.cc: Likewise.
393 * primary.cc: Likewise.
394 * resolve.cc: Likewise.
395 * simplify.cc: Likewise.
396 * trans-array.cc: Likewise.
397 * trans-decl.cc: Likewise.
398 * trans-expr.cc: Likewise.
399 * trans-intrinsic.cc: Likewise.
400 * trans-openmp.cc: Likewise.
401 * trans-stmt.cc: Likewise.
403 2023-04-25 Tobias Burnus <tobias@codesourcery.com>
405 * openmp.cc (gfc_resolve_omp_do_blocks): Handle zero
406 or more than one exec statements before/after 'omp scan'.
407 * trans-openmp.cc (gfc_trans_omp_do): Likewise.
409 2023-04-22 Harald Anlauf <anlauf@gmx.de>
410 Steven G. Kargl <kargl@gcc.gnu.org>
413 * interface.cc (gfc_compare_actual_formal): Reject allocatable
414 functions being used as actual argument for allocable dummy.
416 2023-04-14 Harald Anlauf <anlauf@gmx.de>
419 * simplify.cc (gfc_simplify_set_exponent): Fix implementation of
420 compile-time simplification of intrinsic SET_EXPONENT for argument
423 2023-04-14 Paul Thomas <pault@gcc.gnu.org>
426 * gfortran.h : Add expr3_not_explicit bit field to gfc_code.
427 * resolve.cc (resolve_allocate_expr): Set bit field when the
428 default initializer is applied to expr3.
429 * trans-stmt.cc (gfc_trans_allocate): If expr3_not_explicit is
430 set, do not deallocate expr3.
432 2023-04-13 Harald Anlauf <anlauf@gmx.de>
435 * trans-expr.cc (gfc_conv_power_op): Use absu_hwi and
436 unsigned HOST_WIDE_INT for portability.
438 2023-04-12 Harald Anlauf <anlauf@gmx.de>
441 * resolve.cc (resolve_entries): Handle functions with ENTRY and
443 * trans-expr.cc (gfc_conv_procedure_call): Functions with a result
444 with the POINTER or ALLOCATABLE attribute shall not get any special
445 treatment with -ff2c, as they cannot be written in Fortran 77.
446 * trans-types.cc (gfc_return_by_reference): Likewise.
447 (gfc_get_function_type): Likewise.
449 2023-04-12 Harald Anlauf <anlauf@gmx.de>
453 * interface.cc (compare_parameter): Enable type and rank checks for
454 arguments of derived type from the intrinsic module ISO_C_BINDING.
456 2023-04-08 Paul Thomas <pault@gcc.gnu.org>
459 * iresolve.cc (gfc_resolve_adjustl, gfc_resolve_adjustr): if
460 string length is deferred use the string typespec for result.
461 * resolve.cc (resolve_assoc_var): Handle parentheses around the
463 (resolve_block_construct): Remove unnecessary static decls.
464 * trans-array.cc (gfc_conv_expr_descriptor): Guard string len
465 expression in condition. Improve handling of string length and
466 span, especially for substrings of the descriptor.
467 (duplicate_allocatable): Make element type more explicit with
469 * trans-decl.cc (gfc_get_symbol_decl): Emit a fatal error with
470 appropriate message instead of ICE if symbol type is unknown.
471 (gfc_generate_function_code): Set current locus to proc_sym
473 * trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in
474 'previous' and use if end expression in substring reference is
476 (gfc_conv_string_length): Use gfc_conv_expr_descriptor if
477 'expr_flat' is an array. Add post block to catch deallocation
479 (gfc_conv_procedure_call): Assign the parmse string length to
480 the expression string length, if it is deferred.
481 (gfc_trans_alloc_subarray_assign): If this is a deferred string
482 length component, store the string length in the hidden comp.
483 Update the typespec length accordingly. Generate a new type
484 spec for the call to gfc_duplicate-allocatable in this case.
485 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
486 deferred character array components.
488 2023-04-04 Harald Anlauf <anlauf@gmx.de>
491 * expr.cc (check_restricted): Adjust check for valid variables in
492 restricted expressions: make no exception for module variables.
494 2023-04-01 Thomas Koenig <tkoenig@gcc.gnu.org>
496 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
497 type name to be "long long".
499 2023-03-30 Andrew Pinski <apinski@marvell.com>
501 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
502 type name to be "long long". Add a comment on why adding
505 2023-03-28 Jakub Jelinek <jakub@redhat.com>
508 * openmp.cc (gfc_omp_absent_contains_clause): Fix typo in diagnostics
509 - composit -> composite.
511 2023-03-25 Harald Anlauf <anlauf@gmx.de>
514 * trans-decl.cc (gfc_conv_cfi_to_gfc): Remove dead code.
516 2023-03-24 Harald Anlauf <anlauf@gmx.de>
518 * expr.cc (free_expr0): Free also BOZ strings as part of an expression.
520 2023-03-24 Haochen Gui <guihaoc@gcc.gnu.org>
521 Tobias Burnus <tobias@codesourcery.com>
524 * target-memory.cc (gfc_interpret_float): Return FAIL when
525 native_interpret_expr gets a NULL tree.
526 * arith.cc (gfc_hollerith2real): Return NULL when
527 gfc_interpret_float fails.
528 * error.cc (gfc_buffered_p): Define.
529 * gfortran.h (gfc_buffered_p): Declare.
530 * intrinsic.cc: Add diagnostic.h to include list.
531 (do_simplify): Save errorcount and check it at finish. Report a
532 "Cannot simplify expression" error on a bad result if error count
533 doesn't change and no other errors buffered.
535 2023-03-22 Harald Anlauf <anlauf@gmx.de>
536 Steven G. Kargl <kargl@gcc.gnu.org>
539 * resolve.cc (gfc_resolve_finalizers): Argument of a FINAL subroutine
540 cannot be an alternate return.
542 2023-03-21 Harald Anlauf <anlauf@gmx.de>
545 * decl.cc (gfc_match_modproc): Reject MODULE PROCEDURE if not in a
546 generic module interface.
548 2023-03-21 Arsen Arsenović <arsen@aarsen.me>
550 * invoke.texi: Remove usages of @gol.
551 * intrinsic.texi: Ditto.
553 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
556 * trans-array.cc (gfc_trans_array_constructor_value): Correct
557 incorrect setting of typespec.
559 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
562 * resolve.cc (generate_component_assignments): Restore the
563 exclusion of allocatable components from the loop.
565 2023-03-20 Harald Anlauf <anlauf@gmx.de>
568 * invoke.texi: Correct documentation of how underscores are appended
571 2023-03-20 Harald Anlauf <anlauf@gmx.de>
574 * simplify.cc (gfc_simplify_nearest): Fix off-by-one error in setting
575 up real kind-specific maximum exponent for mpfr.
577 2023-03-20 Paul Thomas <pault@gcc.gnu.org>
580 * resolve.cc (check_host_association): If an external function
581 is typed but not declared explicitly to be external, change the
582 old symbol from a variable to an external function.
584 2023-03-19 Harald Anlauf <anlauf@gmx.de>
587 * resolve.cc (resolve_fl_procedure): Check for an explicit interface
588 of procedures with the BIND(C) attribute (F2018:15.4.2.2).
590 2023-03-19 Thomas Koenig <tkoenig@gcc.gnu.org>
592 * gfortran.texi: Mention behavior on overflow.
594 2023-03-18 Paul Thomas <pault@gcc.gnu.org>
599 * class.cc (finalize_component): Include the missing arguments
600 in the call to the component's finalizer wrapper.
601 (has_finalizer_component): Do not return true for procedure
603 (finalizer_insert_packed_call): Remove the redundant argument
604 in the call to the final subroutine.
605 (generate_finalization_wrapper): Add support for assumed rank
607 (gfc_may_be_finalized): New helper function.
608 * dump-parse-tree.cc (write_proc): Whitespace.
609 * gfortran.h : Add prototype for gfc_may_be_finalized.
610 * resolve.cc (resolve_function): Correct derived types that
611 have an incomplete namespace.
612 (resolve_where, gfc_resolve_where_code_in_forall,
613 gfc_resolve_forall_body, gfc_resolve_code): Check that the op
614 code is still EXEC_ASSIGN. If it is set lhs to must finalize.
615 (is_finalizable_type): New function.
616 (generate_component_assignments): Set must_finalize if needed.
617 (gfc_resolve_finalizers): Error if assumed rank finalizer is
618 not the only one. Warning on lack of scalar finalizer modified
619 to account for assumed rank finalizers.
620 (generate_final_call): New function.
621 (generate_component_assignments): Enclose the outermost call in
622 a block to capture automatic deallocation and final calls.
623 Set must_finalize as required to satisfy the standards. Use an
624 explicit pointer assignment for pointer components to capture
625 finalization of the target. Likewise use explicit assignment
626 for allocatable components. Do not use the temporary copy of
627 the lhs in defined assignment if the component is allocatable.
628 Put the temporary in the same namespace as the lhs symbol if
629 the component may be finalized. Remove the leading assignment
630 from the expansion of assignment of components that have their
631 own defined assignment components. Suppress finalization of
632 assignment of temporary components to the lhs. Make an explicit
633 final call for the rhs function temporary if it exists.
634 (gfc_resolve_code): Set must_finalize for assignments with an
635 array constructor on the rhs.
636 (gfc_resolve_finalizers): Ensure that an assumed rank finalizer
637 is the only finalizer for that type and correct the surprising
638 warning for the lack of a scalar finalizer.
639 (check_defined_assignments): Handle allocatable components.
640 (resolve_fl_derived): Set referenced the vtab for use
642 (resolve_symbol): Set referenced an unreferenced symbol that
644 * trans-array.cc (gfc_trans_array_constructor_value): Add code
645 to finalize the constructor result. Warn that this feature was
646 removed in F2018 and that it is suppressed by -std=2018.
647 (trans_array_constructor): Add finalblock, pass to previous
648 and apply to loop->post if filled.
649 (gfc_add_loop_ss_code): Add se finalblock to outer loop post.
650 (gfc_trans_array_cobounds, gfc_trans_array_bounds): Add any
651 generated finalization code to the main block.
652 (structure_alloc_comps): Add boolean argument to suppress
653 finalization and use it for calls from
654 gfc_deallocate_alloc_comp_no_caf. Otherwise it defaults to
656 (gfc_copy_alloc_comp_no_fini): New wrapper for
657 structure_alloc_comps.
658 (gfc_alloc_allocatable_for_assignment): Suppress finalization
659 by setting new arg in call to gfc_deallocate_alloc_comp_no_caf.
660 (gfc_trans_deferred_array): Use gfc_may_be_finalized and do not
661 deallocate the components of entities with a leading '_' in the
662 name that are also marked as artificial.
663 * trans-array.h : Add the new boolean argument to the prototype
664 of gfc_deallocate_alloc_comp_no_caf with a default of false.
665 Add prototype for gfc_copy_alloc_comp_no_fini.
666 * trans-decl.cc(init_intent_out_dt): Tidy up the code.
667 * trans-expr.cc (gfc_init_se): Initialize finalblock.
668 (gfc_conv_procedure_call): Use gfc_finalize_tree_expr to
669 finalize function results. Replace in-line block for class
670 results with call to new function.
671 (gfc_conv_expr): Finalize structure constructors for F2003 and
672 F2008. Warn that this feature was deleted in F2018 and, unlike
673 array constructors, is not default. Add array constructor
674 finalblock to the post block.
675 (gfc_trans_scalar_assign): Suppress finalization by setting new
676 argument in call to gfc_deallocate_alloc_comp_no_caf. Add the
677 finalization blocks to the main block.
678 (gfc_trans_arrayfunc_assign): Use gfc_assignment_finalizer_call
679 and ensure that finalization occurs after the evaluation of the
680 rhs but using the initial value for the lhs. Finalize rhs
681 function results using gfc_finalize_tree_expr.
682 (trans_class_assignment, gfc_trans_assignment_1): As previous
683 function, taking care to order evaluation, assignment and
684 finalization correctly.
685 * trans-io.cc (gfc_trans_transfer): Add the final block.
686 * trans-stmt.cc (gfc_trans_call, gfc_trans_allocate): likewise.
687 (trans_associate_var): Nullify derived allocatable components
688 and finalize function targets with defined assignment
689 components on leaving the block scope.
690 (trans_allocate): Finalize source expressions, if required,
691 and set init_expr artificial temporarily to suppress the
692 finalization in gfc_trans_assignment.
693 * trans.cc (gfc_add_finalizer_call): Do not finalize the
694 temporaries generated in type assignment with defined
695 assignment components.
696 (gfc_assignment_finalizer_call): New function.
697 (gfc_finalize_tree_expr): New function.
698 * trans.h: Add finalblock to gfc_se. Add the prototypes for
699 gfc_finalize_tree_expr and gfc_assignment_finalizer_call.
701 2023-03-15 Harald Anlauf <anlauf@gmx.de>
702 Tobias Burnus <tobias@codesourcery.com>
705 * interface.cc (compare_parameter): Adjust check of array dummy
706 arguments to handle the case of CLASS variables.
708 2023-03-11 Harald Anlauf <anlauf@gmx.de>
711 * trans-expr.cc (gfc_copy_class_to_class): Convert element counts in
712 bounds check to common type for comparison.
714 2023-03-10 Harald Anlauf <anlauf@gmx.de>
717 * resolve.cc (resolve_symbol): Avoid NULL pointer dereference while
718 checking a symbol with the BIND(C) attribute.
720 2023-03-05 Harald Anlauf <anlauf@gmx.de>
721 Tobias Burnus <tobias@codesourcery.com>
724 * class.cc (gfc_build_class_symbol): Handle update of attributes of
725 existing class container.
726 (gfc_find_derived_vtab): Fix several memory leaks.
727 (find_intrinsic_vtab): Ditto.
728 * decl.cc (attr_decl1): Manage update of symbol attributes from
730 * primary.cc (gfc_variable_attr): OPTIONAL shall not be taken or
731 updated from the class container.
732 * symbol.cc (free_old_symbol): Adjust management of symbol versions
733 to not prematurely free array specs while working on the declation
736 2023-03-01 Tobias Burnus <tobias@codesourcery.com>
739 * trans-openmp.cc (gfc_trans_omp_clauses): Fix mapping of
740 type(C_ptr) variables.
742 2023-02-27 Harald Anlauf <anlauf@gmx.de>
745 * trans-intrinsic.cc (gfc_conv_intrinsic_ibits): Handle corner case
746 LEN argument of IBITS equal to BITSIZE(I).
748 2023-02-25 Mikael Morin <mikael@gcc.gnu.org>
751 * intrinsic.cc (get_intrinsic_dummy_arg,
752 set_intrinsic_dummy_arg): Rename the former to the latter.
753 Remove the return value, add a reference to the lhs as argument,
754 and do the pointer assignment inside the function. Don't do
755 it if the pointer is already non-NULL.
756 (sort_actual): Update caller.
758 2023-02-25 Harald Anlauf <anlauf@gmx.de>
760 * arith.cc (gfc_real2int): Clear mpfr variable after use.
762 2023-02-25 Tobias Burnus <tobias@codesourcery.com>
765 * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Skip setting of
766 bounds of CFI desc for 'pointer,intent(out)'.
768 2023-02-24 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
770 * trans-decl.cc (gfc_finish_var_decl): Apply attribute.
771 (generate_local_decl): Add diagnostic for dummy and local variables.
773 2023-02-24 Mikael Morin <mikael@gcc.gnu.org>
776 * expr.cc (gfc_free_actual_arglist): Free associated_dummy
778 (gfc_copy_actual_arglist): Make a copy of the associated_dummy
779 field if it is set in the original element.
781 2023-02-24 Harald Anlauf <anlauf@gmx.de>
784 * frontend-passes.cc (do_subscript): Clear used gmp variable.
786 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
788 * invoke.texi: Reorder index entries around @items.
790 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
792 * invoke.texi: Reorder @opindex commands to precede @items they
795 2023-02-22 Harald Anlauf <anlauf@gmx.de>
798 * resolve.cc (resolve_component): The type of a CHARACTER length
799 expression must be INTEGER.
801 2023-02-21 Harald Anlauf <anlauf@gmx.de>
804 * parse.cc (check_function_result_typed): Improve type check of
805 specification expression for character length and return status.
806 (parse_spec): Use status from above.
807 * resolve.cc (resolve_fntype): Prevent use of invalid specification
808 expression for character length.
810 2023-02-16 Patrick Palka <ppalka@redhat.com>
812 * gfortran.h: Mechanically drop static from static inline
813 functions via s/^static inline/inline/g.
815 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
818 * frontend-passes.cc (do_intent): Catch NULL pointer dereference on
819 reference to invalid formal argument.
821 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
824 * resolve.cc (check_assumed_size_reference): Avoid NULL pointer
827 2023-02-15 Tobias Burnus <tobias@codesourcery.com>
830 * openmp.cc (gfc_resolve_omp_parallel_blocks): Handle combined 'loop'
832 (gfc_resolve_do_iterator): Set a source location for added
833 'private'-clause arguments.
834 * resolve.cc (gfc_resolve_code): Call gfc_resolve_omp_do_blocks
835 also for EXEC_OMP_LOOP and gfc_resolve_omp_parallel_blocks for
836 combined directives with loop + '{masked,master} taskloop (simd)'.
838 2023-02-13 Harald Anlauf <anlauf@gmx.de>
841 * primary.cc (gfc_expr_attr): Avoid NULL pointer dereference for
842 invalid use of CLASS variable.
844 2023-02-13 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
846 * decl.cc: Add EXT_ATTR_NOINLINE, EXT_ATTR_NORETURN, EXT_ATTR_WEAK.
847 * gfortran.h (ext_attr_id_t): Ditto.
848 * gfortran.texi (GCC$ ATTRIBUTES): Document them.
849 * trans-decl.cc (build_function_decl): Apply them.
851 2023-02-09 Harald Anlauf <anlauf@gmx.de>
852 Steven G. Kargl <kargl@gcc.gnu.org>
856 * intrinsic.cc (gfc_convert_chartype): Recover on invalid character
857 kind in conversion instead of generating an internal error.
859 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
862 * trans-openmp.cc (struct dovar_init_d): Add 'sym' and
863 'non_unit_incr' members.
864 (gfc_nonrect_loop_expr): New.
865 (gfc_trans_omp_do): Call it; use normal loop bounds
866 for unit stride - and only create local loop var.
868 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
870 * parse.cc (decode_omp_directive): Really ignore 'assumes' with
873 2023-02-08 Steve Kargl <kargl@gcc.gnu.org>
876 * resolve.cc (resolve_common_vars): Avoid NULL pointer dereference
877 when a symbol's location is not set.
879 2023-02-07 Harald Anlauf <anlauf@gmx.de>
882 * trans-decl.cc (gfc_finish_var_decl): With -fno-automatic, do not
883 make ASSOCIATE variables TREE_STATIC.
885 2023-02-05 Harald Anlauf <anlauf@gmx.de>
888 * arith.cc (gfc_arith_divide): Emit integer division truncation
889 warnings using gfc_warning instead of gfc_warning_now to prevent
892 2023-02-03 Jakub Jelinek <jakub@redhat.com>
895 * trans-decl.cc (gfc_trans_use_stmts): Call clear_slot before
898 2023-02-01 Harald Anlauf <anlauf@gmx.de>
901 * expr.cc (find_array_section): Add check to prevent interpreting an
902 mpz non-integer constant as an integer.
904 2023-02-01 Tobias Burnus <tobias@codesourcery.com>
906 * openmp.cc (resolve_omp_clauses): Check also for
909 2023-01-29 Mikael Morin <mikael@gcc.gnu.org>
912 * check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
913 (gfc_check_findloc): Ditto.
915 2023-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
918 * parse.cc (parse_module): Remove use of a bool error value
919 that prevented proper setting of the namespace pointer.
921 2023-01-28 Harald Anlauf <anlauf@gmx.de>
922 Steven G. Kargl <kargl@gcc.gnu.org>
925 * resolve.cc (compare_bound_int): Expression to compare must be of
927 (compare_bound_mpz_t): Likewise.
928 (check_dimension): Fix comment on checks applied to array section
929 and clean up associated logic.
931 2023-01-28 Harald Anlauf <anlauf@gmx.de>
934 * match.cc (gfc_match_common): A USE associated name shall not appear
935 in a COMMON block (F2018:C8121).
937 2023-01-27 Tobias Burnus <tobias@codesourcery.com>
940 * trans-openmp.cc (gfc_split_omp_clauses): Handle has_device_addr.
942 2023-01-26 Harald Anlauf <anlauf@gmx.de>
945 * resolve.cc (check_host_association): Extend host association check
946 so that it is not restricted to functions. Also prevent NULL pointer
949 2023-01-25 Steve Kargl <kargl@gcc.gnu.org>
952 * array.cc (compare_bounds): Return false instead of generating an
953 internal error on an invalid argument type.
955 2023-01-24 Harald Anlauf <anlauf@gmx.de>
958 * simplify.cc (simplify_transformation): Do not try to simplify
959 transformational intrinsic when the ARRAY argument has a NULL shape.
961 2023-01-23 Harald Anlauf <anlauf@gmx.de>
964 * dependency.cc (gfc_check_dependency): Prevent NULL pointer
965 dereference while recursively checking expressions.
967 2023-01-23 Harald Anlauf <anlauf@gmx.de>
970 * interface.cc (get_expr_storage_size): Check array subscript triplets
971 that we actually have integer values before trying to extract with
974 2023-01-23 Harald Anlauf <anlauf@gmx.de>
977 * iresolve.cc (check_charlen_present): Preserve character length if
978 there is no array constructor.
980 2023-01-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
983 * data.cc (gfc_assign_data_value): Remove check for PARAMETER in DATA.
984 * primary.cc (match_variable): Add check for PARAMETER in DATA.
986 2023-01-19 Harald Anlauf <anlauf@gmx.de>
989 * expr.cc (class_allocatable): Prevent NULL pointer dereference
991 (class_pointer): Likewise.
993 2023-01-17 Harald Anlauf <anlauf@gmx.de>
996 * interface.cc (get_expr_storage_size): Check that we actually have
997 an integer value before trying to extract it with mpz_get_si.
999 2023-01-12 Tobias Burnus <tobias@codesourcery.com>
1002 * openmp.cc (gfc_resolve_omp_assumptions): Reject nonscalars.
1004 2023-01-11 Jakub Jelinek <jakub@redhat.com>
1007 * f95-lang.cc (gfc_init_builtin_function): Fix up function types
1008 for BUILT_IN_REALLOC and BUILT_IN_SINCOS{F,,L}. Formatting fixes.
1010 2023-01-10 Harald Anlauf <anlauf@gmx.de>
1013 * frontend-passes.cc (do_subscript): Clear used gmp variables.
1015 2023-01-02 Jakub Jelinek <jakub@redhat.com>
1017 * gfortranspec.cc (lang_specific_driver): Update copyright notice
1019 * gfc-internals.texi: Bump @copying's copyright year.
1020 * gfortran.texi: Ditto.
1021 * intrinsic.texi: Ditto.
1022 * invoke.texi: Ditto.
1025 Copyright (C) 2023 Free Software Foundation, Inc.
1027 Copying and distribution of this file, with or without modification,
1028 are permitted in any medium without royalty provided the copyright
1029 notice and this notice are preserved.