1 2023-06-20 Tobias Burnus <tobias@codesourcery.com>
3 * dump-parse-tree.cc (show_omp_namelist): Fix dump of the allocator
4 modifier of OMP_LIST_ALLOCATE.
6 2023-06-20 Tobias Burnus <tobias@codesourcery.com>
8 * match.cc (gfc_match_char): Match with '%S' a symbol
11 2023-06-19 Tobias Burnus <tobias@codesourcery.com>
13 * intrinsic.texi (OpenMP Modules OMP_LIB and OMP_LIB_KINDS): Also
14 add references to the OpenMP 5.1 and 5.2 spec; add omp_initial_device
15 and omp_invalid_device named constants.
17 2023-06-13 Harald Anlauf <anlauf@gmx.de>
18 Mikael Morin <mikael@gcc.gnu.org>
21 * trans-array.cc (gfc_trans_allocate_array_storage): When passing a
22 zero-sized array with fixed (= non-dynamic) size, allocate temporary
23 by the caller, not by the callee.
25 2023-06-10 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
27 * f95-lang.cc (gfc_init_builtin_functions): Add fmax() and
28 fmin() built-ins, and their variants.
29 * mathbuiltins.def: Add FMAX and FMIN built-ins.
30 * trans-intrinsic.cc (conv_intrinsic_ieee_minmax): New function.
31 (gfc_conv_ieee_arithmetic_function): Handle IEEE_MIN_NUM and
32 IEEE_MAX_NUM functions.
34 2023-06-09 Jakub Jelinek <jakub@redhat.com>
37 * primary.cc (gfc_convert_to_structure_constructor): Only do
38 constant string ctor length verification and truncation/padding
39 if constant length has INTEGER type.
41 2023-06-08 Paul Thomas <pault@gcc.gnu.org>
47 * decl.cc (char_len_param_value): Simplify a copy of the expr
48 and replace the original if there is no error.
49 * gfortran.h : Remove the redundant field 'rankguessed' from
50 'gfc_association_list'.
51 * resolve.cc (resolve_assoc_var): Remove refs to 'rankguessed'.
52 (resolve_variable): Associate names with constant or structure
53 constructor targets cannot have array refs.
54 * trans-array.cc (gfc_conv_expr_descriptor): Guard expression
55 character length backend decl before using it. Suppress the
56 assignment if lhs equals rhs.
57 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
58 associate variables pointing to a variable. Add comment.
59 * trans-stmt.cc (trans_associate_var): Remove requirement that
60 the character length be deferred before assigning the value
61 returned by gfc_conv_expr_descriptor. Also, guard the backend
62 decl before testing with VAR_P.
64 2023-06-06 Kwok Cheung Yeung <kcy@codesourcery.com>
65 Tobias Burnus <tobias@codesourcery.com>
67 * dump-parse-tree.cc (show_omp_namelist): Display 'present' map
69 (show_omp_clauses): Display 'present' motion modifier for 'to'
71 * gfortran.h (enum gfc_omp_map_op): Add entries with 'present'
73 (struct gfc_omp_namelist): Add 'present_modifer'.
74 * openmp.cc (gfc_match_motion_var_list): New, handles optional
75 'present' modifier for to/from clauses.
76 (gfc_match_omp_clauses): Call it for to/from clauses; parse 'present'
77 in defaultmap and map clauses.
78 (resolve_omp_clauses): Allow 'present' modifiers on 'target',
79 'target data', 'target enter' and 'target exit' directives.
80 * trans-openmp.cc (gfc_trans_omp_clauses): Apply 'present' modifiers
81 to tree node for 'map', 'to' and 'from' clauses. Apply 'present' for
84 2023-06-02 Steve Kargl <kargl@gcc.gnu.org>
87 * resolve.cc (resolve_select_rank): Remove duplicate error.
88 (resolve_fl_var_and_proc): Prevent NULL pointer dereference and
89 suppress error message for temporary.
91 2023-06-02 Paul Thomas <pault@gcc.gnu.org>
94 * parse.cc (parse_associate): Replace the existing evaluation
95 of the target rank with calls to gfc_resolve_ref and
96 gfc_expression_rank. Identify untyped target function results
97 with structure constructors by finding the appropriate derived
99 * resolve.cc (resolve_symbol): Allow associate variables to be
102 2023-06-01 Harald Anlauf <anlauf@gmx.de>
105 * decl.cc (gfc_match_kind_spec): Use error path on missing right
107 (gfc_match_decl_type_spec): Use error return when an error occurred
108 during matching a KIND specifier.
110 2023-06-01 Tobias Burnus <tobias@codesourcery.com>
112 * parse.cc (decode_omp_directive): Accept all pure directives
113 inside a PURE procedures; handle 'error at(execution).
115 2023-05-26 Tobias Burnus <tobias@codesourcery.com>
117 * dump-parse-tree.cc (show_omp_namelist): Update allocator, fix
119 (show_omp_node, show_code_node): Handle EXEC_OMP_ALLOCATE.
120 * gfortran.h (enum gfc_statement): Add ST_OMP_ALLOCATE and ..._EXEC.
121 (enum gfc_exec_op): Add EXEC_OMP_ALLOCATE.
122 (struct gfc_omp_namelist): Add 'allocator' to 'u2' union.
123 (struct gfc_namespace): Add omp_allocate.
124 (gfc_resolve_omp_allocate): New.
125 * match.cc (gfc_free_omp_namelist): Free 'u2.allocator'.
126 * match.h (gfc_match_omp_allocate, gfc_match_omp_allocators): New.
127 * openmp.cc (gfc_omp_directives): Uncomment allocate/allocators.
128 (gfc_match_omp_variable_list): Add bool arg for
129 rejecting listening common-block vars separately.
130 (gfc_match_omp_clauses): Update for u2.allocators.
131 (OMP_ALLOCATORS_CLAUSES, gfc_match_omp_allocate,
132 gfc_match_omp_allocators, is_predefined_allocator,
133 gfc_resolve_omp_allocate): New.
134 (resolve_omp_clauses): Update 'allocate' clause checks.
135 (omp_code_to_statement, gfc_resolve_omp_directive): Handle
136 OMP ALLOCATE/ALLOCATORS.
137 * parse.cc (in_exec_part): New global var.
138 (check_omp_allocate_stmt, parse_openmp_allocate_block): New.
139 (decode_omp_directive, case_exec_markers, case_omp_decl,
140 gfc_ascii_statement, parse_omp_structured_block): Handle
141 OMP allocate/allocators.
142 (verify_st_order, parse_executable): Set in_exec_part.
143 * resolve.cc (gfc_resolve_blocks, resolve_codes): Handle
145 * st.cc (gfc_free_statement): Likewise.
146 * trans.cc (trans_code): Likewise.
147 * trans-openmp.cc (gfc_trans_omp_directive): Likewise.
148 (gfc_trans_omp_clauses, gfc_split_omp_clauses): Update for
149 u2.allocator, fix for u.align.
151 2023-05-24 Harald Anlauf <anlauf@gmx.de>
154 * simplify.cc (simplify_size): Reject DIM argument of intrinsic SIZE
155 with error when out of valid range.
157 2023-05-24 Harald Anlauf <anlauf@gmx.de>
160 * check.cc (gfc_check_reshape): Expand constant arguments SHAPE and
161 ORDER before checking.
162 * gfortran.h (gfc_is_constant_array_expr): Add prototype.
163 * iresolve.cc (gfc_resolve_reshape): Expand constant argument SHAPE.
164 * simplify.cc (is_constant_array_expr): If array is determined to be
165 constant, expand small array constructors if needed.
166 (gfc_is_constant_array_expr): Wrapper for is_constant_array_expr.
167 (gfc_simplify_reshape): Fix check for insufficient elements in SOURCE
168 when no padding specified.
170 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
173 * resolve.cc (gfc_resolve_ref): Conversion of array_ref into an
174 element should be done for all characters without a len expr,
175 not just deferred lens, and for integer expressions.
176 * trans-expr.cc (conv_inquiry): For len and kind inquiry refs,
177 set the se string_length to NULL_TREE.
179 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
180 Steven G. Kargl <kargl@gcc.gnu.org>
183 * decl.cc (variable_decl): Clean up white space issues.
184 (gfc_match_final_decl): Declaration of finalizable derived type
185 is allowed in a submodule.
187 2023-05-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
189 * expr.cc (gfc_get_corank): Use CLASS_DATA from gfortran.h.
190 * resolve.cc (resolve_component): Same.
191 (resolve_fl_derived0): Same.
192 * simplify.cc (gfc_simplify_extends_type_of): Same.
193 (simplify_cobound): Same.
195 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
197 * trans-array.cc (is_pointer_array): Use _P() defines from tree.h.
198 (gfc_conv_scalarized_array_ref): Ditto.
199 (gfc_conv_array_ref): Ditto.
200 * trans-decl.cc (gfc_finish_decl): Ditto.
201 (gfc_get_symbol_decl): Ditto.
202 * trans-expr.cc (gfc_trans_pointer_assignment): Ditto.
203 (gfc_trans_arrayfunc_assign): Ditto.
204 (gfc_trans_assignment_1): Ditto.
205 * trans-intrinsic.cc (gfc_conv_intrinsic_minmax): Ditto.
206 (conv_intrinsic_ieee_value): Ditto.
207 * trans-io.cc (gfc_convert_array_to_string): Ditto.
208 * trans-openmp.cc (gfc_omp_is_optional_argument): Ditto.
209 (gfc_trans_omp_clauses): Ditto.
210 * trans-stmt.cc (gfc_conv_label_variable): Ditto.
211 * trans.cc (gfc_build_addr_expr): Ditto.
212 (get_array_span): Ditto.
214 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
217 * array.cc (compare_bounds): Use narrower return type.
218 (gfc_compare_array_spec): Likewise.
219 (is_constant_element): Likewise.
220 (gfc_constant_ac): Likewise.
221 * check.cc (dim_rank_check): Likewise.
222 * cpp.cc (gfc_cpp_init_options): Likewise.
223 (dump_macro): Likewise.
224 * cpp.h (gfc_cpp_handle_option): Likewise.
225 * dependency.cc (gfc_ref_needs_temporary_p): Likewise.
226 (gfc_check_argument_dependency): Likewise.
227 (gfc_check_fncall_dependency): Likewise.
228 (ref_same_as_full_array): Likewise.
229 * dependency.h (gfc_check_fncall_dependency): Likewise.
230 (gfc_dep_resolver): Likewise.
231 (gfc_are_equivalenced_arrays): Likewise.
232 * expr.cc (gfc_copy_ref): Likewise.
233 (gfc_kind_max): Likewise.
234 (numeric_type): Likewise.
235 * gfortran.h (gfc_at_end): Likewise.
236 (gfc_at_eof): Likewise.
237 (gfc_at_bol): Likewise.
238 (gfc_at_eol): Likewise.
239 (gfc_define_undef_line): Likewise.
240 (gfc_wide_is_printable): Likewise.
241 (gfc_wide_is_digit): Likewise.
242 (gfc_wide_fits_in_byte): Likewise.
243 (gfc_find_sym_tree): Likewise.
244 (gfc_generic_intrinsic): Likewise.
245 (gfc_specific_intrinsic): Likewise.
246 (gfc_intrinsic_actual_ok): Likewise.
247 (gfc_has_vector_index): Likewise.
248 (gfc_numeric_ts): Likewise.
249 (gfc_impure_variable): Likewise.
250 (gfc_pure): Likewise.
251 (gfc_implicit_pure): Likewise.
252 (gfc_elemental): Likewise.
253 (gfc_pure_function): Likewise.
254 (gfc_implicit_pure_function): Likewise.
255 (gfc_compare_array_spec): Likewise.
256 (gfc_constant_ac): Likewise.
257 (gfc_expanded_ac): Likewise.
258 (gfc_check_digit): Likewise.
259 * intrinsic.cc (gfc_find_subroutine): Likewise.
260 (gfc_generic_intrinsic): Likewise.
261 (gfc_specific_intrinsic): Likewise.
262 * io.cc (compare_to_allowed_values): Likewise. And remove
263 unneeded forward declaration.
264 * parse.cc: Likewise.
265 * parse.h (gfc_check_do_variable): Likewise.
266 * primary.cc (gfc_check_digit): Likewise.
267 * resolve.cc (resolve_structure_cons): Likewise.
268 (pure_stmt_function): Likewise.
269 (gfc_pure_function): Likewise.
270 (impure_stmt_fcn): Likewise.
271 (resolve_forall_iterators): Likewise.
272 (resolve_data): Likewise.
273 (gfc_impure_variable): Likewise.
274 (gfc_pure): Likewise.
275 (gfc_unset_implicit_pure): Likewise.
276 * scanner.cc (wide_is_ascii): Likewise.
277 (gfc_wide_toupper): Likewise.
278 (gfc_open_included_file): Likewise.
279 (gfc_at_end): Likewise.
280 (gfc_at_eof): Likewise.
281 (gfc_at_bol): Likewise.
282 (skip_comment_line): Likewise.
283 (gfc_gobble_whitespace): Likewise.
284 * symbol.cc (gfc_find_symtree_in_proc): Likewise.
285 * trans-array.cc: Likewise.
286 * trans-decl.cc (gfc_set_decl_assembler_name): Likewise.
287 * trans-types.cc (gfc_get_element_type): Likewise.
288 (gfc_add_field_to_struct): Likewise.
289 * trans-types.h (gfc_copy_dt_decls_ifequal): Likewise.
290 (gfc_return_by_reference): Likewise.
291 (gfc_is_nodesc_array): Likewise.
292 * trans.h (gfc_can_put_var_on_stack): Likewise.
294 2023-05-17 Harald Anlauf <anlauf@gmx.de>
298 * decl.cc (add_init_expr_to_sym): Set shape of initializer also for
299 zero-sized arrays, so that bounds violations can be detected later.
301 2023-05-17 Tobias Burnus <tobias@codesourcery.com>
303 * trans-decl.cc (gfc_get_symbol_decl): Add attributes
304 such as 'declare target' also to hidden artificial
305 variable for deferred-length character variables.
306 * trans-openmp.cc (gfc_trans_omp_array_section,
307 gfc_trans_omp_clauses, gfc_trans_omp_target_exit_data):
308 Improve mapping of array descriptors and deferred-length
311 2023-05-16 Paul Thomas <pault@gcc.gnu.org>
319 * interface.cc (gfc_compare_actual_formal): Emit an error if an
320 unlimited polymorphic actual is not matched either to an
321 unlimited or assumed type formal argument.
322 * resolve.cc (resolve_ordinary_assign): Emit an error if the
323 var expression of an ordinary assignment is a proc pointer
325 * trans-array.cc (gfc_walk_array_ref): Provide assumed shape
326 arrays coming from interface mapping with a viable arrayspec.
327 * trans-expr.cc (gfc_conv_intrinsic_to_class): Tidy up flagging
328 of unlimited polymorphic 'class_ts'.
329 (gfc_conv_gfc_desc_to_cfi_desc): Assumed type is unlimited
330 polymorphic and should accept any actual type.
331 (gfc_conv_procedure_call): Replace dreadful kludge with a call
332 to gfc_finalize_tree_expr. Avoid dereferencing a void pointer
333 by giving it the pointer type of the actual argument.
334 (alloc_scalar_allocatable_subcomponent): Shorten the function
335 name and replace the symbol argument with the se string length.
336 If a deferred length character length is either not present or
337 is not a variable, give the typespec a variable and assign the
338 string length to that. Use gfc_deferred_strlen to find the
339 hidden string length component.
340 (gfc_trans_subcomponent_assign): Convert the expression before
341 the call to alloc_scalar_allocatable_subcomponent so that a
342 good string length is provided.
343 (gfc_trans_structure_assign): Remove the unneeded derived type
344 symbol from calls to gfc_trans_subcomponent_assign.
346 2023-05-15 Harald Anlauf <anlauf@gmx.de>
349 * expr.cc (gfc_check_vardef_context): Check appropriate pointer
350 attribute for CLASS vs. non-CLASS function result in variable
353 2023-05-11 Xi Ruoyao <xry111@xry111.site>
355 * Make-lang.in: Use grep instead of fgrep.
357 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
359 * dump-parse-tree.cc (gfc_debug_expr): Remove forward declaration.
360 (debug): Add DEBUG_FUNCTION.
361 (show_code_node): Remove erroneous whitespace.
363 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
366 * dump-parse-tree.cc (debug): New function for gfc_namespace.
367 (gfc_debug_code): Delete forward declaration.
368 (show_attr): Make sure to print balanced braces.
370 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
372 * resolve.cc (resolve_select_type): Fix coding style.
374 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
376 * resolve.cc (resolve_select_type): Call free() unconditionally.
378 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
381 * expr.cc (find_array_section): Fix mpz memory leak.
382 * simplify.cc (gfc_simplify_reshape): Fix mpz memory leaks in
385 2023-05-05 Harald Anlauf <anlauf@gmx.de>
388 * arith.cc (eval_intrinsic): Check conformability of ranks of operands
389 for intrinsic binary operators before performing type conversions.
390 * gfortran.h (gfc_op_rank_conformable): Add prototype.
391 * resolve.cc (resolve_operator): Check conformability of ranks of
392 operands for intrinsic binary operators before performing type
394 (gfc_op_rank_conformable): New helper function to compare ranks of
395 operands of binary operator.
397 2023-05-04 Julian Brown <julian@codesourcery.com>
400 * openmp.cc (resolve_omp_clauses): Add diagnostic for
401 non-pointer/non-allocatable attach/detach.
402 * trans-openmp.cc (gfc_trans_omp_clauses): Remove dereference for
403 pointer-to-scalar derived type component attach/detach. Fix
404 attach/detach handling for descriptors.
406 2023-04-28 Julian Brown <julian@codesourcery.com>
409 * trans-openmp.cc (gfc_trans_omp_clauses): Attach/detach clause fixes.
411 2023-04-28 Tobias Burnus <tobias@codesourcery.com>
413 * gfortran.texi: Fix typos.
414 * decl.cc: Fix typos in comments and in a variable name.
415 * arith.cc: Fix comment typos.
416 * check.cc: Likewise.
417 * class.cc: Likewise.
418 * dependency.cc: Likewise.
420 * frontend-passes.cc: Likewise.
421 * gfortran.h: Likewise.
422 * intrinsic.cc: Likewise.
423 * iresolve.cc: Likewise.
424 * match.cc: Likewise.
425 * module.cc: Likewise.
426 * primary.cc: Likewise.
427 * resolve.cc: Likewise.
428 * simplify.cc: Likewise.
429 * trans-array.cc: Likewise.
430 * trans-decl.cc: Likewise.
431 * trans-expr.cc: Likewise.
432 * trans-intrinsic.cc: Likewise.
433 * trans-openmp.cc: Likewise.
434 * trans-stmt.cc: Likewise.
436 2023-04-25 Tobias Burnus <tobias@codesourcery.com>
438 * openmp.cc (gfc_resolve_omp_do_blocks): Handle zero
439 or more than one exec statements before/after 'omp scan'.
440 * trans-openmp.cc (gfc_trans_omp_do): Likewise.
442 2023-04-22 Harald Anlauf <anlauf@gmx.de>
443 Steven G. Kargl <kargl@gcc.gnu.org>
446 * interface.cc (gfc_compare_actual_formal): Reject allocatable
447 functions being used as actual argument for allocable dummy.
449 2023-04-14 Harald Anlauf <anlauf@gmx.de>
452 * simplify.cc (gfc_simplify_set_exponent): Fix implementation of
453 compile-time simplification of intrinsic SET_EXPONENT for argument
456 2023-04-14 Paul Thomas <pault@gcc.gnu.org>
459 * gfortran.h : Add expr3_not_explicit bit field to gfc_code.
460 * resolve.cc (resolve_allocate_expr): Set bit field when the
461 default initializer is applied to expr3.
462 * trans-stmt.cc (gfc_trans_allocate): If expr3_not_explicit is
463 set, do not deallocate expr3.
465 2023-04-13 Harald Anlauf <anlauf@gmx.de>
468 * trans-expr.cc (gfc_conv_power_op): Use absu_hwi and
469 unsigned HOST_WIDE_INT for portability.
471 2023-04-12 Harald Anlauf <anlauf@gmx.de>
474 * resolve.cc (resolve_entries): Handle functions with ENTRY and
476 * trans-expr.cc (gfc_conv_procedure_call): Functions with a result
477 with the POINTER or ALLOCATABLE attribute shall not get any special
478 treatment with -ff2c, as they cannot be written in Fortran 77.
479 * trans-types.cc (gfc_return_by_reference): Likewise.
480 (gfc_get_function_type): Likewise.
482 2023-04-12 Harald Anlauf <anlauf@gmx.de>
486 * interface.cc (compare_parameter): Enable type and rank checks for
487 arguments of derived type from the intrinsic module ISO_C_BINDING.
489 2023-04-08 Paul Thomas <pault@gcc.gnu.org>
492 * iresolve.cc (gfc_resolve_adjustl, gfc_resolve_adjustr): if
493 string length is deferred use the string typespec for result.
494 * resolve.cc (resolve_assoc_var): Handle parentheses around the
496 (resolve_block_construct): Remove unnecessary static decls.
497 * trans-array.cc (gfc_conv_expr_descriptor): Guard string len
498 expression in condition. Improve handling of string length and
499 span, especially for substrings of the descriptor.
500 (duplicate_allocatable): Make element type more explicit with
502 * trans-decl.cc (gfc_get_symbol_decl): Emit a fatal error with
503 appropriate message instead of ICE if symbol type is unknown.
504 (gfc_generate_function_code): Set current locus to proc_sym
506 * trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in
507 'previous' and use if end expression in substring reference is
509 (gfc_conv_string_length): Use gfc_conv_expr_descriptor if
510 'expr_flat' is an array. Add post block to catch deallocation
512 (gfc_conv_procedure_call): Assign the parmse string length to
513 the expression string length, if it is deferred.
514 (gfc_trans_alloc_subarray_assign): If this is a deferred string
515 length component, store the string length in the hidden comp.
516 Update the typespec length accordingly. Generate a new type
517 spec for the call to gfc_duplicate-allocatable in this case.
518 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
519 deferred character array components.
521 2023-04-04 Harald Anlauf <anlauf@gmx.de>
524 * expr.cc (check_restricted): Adjust check for valid variables in
525 restricted expressions: make no exception for module variables.
527 2023-04-01 Thomas Koenig <tkoenig@gcc.gnu.org>
529 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
530 type name to be "long long".
532 2023-03-30 Andrew Pinski <apinski@marvell.com>
534 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
535 type name to be "long long". Add a comment on why adding
538 2023-03-28 Jakub Jelinek <jakub@redhat.com>
541 * openmp.cc (gfc_omp_absent_contains_clause): Fix typo in diagnostics
542 - composit -> composite.
544 2023-03-25 Harald Anlauf <anlauf@gmx.de>
547 * trans-decl.cc (gfc_conv_cfi_to_gfc): Remove dead code.
549 2023-03-24 Harald Anlauf <anlauf@gmx.de>
551 * expr.cc (free_expr0): Free also BOZ strings as part of an expression.
553 2023-03-24 Haochen Gui <guihaoc@gcc.gnu.org>
554 Tobias Burnus <tobias@codesourcery.com>
557 * target-memory.cc (gfc_interpret_float): Return FAIL when
558 native_interpret_expr gets a NULL tree.
559 * arith.cc (gfc_hollerith2real): Return NULL when
560 gfc_interpret_float fails.
561 * error.cc (gfc_buffered_p): Define.
562 * gfortran.h (gfc_buffered_p): Declare.
563 * intrinsic.cc: Add diagnostic.h to include list.
564 (do_simplify): Save errorcount and check it at finish. Report a
565 "Cannot simplify expression" error on a bad result if error count
566 doesn't change and no other errors buffered.
568 2023-03-22 Harald Anlauf <anlauf@gmx.de>
569 Steven G. Kargl <kargl@gcc.gnu.org>
572 * resolve.cc (gfc_resolve_finalizers): Argument of a FINAL subroutine
573 cannot be an alternate return.
575 2023-03-21 Harald Anlauf <anlauf@gmx.de>
578 * decl.cc (gfc_match_modproc): Reject MODULE PROCEDURE if not in a
579 generic module interface.
581 2023-03-21 Arsen Arsenović <arsen@aarsen.me>
583 * invoke.texi: Remove usages of @gol.
584 * intrinsic.texi: Ditto.
586 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
589 * trans-array.cc (gfc_trans_array_constructor_value): Correct
590 incorrect setting of typespec.
592 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
595 * resolve.cc (generate_component_assignments): Restore the
596 exclusion of allocatable components from the loop.
598 2023-03-20 Harald Anlauf <anlauf@gmx.de>
601 * invoke.texi: Correct documentation of how underscores are appended
604 2023-03-20 Harald Anlauf <anlauf@gmx.de>
607 * simplify.cc (gfc_simplify_nearest): Fix off-by-one error in setting
608 up real kind-specific maximum exponent for mpfr.
610 2023-03-20 Paul Thomas <pault@gcc.gnu.org>
613 * resolve.cc (check_host_association): If an external function
614 is typed but not declared explicitly to be external, change the
615 old symbol from a variable to an external function.
617 2023-03-19 Harald Anlauf <anlauf@gmx.de>
620 * resolve.cc (resolve_fl_procedure): Check for an explicit interface
621 of procedures with the BIND(C) attribute (F2018:15.4.2.2).
623 2023-03-19 Thomas Koenig <tkoenig@gcc.gnu.org>
625 * gfortran.texi: Mention behavior on overflow.
627 2023-03-18 Paul Thomas <pault@gcc.gnu.org>
632 * class.cc (finalize_component): Include the missing arguments
633 in the call to the component's finalizer wrapper.
634 (has_finalizer_component): Do not return true for procedure
636 (finalizer_insert_packed_call): Remove the redundant argument
637 in the call to the final subroutine.
638 (generate_finalization_wrapper): Add support for assumed rank
640 (gfc_may_be_finalized): New helper function.
641 * dump-parse-tree.cc (write_proc): Whitespace.
642 * gfortran.h : Add prototype for gfc_may_be_finalized.
643 * resolve.cc (resolve_function): Correct derived types that
644 have an incomplete namespace.
645 (resolve_where, gfc_resolve_where_code_in_forall,
646 gfc_resolve_forall_body, gfc_resolve_code): Check that the op
647 code is still EXEC_ASSIGN. If it is set lhs to must finalize.
648 (is_finalizable_type): New function.
649 (generate_component_assignments): Set must_finalize if needed.
650 (gfc_resolve_finalizers): Error if assumed rank finalizer is
651 not the only one. Warning on lack of scalar finalizer modified
652 to account for assumed rank finalizers.
653 (generate_final_call): New function.
654 (generate_component_assignments): Enclose the outermost call in
655 a block to capture automatic deallocation and final calls.
656 Set must_finalize as required to satisfy the standards. Use an
657 explicit pointer assignment for pointer components to capture
658 finalization of the target. Likewise use explicit assignment
659 for allocatable components. Do not use the temporary copy of
660 the lhs in defined assignment if the component is allocatable.
661 Put the temporary in the same namespace as the lhs symbol if
662 the component may be finalized. Remove the leading assignment
663 from the expansion of assignment of components that have their
664 own defined assignment components. Suppress finalization of
665 assignment of temporary components to the lhs. Make an explicit
666 final call for the rhs function temporary if it exists.
667 (gfc_resolve_code): Set must_finalize for assignments with an
668 array constructor on the rhs.
669 (gfc_resolve_finalizers): Ensure that an assumed rank finalizer
670 is the only finalizer for that type and correct the surprising
671 warning for the lack of a scalar finalizer.
672 (check_defined_assignments): Handle allocatable components.
673 (resolve_fl_derived): Set referenced the vtab for use
675 (resolve_symbol): Set referenced an unreferenced symbol that
677 * trans-array.cc (gfc_trans_array_constructor_value): Add code
678 to finalize the constructor result. Warn that this feature was
679 removed in F2018 and that it is suppressed by -std=2018.
680 (trans_array_constructor): Add finalblock, pass to previous
681 and apply to loop->post if filled.
682 (gfc_add_loop_ss_code): Add se finalblock to outer loop post.
683 (gfc_trans_array_cobounds, gfc_trans_array_bounds): Add any
684 generated finalization code to the main block.
685 (structure_alloc_comps): Add boolean argument to suppress
686 finalization and use it for calls from
687 gfc_deallocate_alloc_comp_no_caf. Otherwise it defaults to
689 (gfc_copy_alloc_comp_no_fini): New wrapper for
690 structure_alloc_comps.
691 (gfc_alloc_allocatable_for_assignment): Suppress finalization
692 by setting new arg in call to gfc_deallocate_alloc_comp_no_caf.
693 (gfc_trans_deferred_array): Use gfc_may_be_finalized and do not
694 deallocate the components of entities with a leading '_' in the
695 name that are also marked as artificial.
696 * trans-array.h : Add the new boolean argument to the prototype
697 of gfc_deallocate_alloc_comp_no_caf with a default of false.
698 Add prototype for gfc_copy_alloc_comp_no_fini.
699 * trans-decl.cc(init_intent_out_dt): Tidy up the code.
700 * trans-expr.cc (gfc_init_se): Initialize finalblock.
701 (gfc_conv_procedure_call): Use gfc_finalize_tree_expr to
702 finalize function results. Replace in-line block for class
703 results with call to new function.
704 (gfc_conv_expr): Finalize structure constructors for F2003 and
705 F2008. Warn that this feature was deleted in F2018 and, unlike
706 array constructors, is not default. Add array constructor
707 finalblock to the post block.
708 (gfc_trans_scalar_assign): Suppress finalization by setting new
709 argument in call to gfc_deallocate_alloc_comp_no_caf. Add the
710 finalization blocks to the main block.
711 (gfc_trans_arrayfunc_assign): Use gfc_assignment_finalizer_call
712 and ensure that finalization occurs after the evaluation of the
713 rhs but using the initial value for the lhs. Finalize rhs
714 function results using gfc_finalize_tree_expr.
715 (trans_class_assignment, gfc_trans_assignment_1): As previous
716 function, taking care to order evaluation, assignment and
717 finalization correctly.
718 * trans-io.cc (gfc_trans_transfer): Add the final block.
719 * trans-stmt.cc (gfc_trans_call, gfc_trans_allocate): likewise.
720 (trans_associate_var): Nullify derived allocatable components
721 and finalize function targets with defined assignment
722 components on leaving the block scope.
723 (trans_allocate): Finalize source expressions, if required,
724 and set init_expr artificial temporarily to suppress the
725 finalization in gfc_trans_assignment.
726 * trans.cc (gfc_add_finalizer_call): Do not finalize the
727 temporaries generated in type assignment with defined
728 assignment components.
729 (gfc_assignment_finalizer_call): New function.
730 (gfc_finalize_tree_expr): New function.
731 * trans.h: Add finalblock to gfc_se. Add the prototypes for
732 gfc_finalize_tree_expr and gfc_assignment_finalizer_call.
734 2023-03-15 Harald Anlauf <anlauf@gmx.de>
735 Tobias Burnus <tobias@codesourcery.com>
738 * interface.cc (compare_parameter): Adjust check of array dummy
739 arguments to handle the case of CLASS variables.
741 2023-03-11 Harald Anlauf <anlauf@gmx.de>
744 * trans-expr.cc (gfc_copy_class_to_class): Convert element counts in
745 bounds check to common type for comparison.
747 2023-03-10 Harald Anlauf <anlauf@gmx.de>
750 * resolve.cc (resolve_symbol): Avoid NULL pointer dereference while
751 checking a symbol with the BIND(C) attribute.
753 2023-03-05 Harald Anlauf <anlauf@gmx.de>
754 Tobias Burnus <tobias@codesourcery.com>
757 * class.cc (gfc_build_class_symbol): Handle update of attributes of
758 existing class container.
759 (gfc_find_derived_vtab): Fix several memory leaks.
760 (find_intrinsic_vtab): Ditto.
761 * decl.cc (attr_decl1): Manage update of symbol attributes from
763 * primary.cc (gfc_variable_attr): OPTIONAL shall not be taken or
764 updated from the class container.
765 * symbol.cc (free_old_symbol): Adjust management of symbol versions
766 to not prematurely free array specs while working on the declation
769 2023-03-01 Tobias Burnus <tobias@codesourcery.com>
772 * trans-openmp.cc (gfc_trans_omp_clauses): Fix mapping of
773 type(C_ptr) variables.
775 2023-02-27 Harald Anlauf <anlauf@gmx.de>
778 * trans-intrinsic.cc (gfc_conv_intrinsic_ibits): Handle corner case
779 LEN argument of IBITS equal to BITSIZE(I).
781 2023-02-25 Mikael Morin <mikael@gcc.gnu.org>
784 * intrinsic.cc (get_intrinsic_dummy_arg,
785 set_intrinsic_dummy_arg): Rename the former to the latter.
786 Remove the return value, add a reference to the lhs as argument,
787 and do the pointer assignment inside the function. Don't do
788 it if the pointer is already non-NULL.
789 (sort_actual): Update caller.
791 2023-02-25 Harald Anlauf <anlauf@gmx.de>
793 * arith.cc (gfc_real2int): Clear mpfr variable after use.
795 2023-02-25 Tobias Burnus <tobias@codesourcery.com>
798 * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Skip setting of
799 bounds of CFI desc for 'pointer,intent(out)'.
801 2023-02-24 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
803 * trans-decl.cc (gfc_finish_var_decl): Apply attribute.
804 (generate_local_decl): Add diagnostic for dummy and local variables.
806 2023-02-24 Mikael Morin <mikael@gcc.gnu.org>
809 * expr.cc (gfc_free_actual_arglist): Free associated_dummy
811 (gfc_copy_actual_arglist): Make a copy of the associated_dummy
812 field if it is set in the original element.
814 2023-02-24 Harald Anlauf <anlauf@gmx.de>
817 * frontend-passes.cc (do_subscript): Clear used gmp variable.
819 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
821 * invoke.texi: Reorder index entries around @items.
823 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
825 * invoke.texi: Reorder @opindex commands to precede @items they
828 2023-02-22 Harald Anlauf <anlauf@gmx.de>
831 * resolve.cc (resolve_component): The type of a CHARACTER length
832 expression must be INTEGER.
834 2023-02-21 Harald Anlauf <anlauf@gmx.de>
837 * parse.cc (check_function_result_typed): Improve type check of
838 specification expression for character length and return status.
839 (parse_spec): Use status from above.
840 * resolve.cc (resolve_fntype): Prevent use of invalid specification
841 expression for character length.
843 2023-02-16 Patrick Palka <ppalka@redhat.com>
845 * gfortran.h: Mechanically drop static from static inline
846 functions via s/^static inline/inline/g.
848 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
851 * frontend-passes.cc (do_intent): Catch NULL pointer dereference on
852 reference to invalid formal argument.
854 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
857 * resolve.cc (check_assumed_size_reference): Avoid NULL pointer
860 2023-02-15 Tobias Burnus <tobias@codesourcery.com>
863 * openmp.cc (gfc_resolve_omp_parallel_blocks): Handle combined 'loop'
865 (gfc_resolve_do_iterator): Set a source location for added
866 'private'-clause arguments.
867 * resolve.cc (gfc_resolve_code): Call gfc_resolve_omp_do_blocks
868 also for EXEC_OMP_LOOP and gfc_resolve_omp_parallel_blocks for
869 combined directives with loop + '{masked,master} taskloop (simd)'.
871 2023-02-13 Harald Anlauf <anlauf@gmx.de>
874 * primary.cc (gfc_expr_attr): Avoid NULL pointer dereference for
875 invalid use of CLASS variable.
877 2023-02-13 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
879 * decl.cc: Add EXT_ATTR_NOINLINE, EXT_ATTR_NORETURN, EXT_ATTR_WEAK.
880 * gfortran.h (ext_attr_id_t): Ditto.
881 * gfortran.texi (GCC$ ATTRIBUTES): Document them.
882 * trans-decl.cc (build_function_decl): Apply them.
884 2023-02-09 Harald Anlauf <anlauf@gmx.de>
885 Steven G. Kargl <kargl@gcc.gnu.org>
889 * intrinsic.cc (gfc_convert_chartype): Recover on invalid character
890 kind in conversion instead of generating an internal error.
892 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
895 * trans-openmp.cc (struct dovar_init_d): Add 'sym' and
896 'non_unit_incr' members.
897 (gfc_nonrect_loop_expr): New.
898 (gfc_trans_omp_do): Call it; use normal loop bounds
899 for unit stride - and only create local loop var.
901 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
903 * parse.cc (decode_omp_directive): Really ignore 'assumes' with
906 2023-02-08 Steve Kargl <kargl@gcc.gnu.org>
909 * resolve.cc (resolve_common_vars): Avoid NULL pointer dereference
910 when a symbol's location is not set.
912 2023-02-07 Harald Anlauf <anlauf@gmx.de>
915 * trans-decl.cc (gfc_finish_var_decl): With -fno-automatic, do not
916 make ASSOCIATE variables TREE_STATIC.
918 2023-02-05 Harald Anlauf <anlauf@gmx.de>
921 * arith.cc (gfc_arith_divide): Emit integer division truncation
922 warnings using gfc_warning instead of gfc_warning_now to prevent
925 2023-02-03 Jakub Jelinek <jakub@redhat.com>
928 * trans-decl.cc (gfc_trans_use_stmts): Call clear_slot before
931 2023-02-01 Harald Anlauf <anlauf@gmx.de>
934 * expr.cc (find_array_section): Add check to prevent interpreting an
935 mpz non-integer constant as an integer.
937 2023-02-01 Tobias Burnus <tobias@codesourcery.com>
939 * openmp.cc (resolve_omp_clauses): Check also for
942 2023-01-29 Mikael Morin <mikael@gcc.gnu.org>
945 * check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
946 (gfc_check_findloc): Ditto.
948 2023-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
951 * parse.cc (parse_module): Remove use of a bool error value
952 that prevented proper setting of the namespace pointer.
954 2023-01-28 Harald Anlauf <anlauf@gmx.de>
955 Steven G. Kargl <kargl@gcc.gnu.org>
958 * resolve.cc (compare_bound_int): Expression to compare must be of
960 (compare_bound_mpz_t): Likewise.
961 (check_dimension): Fix comment on checks applied to array section
962 and clean up associated logic.
964 2023-01-28 Harald Anlauf <anlauf@gmx.de>
967 * match.cc (gfc_match_common): A USE associated name shall not appear
968 in a COMMON block (F2018:C8121).
970 2023-01-27 Tobias Burnus <tobias@codesourcery.com>
973 * trans-openmp.cc (gfc_split_omp_clauses): Handle has_device_addr.
975 2023-01-26 Harald Anlauf <anlauf@gmx.de>
978 * resolve.cc (check_host_association): Extend host association check
979 so that it is not restricted to functions. Also prevent NULL pointer
982 2023-01-25 Steve Kargl <kargl@gcc.gnu.org>
985 * array.cc (compare_bounds): Return false instead of generating an
986 internal error on an invalid argument type.
988 2023-01-24 Harald Anlauf <anlauf@gmx.de>
991 * simplify.cc (simplify_transformation): Do not try to simplify
992 transformational intrinsic when the ARRAY argument has a NULL shape.
994 2023-01-23 Harald Anlauf <anlauf@gmx.de>
997 * dependency.cc (gfc_check_dependency): Prevent NULL pointer
998 dereference while recursively checking expressions.
1000 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1003 * interface.cc (get_expr_storage_size): Check array subscript triplets
1004 that we actually have integer values before trying to extract with
1007 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1010 * iresolve.cc (check_charlen_present): Preserve character length if
1011 there is no array constructor.
1013 2023-01-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1016 * data.cc (gfc_assign_data_value): Remove check for PARAMETER in DATA.
1017 * primary.cc (match_variable): Add check for PARAMETER in DATA.
1019 2023-01-19 Harald Anlauf <anlauf@gmx.de>
1022 * expr.cc (class_allocatable): Prevent NULL pointer dereference
1024 (class_pointer): Likewise.
1026 2023-01-17 Harald Anlauf <anlauf@gmx.de>
1029 * interface.cc (get_expr_storage_size): Check that we actually have
1030 an integer value before trying to extract it with mpz_get_si.
1032 2023-01-12 Tobias Burnus <tobias@codesourcery.com>
1035 * openmp.cc (gfc_resolve_omp_assumptions): Reject nonscalars.
1037 2023-01-11 Jakub Jelinek <jakub@redhat.com>
1040 * f95-lang.cc (gfc_init_builtin_function): Fix up function types
1041 for BUILT_IN_REALLOC and BUILT_IN_SINCOS{F,,L}. Formatting fixes.
1043 2023-01-10 Harald Anlauf <anlauf@gmx.de>
1046 * frontend-passes.cc (do_subscript): Clear used gmp variables.
1048 2023-01-02 Jakub Jelinek <jakub@redhat.com>
1050 * gfortranspec.cc (lang_specific_driver): Update copyright notice
1052 * gfc-internals.texi: Bump @copying's copyright year.
1053 * gfortran.texi: Ditto.
1054 * intrinsic.texi: Ditto.
1055 * invoke.texi: Ditto.
1058 Copyright (C) 2023 Free Software Foundation, Inc.
1060 Copying and distribution of this file, with or without modification,
1061 are permitted in any medium without royalty provided the copyright
1062 notice and this notice are preserved.