1 2023-07-05 Robin Dapp <rdapp@ventanamicro.com>
2 Juzhe-Zhong <juzhe.zhong@rivai.ai>
4 * trans-types.cc (gfc_type_for_mode): Ditto.
6 2023-06-28 Harald Anlauf <anlauf@gmx.de>
9 * trans-expr.cc (gfc_conv_procedure_call): For non-constant string
10 argument passed to CHARACTER(LEN=1),VALUE dummy, ensure proper
11 dereferencing and truncation of string to length 1.
13 2023-06-28 Paul Thomas <pault@gcc.gnu.org>
16 * expr.cc (gfc_is_ptr_fcn): Remove reference to class_pointer.
17 * resolve.cc (resolve_assoc_var): Call gfc_is_ptr_fcn to allow
18 associate names with pointer function targets to be used in
19 variable definition context.
20 * trans-decl.cc (get_symbol_decl): Remove extraneous line.
21 * trans-expr.cc (alloc_scalar_allocatable_subcomponent): Obtain
22 size of intrinsic and character expressions.
23 (gfc_trans_subcomponent_assign): Expand assignment to class
24 components to include intrinsic and character expressions.
26 2023-06-24 Harald Anlauf <anlauf@gmx.de>
29 * trans-expr.cc (gfc_conv_procedure_call): Truncate constant string
30 argument of length > 1 passed to scalar CHARACTER(1),VALUE dummy.
32 2023-06-23 Harald Anlauf <anlauf@gmx.de>
35 * trans-expr.cc (gfc_conv_procedure_call): Pass actual argument
36 to scalar CHARACTER(1),VALUE dummy argument by value.
38 2023-06-21 Paul Thomas <pault@gcc.gnu.org>
45 * decl.cc (char_len_param_value): Fix memory leak.
46 (resolve_block_construct): Remove unnecessary static decls.
47 * expr.cc (gfc_is_ptr_fcn): New function.
48 (gfc_check_vardef_context): Use it to permit pointer function
49 result selectors to be used for associate names in variable
51 * gfortran.h: Prototype for gfc_is_ptr_fcn.
52 * match.cc (build_associate_name): New function.
53 (gfc_match_select_type): Use the new function to replace inline
54 version and to build a new associate name for the case where
55 the supplied associate name is already used for that purpose.
56 * resolve.cc (resolve_assoc_var): Call gfc_is_ptr_fcn to allow
57 associate names with pointer function targets to be used in
58 variable definition context.
59 * trans-decl.cc (gfc_get_symbol_decl): Unlimited polymorphic
60 variables need deferred initialisation of the vptr.
61 (gfc_trans_deferred_vars): Do the vptr initialisation.
62 * trans-stmt.cc (trans_associate_var): Ensure that a pointer
63 associate name points to the target of the selector and not
66 2023-06-21 Paul Thomas <pault@gcc.gnu.org>
69 * trans-expr.cc (gfc_conv_procedure_call): The hidden string
70 length must not be passed to a formal arg of type(cptr).
72 2023-06-20 Tobias Burnus <tobias@codesourcery.com>
74 * dump-parse-tree.cc (show_omp_namelist): Fix dump of the allocator
75 modifier of OMP_LIST_ALLOCATE.
77 2023-06-20 Tobias Burnus <tobias@codesourcery.com>
79 * match.cc (gfc_match_char): Match with '%S' a symbol
82 2023-06-19 Tobias Burnus <tobias@codesourcery.com>
84 * intrinsic.texi (OpenMP Modules OMP_LIB and OMP_LIB_KINDS): Also
85 add references to the OpenMP 5.1 and 5.2 spec; add omp_initial_device
86 and omp_invalid_device named constants.
88 2023-06-13 Harald Anlauf <anlauf@gmx.de>
89 Mikael Morin <mikael@gcc.gnu.org>
92 * trans-array.cc (gfc_trans_allocate_array_storage): When passing a
93 zero-sized array with fixed (= non-dynamic) size, allocate temporary
94 by the caller, not by the callee.
96 2023-06-10 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
98 * f95-lang.cc (gfc_init_builtin_functions): Add fmax() and
99 fmin() built-ins, and their variants.
100 * mathbuiltins.def: Add FMAX and FMIN built-ins.
101 * trans-intrinsic.cc (conv_intrinsic_ieee_minmax): New function.
102 (gfc_conv_ieee_arithmetic_function): Handle IEEE_MIN_NUM and
103 IEEE_MAX_NUM functions.
105 2023-06-09 Jakub Jelinek <jakub@redhat.com>
108 * primary.cc (gfc_convert_to_structure_constructor): Only do
109 constant string ctor length verification and truncation/padding
110 if constant length has INTEGER type.
112 2023-06-08 Paul Thomas <pault@gcc.gnu.org>
118 * decl.cc (char_len_param_value): Simplify a copy of the expr
119 and replace the original if there is no error.
120 * gfortran.h : Remove the redundant field 'rankguessed' from
121 'gfc_association_list'.
122 * resolve.cc (resolve_assoc_var): Remove refs to 'rankguessed'.
123 (resolve_variable): Associate names with constant or structure
124 constructor targets cannot have array refs.
125 * trans-array.cc (gfc_conv_expr_descriptor): Guard expression
126 character length backend decl before using it. Suppress the
127 assignment if lhs equals rhs.
128 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
129 associate variables pointing to a variable. Add comment.
130 * trans-stmt.cc (trans_associate_var): Remove requirement that
131 the character length be deferred before assigning the value
132 returned by gfc_conv_expr_descriptor. Also, guard the backend
133 decl before testing with VAR_P.
135 2023-06-06 Kwok Cheung Yeung <kcy@codesourcery.com>
136 Tobias Burnus <tobias@codesourcery.com>
138 * dump-parse-tree.cc (show_omp_namelist): Display 'present' map
140 (show_omp_clauses): Display 'present' motion modifier for 'to'
142 * gfortran.h (enum gfc_omp_map_op): Add entries with 'present'
144 (struct gfc_omp_namelist): Add 'present_modifer'.
145 * openmp.cc (gfc_match_motion_var_list): New, handles optional
146 'present' modifier for to/from clauses.
147 (gfc_match_omp_clauses): Call it for to/from clauses; parse 'present'
148 in defaultmap and map clauses.
149 (resolve_omp_clauses): Allow 'present' modifiers on 'target',
150 'target data', 'target enter' and 'target exit' directives.
151 * trans-openmp.cc (gfc_trans_omp_clauses): Apply 'present' modifiers
152 to tree node for 'map', 'to' and 'from' clauses. Apply 'present' for
155 2023-06-02 Steve Kargl <kargl@gcc.gnu.org>
158 * resolve.cc (resolve_select_rank): Remove duplicate error.
159 (resolve_fl_var_and_proc): Prevent NULL pointer dereference and
160 suppress error message for temporary.
162 2023-06-02 Paul Thomas <pault@gcc.gnu.org>
165 * parse.cc (parse_associate): Replace the existing evaluation
166 of the target rank with calls to gfc_resolve_ref and
167 gfc_expression_rank. Identify untyped target function results
168 with structure constructors by finding the appropriate derived
170 * resolve.cc (resolve_symbol): Allow associate variables to be
173 2023-06-01 Harald Anlauf <anlauf@gmx.de>
176 * decl.cc (gfc_match_kind_spec): Use error path on missing right
178 (gfc_match_decl_type_spec): Use error return when an error occurred
179 during matching a KIND specifier.
181 2023-06-01 Tobias Burnus <tobias@codesourcery.com>
183 * parse.cc (decode_omp_directive): Accept all pure directives
184 inside a PURE procedures; handle 'error at(execution).
186 2023-05-26 Tobias Burnus <tobias@codesourcery.com>
188 * dump-parse-tree.cc (show_omp_namelist): Update allocator, fix
190 (show_omp_node, show_code_node): Handle EXEC_OMP_ALLOCATE.
191 * gfortran.h (enum gfc_statement): Add ST_OMP_ALLOCATE and ..._EXEC.
192 (enum gfc_exec_op): Add EXEC_OMP_ALLOCATE.
193 (struct gfc_omp_namelist): Add 'allocator' to 'u2' union.
194 (struct gfc_namespace): Add omp_allocate.
195 (gfc_resolve_omp_allocate): New.
196 * match.cc (gfc_free_omp_namelist): Free 'u2.allocator'.
197 * match.h (gfc_match_omp_allocate, gfc_match_omp_allocators): New.
198 * openmp.cc (gfc_omp_directives): Uncomment allocate/allocators.
199 (gfc_match_omp_variable_list): Add bool arg for
200 rejecting listening common-block vars separately.
201 (gfc_match_omp_clauses): Update for u2.allocators.
202 (OMP_ALLOCATORS_CLAUSES, gfc_match_omp_allocate,
203 gfc_match_omp_allocators, is_predefined_allocator,
204 gfc_resolve_omp_allocate): New.
205 (resolve_omp_clauses): Update 'allocate' clause checks.
206 (omp_code_to_statement, gfc_resolve_omp_directive): Handle
207 OMP ALLOCATE/ALLOCATORS.
208 * parse.cc (in_exec_part): New global var.
209 (check_omp_allocate_stmt, parse_openmp_allocate_block): New.
210 (decode_omp_directive, case_exec_markers, case_omp_decl,
211 gfc_ascii_statement, parse_omp_structured_block): Handle
212 OMP allocate/allocators.
213 (verify_st_order, parse_executable): Set in_exec_part.
214 * resolve.cc (gfc_resolve_blocks, resolve_codes): Handle
216 * st.cc (gfc_free_statement): Likewise.
217 * trans.cc (trans_code): Likewise.
218 * trans-openmp.cc (gfc_trans_omp_directive): Likewise.
219 (gfc_trans_omp_clauses, gfc_split_omp_clauses): Update for
220 u2.allocator, fix for u.align.
222 2023-05-24 Harald Anlauf <anlauf@gmx.de>
225 * simplify.cc (simplify_size): Reject DIM argument of intrinsic SIZE
226 with error when out of valid range.
228 2023-05-24 Harald Anlauf <anlauf@gmx.de>
231 * check.cc (gfc_check_reshape): Expand constant arguments SHAPE and
232 ORDER before checking.
233 * gfortran.h (gfc_is_constant_array_expr): Add prototype.
234 * iresolve.cc (gfc_resolve_reshape): Expand constant argument SHAPE.
235 * simplify.cc (is_constant_array_expr): If array is determined to be
236 constant, expand small array constructors if needed.
237 (gfc_is_constant_array_expr): Wrapper for is_constant_array_expr.
238 (gfc_simplify_reshape): Fix check for insufficient elements in SOURCE
239 when no padding specified.
241 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
244 * resolve.cc (gfc_resolve_ref): Conversion of array_ref into an
245 element should be done for all characters without a len expr,
246 not just deferred lens, and for integer expressions.
247 * trans-expr.cc (conv_inquiry): For len and kind inquiry refs,
248 set the se string_length to NULL_TREE.
250 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
251 Steven G. Kargl <kargl@gcc.gnu.org>
254 * decl.cc (variable_decl): Clean up white space issues.
255 (gfc_match_final_decl): Declaration of finalizable derived type
256 is allowed in a submodule.
258 2023-05-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
260 * expr.cc (gfc_get_corank): Use CLASS_DATA from gfortran.h.
261 * resolve.cc (resolve_component): Same.
262 (resolve_fl_derived0): Same.
263 * simplify.cc (gfc_simplify_extends_type_of): Same.
264 (simplify_cobound): Same.
266 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
268 * trans-array.cc (is_pointer_array): Use _P() defines from tree.h.
269 (gfc_conv_scalarized_array_ref): Ditto.
270 (gfc_conv_array_ref): Ditto.
271 * trans-decl.cc (gfc_finish_decl): Ditto.
272 (gfc_get_symbol_decl): Ditto.
273 * trans-expr.cc (gfc_trans_pointer_assignment): Ditto.
274 (gfc_trans_arrayfunc_assign): Ditto.
275 (gfc_trans_assignment_1): Ditto.
276 * trans-intrinsic.cc (gfc_conv_intrinsic_minmax): Ditto.
277 (conv_intrinsic_ieee_value): Ditto.
278 * trans-io.cc (gfc_convert_array_to_string): Ditto.
279 * trans-openmp.cc (gfc_omp_is_optional_argument): Ditto.
280 (gfc_trans_omp_clauses): Ditto.
281 * trans-stmt.cc (gfc_conv_label_variable): Ditto.
282 * trans.cc (gfc_build_addr_expr): Ditto.
283 (get_array_span): Ditto.
285 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
288 * array.cc (compare_bounds): Use narrower return type.
289 (gfc_compare_array_spec): Likewise.
290 (is_constant_element): Likewise.
291 (gfc_constant_ac): Likewise.
292 * check.cc (dim_rank_check): Likewise.
293 * cpp.cc (gfc_cpp_init_options): Likewise.
294 (dump_macro): Likewise.
295 * cpp.h (gfc_cpp_handle_option): Likewise.
296 * dependency.cc (gfc_ref_needs_temporary_p): Likewise.
297 (gfc_check_argument_dependency): Likewise.
298 (gfc_check_fncall_dependency): Likewise.
299 (ref_same_as_full_array): Likewise.
300 * dependency.h (gfc_check_fncall_dependency): Likewise.
301 (gfc_dep_resolver): Likewise.
302 (gfc_are_equivalenced_arrays): Likewise.
303 * expr.cc (gfc_copy_ref): Likewise.
304 (gfc_kind_max): Likewise.
305 (numeric_type): Likewise.
306 * gfortran.h (gfc_at_end): Likewise.
307 (gfc_at_eof): Likewise.
308 (gfc_at_bol): Likewise.
309 (gfc_at_eol): Likewise.
310 (gfc_define_undef_line): Likewise.
311 (gfc_wide_is_printable): Likewise.
312 (gfc_wide_is_digit): Likewise.
313 (gfc_wide_fits_in_byte): Likewise.
314 (gfc_find_sym_tree): Likewise.
315 (gfc_generic_intrinsic): Likewise.
316 (gfc_specific_intrinsic): Likewise.
317 (gfc_intrinsic_actual_ok): Likewise.
318 (gfc_has_vector_index): Likewise.
319 (gfc_numeric_ts): Likewise.
320 (gfc_impure_variable): Likewise.
321 (gfc_pure): Likewise.
322 (gfc_implicit_pure): Likewise.
323 (gfc_elemental): Likewise.
324 (gfc_pure_function): Likewise.
325 (gfc_implicit_pure_function): Likewise.
326 (gfc_compare_array_spec): Likewise.
327 (gfc_constant_ac): Likewise.
328 (gfc_expanded_ac): Likewise.
329 (gfc_check_digit): Likewise.
330 * intrinsic.cc (gfc_find_subroutine): Likewise.
331 (gfc_generic_intrinsic): Likewise.
332 (gfc_specific_intrinsic): Likewise.
333 * io.cc (compare_to_allowed_values): Likewise. And remove
334 unneeded forward declaration.
335 * parse.cc: Likewise.
336 * parse.h (gfc_check_do_variable): Likewise.
337 * primary.cc (gfc_check_digit): Likewise.
338 * resolve.cc (resolve_structure_cons): Likewise.
339 (pure_stmt_function): Likewise.
340 (gfc_pure_function): Likewise.
341 (impure_stmt_fcn): Likewise.
342 (resolve_forall_iterators): Likewise.
343 (resolve_data): Likewise.
344 (gfc_impure_variable): Likewise.
345 (gfc_pure): Likewise.
346 (gfc_unset_implicit_pure): Likewise.
347 * scanner.cc (wide_is_ascii): Likewise.
348 (gfc_wide_toupper): Likewise.
349 (gfc_open_included_file): Likewise.
350 (gfc_at_end): Likewise.
351 (gfc_at_eof): Likewise.
352 (gfc_at_bol): Likewise.
353 (skip_comment_line): Likewise.
354 (gfc_gobble_whitespace): Likewise.
355 * symbol.cc (gfc_find_symtree_in_proc): Likewise.
356 * trans-array.cc: Likewise.
357 * trans-decl.cc (gfc_set_decl_assembler_name): Likewise.
358 * trans-types.cc (gfc_get_element_type): Likewise.
359 (gfc_add_field_to_struct): Likewise.
360 * trans-types.h (gfc_copy_dt_decls_ifequal): Likewise.
361 (gfc_return_by_reference): Likewise.
362 (gfc_is_nodesc_array): Likewise.
363 * trans.h (gfc_can_put_var_on_stack): Likewise.
365 2023-05-17 Harald Anlauf <anlauf@gmx.de>
369 * decl.cc (add_init_expr_to_sym): Set shape of initializer also for
370 zero-sized arrays, so that bounds violations can be detected later.
372 2023-05-17 Tobias Burnus <tobias@codesourcery.com>
374 * trans-decl.cc (gfc_get_symbol_decl): Add attributes
375 such as 'declare target' also to hidden artificial
376 variable for deferred-length character variables.
377 * trans-openmp.cc (gfc_trans_omp_array_section,
378 gfc_trans_omp_clauses, gfc_trans_omp_target_exit_data):
379 Improve mapping of array descriptors and deferred-length
382 2023-05-16 Paul Thomas <pault@gcc.gnu.org>
390 * interface.cc (gfc_compare_actual_formal): Emit an error if an
391 unlimited polymorphic actual is not matched either to an
392 unlimited or assumed type formal argument.
393 * resolve.cc (resolve_ordinary_assign): Emit an error if the
394 var expression of an ordinary assignment is a proc pointer
396 * trans-array.cc (gfc_walk_array_ref): Provide assumed shape
397 arrays coming from interface mapping with a viable arrayspec.
398 * trans-expr.cc (gfc_conv_intrinsic_to_class): Tidy up flagging
399 of unlimited polymorphic 'class_ts'.
400 (gfc_conv_gfc_desc_to_cfi_desc): Assumed type is unlimited
401 polymorphic and should accept any actual type.
402 (gfc_conv_procedure_call): Replace dreadful kludge with a call
403 to gfc_finalize_tree_expr. Avoid dereferencing a void pointer
404 by giving it the pointer type of the actual argument.
405 (alloc_scalar_allocatable_subcomponent): Shorten the function
406 name and replace the symbol argument with the se string length.
407 If a deferred length character length is either not present or
408 is not a variable, give the typespec a variable and assign the
409 string length to that. Use gfc_deferred_strlen to find the
410 hidden string length component.
411 (gfc_trans_subcomponent_assign): Convert the expression before
412 the call to alloc_scalar_allocatable_subcomponent so that a
413 good string length is provided.
414 (gfc_trans_structure_assign): Remove the unneeded derived type
415 symbol from calls to gfc_trans_subcomponent_assign.
417 2023-05-15 Harald Anlauf <anlauf@gmx.de>
420 * expr.cc (gfc_check_vardef_context): Check appropriate pointer
421 attribute for CLASS vs. non-CLASS function result in variable
424 2023-05-11 Xi Ruoyao <xry111@xry111.site>
426 * Make-lang.in: Use grep instead of fgrep.
428 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
430 * dump-parse-tree.cc (gfc_debug_expr): Remove forward declaration.
431 (debug): Add DEBUG_FUNCTION.
432 (show_code_node): Remove erroneous whitespace.
434 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
437 * dump-parse-tree.cc (debug): New function for gfc_namespace.
438 (gfc_debug_code): Delete forward declaration.
439 (show_attr): Make sure to print balanced braces.
441 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
443 * resolve.cc (resolve_select_type): Fix coding style.
445 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
447 * resolve.cc (resolve_select_type): Call free() unconditionally.
449 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
452 * expr.cc (find_array_section): Fix mpz memory leak.
453 * simplify.cc (gfc_simplify_reshape): Fix mpz memory leaks in
456 2023-05-05 Harald Anlauf <anlauf@gmx.de>
459 * arith.cc (eval_intrinsic): Check conformability of ranks of operands
460 for intrinsic binary operators before performing type conversions.
461 * gfortran.h (gfc_op_rank_conformable): Add prototype.
462 * resolve.cc (resolve_operator): Check conformability of ranks of
463 operands for intrinsic binary operators before performing type
465 (gfc_op_rank_conformable): New helper function to compare ranks of
466 operands of binary operator.
468 2023-05-04 Julian Brown <julian@codesourcery.com>
471 * openmp.cc (resolve_omp_clauses): Add diagnostic for
472 non-pointer/non-allocatable attach/detach.
473 * trans-openmp.cc (gfc_trans_omp_clauses): Remove dereference for
474 pointer-to-scalar derived type component attach/detach. Fix
475 attach/detach handling for descriptors.
477 2023-04-28 Julian Brown <julian@codesourcery.com>
480 * trans-openmp.cc (gfc_trans_omp_clauses): Attach/detach clause fixes.
482 2023-04-28 Tobias Burnus <tobias@codesourcery.com>
484 * gfortran.texi: Fix typos.
485 * decl.cc: Fix typos in comments and in a variable name.
486 * arith.cc: Fix comment typos.
487 * check.cc: Likewise.
488 * class.cc: Likewise.
489 * dependency.cc: Likewise.
491 * frontend-passes.cc: Likewise.
492 * gfortran.h: Likewise.
493 * intrinsic.cc: Likewise.
494 * iresolve.cc: Likewise.
495 * match.cc: Likewise.
496 * module.cc: Likewise.
497 * primary.cc: Likewise.
498 * resolve.cc: Likewise.
499 * simplify.cc: Likewise.
500 * trans-array.cc: Likewise.
501 * trans-decl.cc: Likewise.
502 * trans-expr.cc: Likewise.
503 * trans-intrinsic.cc: Likewise.
504 * trans-openmp.cc: Likewise.
505 * trans-stmt.cc: Likewise.
507 2023-04-25 Tobias Burnus <tobias@codesourcery.com>
509 * openmp.cc (gfc_resolve_omp_do_blocks): Handle zero
510 or more than one exec statements before/after 'omp scan'.
511 * trans-openmp.cc (gfc_trans_omp_do): Likewise.
513 2023-04-22 Harald Anlauf <anlauf@gmx.de>
514 Steven G. Kargl <kargl@gcc.gnu.org>
517 * interface.cc (gfc_compare_actual_formal): Reject allocatable
518 functions being used as actual argument for allocable dummy.
520 2023-04-14 Harald Anlauf <anlauf@gmx.de>
523 * simplify.cc (gfc_simplify_set_exponent): Fix implementation of
524 compile-time simplification of intrinsic SET_EXPONENT for argument
527 2023-04-14 Paul Thomas <pault@gcc.gnu.org>
530 * gfortran.h : Add expr3_not_explicit bit field to gfc_code.
531 * resolve.cc (resolve_allocate_expr): Set bit field when the
532 default initializer is applied to expr3.
533 * trans-stmt.cc (gfc_trans_allocate): If expr3_not_explicit is
534 set, do not deallocate expr3.
536 2023-04-13 Harald Anlauf <anlauf@gmx.de>
539 * trans-expr.cc (gfc_conv_power_op): Use absu_hwi and
540 unsigned HOST_WIDE_INT for portability.
542 2023-04-12 Harald Anlauf <anlauf@gmx.de>
545 * resolve.cc (resolve_entries): Handle functions with ENTRY and
547 * trans-expr.cc (gfc_conv_procedure_call): Functions with a result
548 with the POINTER or ALLOCATABLE attribute shall not get any special
549 treatment with -ff2c, as they cannot be written in Fortran 77.
550 * trans-types.cc (gfc_return_by_reference): Likewise.
551 (gfc_get_function_type): Likewise.
553 2023-04-12 Harald Anlauf <anlauf@gmx.de>
557 * interface.cc (compare_parameter): Enable type and rank checks for
558 arguments of derived type from the intrinsic module ISO_C_BINDING.
560 2023-04-08 Paul Thomas <pault@gcc.gnu.org>
563 * iresolve.cc (gfc_resolve_adjustl, gfc_resolve_adjustr): if
564 string length is deferred use the string typespec for result.
565 * resolve.cc (resolve_assoc_var): Handle parentheses around the
567 (resolve_block_construct): Remove unnecessary static decls.
568 * trans-array.cc (gfc_conv_expr_descriptor): Guard string len
569 expression in condition. Improve handling of string length and
570 span, especially for substrings of the descriptor.
571 (duplicate_allocatable): Make element type more explicit with
573 * trans-decl.cc (gfc_get_symbol_decl): Emit a fatal error with
574 appropriate message instead of ICE if symbol type is unknown.
575 (gfc_generate_function_code): Set current locus to proc_sym
577 * trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in
578 'previous' and use if end expression in substring reference is
580 (gfc_conv_string_length): Use gfc_conv_expr_descriptor if
581 'expr_flat' is an array. Add post block to catch deallocation
583 (gfc_conv_procedure_call): Assign the parmse string length to
584 the expression string length, if it is deferred.
585 (gfc_trans_alloc_subarray_assign): If this is a deferred string
586 length component, store the string length in the hidden comp.
587 Update the typespec length accordingly. Generate a new type
588 spec for the call to gfc_duplicate-allocatable in this case.
589 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
590 deferred character array components.
592 2023-04-04 Harald Anlauf <anlauf@gmx.de>
595 * expr.cc (check_restricted): Adjust check for valid variables in
596 restricted expressions: make no exception for module variables.
598 2023-04-01 Thomas Koenig <tkoenig@gcc.gnu.org>
600 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
601 type name to be "long long".
603 2023-03-30 Andrew Pinski <apinski@marvell.com>
605 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
606 type name to be "long long". Add a comment on why adding
609 2023-03-28 Jakub Jelinek <jakub@redhat.com>
612 * openmp.cc (gfc_omp_absent_contains_clause): Fix typo in diagnostics
613 - composit -> composite.
615 2023-03-25 Harald Anlauf <anlauf@gmx.de>
618 * trans-decl.cc (gfc_conv_cfi_to_gfc): Remove dead code.
620 2023-03-24 Harald Anlauf <anlauf@gmx.de>
622 * expr.cc (free_expr0): Free also BOZ strings as part of an expression.
624 2023-03-24 Haochen Gui <guihaoc@gcc.gnu.org>
625 Tobias Burnus <tobias@codesourcery.com>
628 * target-memory.cc (gfc_interpret_float): Return FAIL when
629 native_interpret_expr gets a NULL tree.
630 * arith.cc (gfc_hollerith2real): Return NULL when
631 gfc_interpret_float fails.
632 * error.cc (gfc_buffered_p): Define.
633 * gfortran.h (gfc_buffered_p): Declare.
634 * intrinsic.cc: Add diagnostic.h to include list.
635 (do_simplify): Save errorcount and check it at finish. Report a
636 "Cannot simplify expression" error on a bad result if error count
637 doesn't change and no other errors buffered.
639 2023-03-22 Harald Anlauf <anlauf@gmx.de>
640 Steven G. Kargl <kargl@gcc.gnu.org>
643 * resolve.cc (gfc_resolve_finalizers): Argument of a FINAL subroutine
644 cannot be an alternate return.
646 2023-03-21 Harald Anlauf <anlauf@gmx.de>
649 * decl.cc (gfc_match_modproc): Reject MODULE PROCEDURE if not in a
650 generic module interface.
652 2023-03-21 Arsen Arsenović <arsen@aarsen.me>
654 * invoke.texi: Remove usages of @gol.
655 * intrinsic.texi: Ditto.
657 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
660 * trans-array.cc (gfc_trans_array_constructor_value): Correct
661 incorrect setting of typespec.
663 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
666 * resolve.cc (generate_component_assignments): Restore the
667 exclusion of allocatable components from the loop.
669 2023-03-20 Harald Anlauf <anlauf@gmx.de>
672 * invoke.texi: Correct documentation of how underscores are appended
675 2023-03-20 Harald Anlauf <anlauf@gmx.de>
678 * simplify.cc (gfc_simplify_nearest): Fix off-by-one error in setting
679 up real kind-specific maximum exponent for mpfr.
681 2023-03-20 Paul Thomas <pault@gcc.gnu.org>
684 * resolve.cc (check_host_association): If an external function
685 is typed but not declared explicitly to be external, change the
686 old symbol from a variable to an external function.
688 2023-03-19 Harald Anlauf <anlauf@gmx.de>
691 * resolve.cc (resolve_fl_procedure): Check for an explicit interface
692 of procedures with the BIND(C) attribute (F2018:15.4.2.2).
694 2023-03-19 Thomas Koenig <tkoenig@gcc.gnu.org>
696 * gfortran.texi: Mention behavior on overflow.
698 2023-03-18 Paul Thomas <pault@gcc.gnu.org>
703 * class.cc (finalize_component): Include the missing arguments
704 in the call to the component's finalizer wrapper.
705 (has_finalizer_component): Do not return true for procedure
707 (finalizer_insert_packed_call): Remove the redundant argument
708 in the call to the final subroutine.
709 (generate_finalization_wrapper): Add support for assumed rank
711 (gfc_may_be_finalized): New helper function.
712 * dump-parse-tree.cc (write_proc): Whitespace.
713 * gfortran.h : Add prototype for gfc_may_be_finalized.
714 * resolve.cc (resolve_function): Correct derived types that
715 have an incomplete namespace.
716 (resolve_where, gfc_resolve_where_code_in_forall,
717 gfc_resolve_forall_body, gfc_resolve_code): Check that the op
718 code is still EXEC_ASSIGN. If it is set lhs to must finalize.
719 (is_finalizable_type): New function.
720 (generate_component_assignments): Set must_finalize if needed.
721 (gfc_resolve_finalizers): Error if assumed rank finalizer is
722 not the only one. Warning on lack of scalar finalizer modified
723 to account for assumed rank finalizers.
724 (generate_final_call): New function.
725 (generate_component_assignments): Enclose the outermost call in
726 a block to capture automatic deallocation and final calls.
727 Set must_finalize as required to satisfy the standards. Use an
728 explicit pointer assignment for pointer components to capture
729 finalization of the target. Likewise use explicit assignment
730 for allocatable components. Do not use the temporary copy of
731 the lhs in defined assignment if the component is allocatable.
732 Put the temporary in the same namespace as the lhs symbol if
733 the component may be finalized. Remove the leading assignment
734 from the expansion of assignment of components that have their
735 own defined assignment components. Suppress finalization of
736 assignment of temporary components to the lhs. Make an explicit
737 final call for the rhs function temporary if it exists.
738 (gfc_resolve_code): Set must_finalize for assignments with an
739 array constructor on the rhs.
740 (gfc_resolve_finalizers): Ensure that an assumed rank finalizer
741 is the only finalizer for that type and correct the surprising
742 warning for the lack of a scalar finalizer.
743 (check_defined_assignments): Handle allocatable components.
744 (resolve_fl_derived): Set referenced the vtab for use
746 (resolve_symbol): Set referenced an unreferenced symbol that
748 * trans-array.cc (gfc_trans_array_constructor_value): Add code
749 to finalize the constructor result. Warn that this feature was
750 removed in F2018 and that it is suppressed by -std=2018.
751 (trans_array_constructor): Add finalblock, pass to previous
752 and apply to loop->post if filled.
753 (gfc_add_loop_ss_code): Add se finalblock to outer loop post.
754 (gfc_trans_array_cobounds, gfc_trans_array_bounds): Add any
755 generated finalization code to the main block.
756 (structure_alloc_comps): Add boolean argument to suppress
757 finalization and use it for calls from
758 gfc_deallocate_alloc_comp_no_caf. Otherwise it defaults to
760 (gfc_copy_alloc_comp_no_fini): New wrapper for
761 structure_alloc_comps.
762 (gfc_alloc_allocatable_for_assignment): Suppress finalization
763 by setting new arg in call to gfc_deallocate_alloc_comp_no_caf.
764 (gfc_trans_deferred_array): Use gfc_may_be_finalized and do not
765 deallocate the components of entities with a leading '_' in the
766 name that are also marked as artificial.
767 * trans-array.h : Add the new boolean argument to the prototype
768 of gfc_deallocate_alloc_comp_no_caf with a default of false.
769 Add prototype for gfc_copy_alloc_comp_no_fini.
770 * trans-decl.cc(init_intent_out_dt): Tidy up the code.
771 * trans-expr.cc (gfc_init_se): Initialize finalblock.
772 (gfc_conv_procedure_call): Use gfc_finalize_tree_expr to
773 finalize function results. Replace in-line block for class
774 results with call to new function.
775 (gfc_conv_expr): Finalize structure constructors for F2003 and
776 F2008. Warn that this feature was deleted in F2018 and, unlike
777 array constructors, is not default. Add array constructor
778 finalblock to the post block.
779 (gfc_trans_scalar_assign): Suppress finalization by setting new
780 argument in call to gfc_deallocate_alloc_comp_no_caf. Add the
781 finalization blocks to the main block.
782 (gfc_trans_arrayfunc_assign): Use gfc_assignment_finalizer_call
783 and ensure that finalization occurs after the evaluation of the
784 rhs but using the initial value for the lhs. Finalize rhs
785 function results using gfc_finalize_tree_expr.
786 (trans_class_assignment, gfc_trans_assignment_1): As previous
787 function, taking care to order evaluation, assignment and
788 finalization correctly.
789 * trans-io.cc (gfc_trans_transfer): Add the final block.
790 * trans-stmt.cc (gfc_trans_call, gfc_trans_allocate): likewise.
791 (trans_associate_var): Nullify derived allocatable components
792 and finalize function targets with defined assignment
793 components on leaving the block scope.
794 (trans_allocate): Finalize source expressions, if required,
795 and set init_expr artificial temporarily to suppress the
796 finalization in gfc_trans_assignment.
797 * trans.cc (gfc_add_finalizer_call): Do not finalize the
798 temporaries generated in type assignment with defined
799 assignment components.
800 (gfc_assignment_finalizer_call): New function.
801 (gfc_finalize_tree_expr): New function.
802 * trans.h: Add finalblock to gfc_se. Add the prototypes for
803 gfc_finalize_tree_expr and gfc_assignment_finalizer_call.
805 2023-03-15 Harald Anlauf <anlauf@gmx.de>
806 Tobias Burnus <tobias@codesourcery.com>
809 * interface.cc (compare_parameter): Adjust check of array dummy
810 arguments to handle the case of CLASS variables.
812 2023-03-11 Harald Anlauf <anlauf@gmx.de>
815 * trans-expr.cc (gfc_copy_class_to_class): Convert element counts in
816 bounds check to common type for comparison.
818 2023-03-10 Harald Anlauf <anlauf@gmx.de>
821 * resolve.cc (resolve_symbol): Avoid NULL pointer dereference while
822 checking a symbol with the BIND(C) attribute.
824 2023-03-05 Harald Anlauf <anlauf@gmx.de>
825 Tobias Burnus <tobias@codesourcery.com>
828 * class.cc (gfc_build_class_symbol): Handle update of attributes of
829 existing class container.
830 (gfc_find_derived_vtab): Fix several memory leaks.
831 (find_intrinsic_vtab): Ditto.
832 * decl.cc (attr_decl1): Manage update of symbol attributes from
834 * primary.cc (gfc_variable_attr): OPTIONAL shall not be taken or
835 updated from the class container.
836 * symbol.cc (free_old_symbol): Adjust management of symbol versions
837 to not prematurely free array specs while working on the declation
840 2023-03-01 Tobias Burnus <tobias@codesourcery.com>
843 * trans-openmp.cc (gfc_trans_omp_clauses): Fix mapping of
844 type(C_ptr) variables.
846 2023-02-27 Harald Anlauf <anlauf@gmx.de>
849 * trans-intrinsic.cc (gfc_conv_intrinsic_ibits): Handle corner case
850 LEN argument of IBITS equal to BITSIZE(I).
852 2023-02-25 Mikael Morin <mikael@gcc.gnu.org>
855 * intrinsic.cc (get_intrinsic_dummy_arg,
856 set_intrinsic_dummy_arg): Rename the former to the latter.
857 Remove the return value, add a reference to the lhs as argument,
858 and do the pointer assignment inside the function. Don't do
859 it if the pointer is already non-NULL.
860 (sort_actual): Update caller.
862 2023-02-25 Harald Anlauf <anlauf@gmx.de>
864 * arith.cc (gfc_real2int): Clear mpfr variable after use.
866 2023-02-25 Tobias Burnus <tobias@codesourcery.com>
869 * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Skip setting of
870 bounds of CFI desc for 'pointer,intent(out)'.
872 2023-02-24 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
874 * trans-decl.cc (gfc_finish_var_decl): Apply attribute.
875 (generate_local_decl): Add diagnostic for dummy and local variables.
877 2023-02-24 Mikael Morin <mikael@gcc.gnu.org>
880 * expr.cc (gfc_free_actual_arglist): Free associated_dummy
882 (gfc_copy_actual_arglist): Make a copy of the associated_dummy
883 field if it is set in the original element.
885 2023-02-24 Harald Anlauf <anlauf@gmx.de>
888 * frontend-passes.cc (do_subscript): Clear used gmp variable.
890 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
892 * invoke.texi: Reorder index entries around @items.
894 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
896 * invoke.texi: Reorder @opindex commands to precede @items they
899 2023-02-22 Harald Anlauf <anlauf@gmx.de>
902 * resolve.cc (resolve_component): The type of a CHARACTER length
903 expression must be INTEGER.
905 2023-02-21 Harald Anlauf <anlauf@gmx.de>
908 * parse.cc (check_function_result_typed): Improve type check of
909 specification expression for character length and return status.
910 (parse_spec): Use status from above.
911 * resolve.cc (resolve_fntype): Prevent use of invalid specification
912 expression for character length.
914 2023-02-16 Patrick Palka <ppalka@redhat.com>
916 * gfortran.h: Mechanically drop static from static inline
917 functions via s/^static inline/inline/g.
919 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
922 * frontend-passes.cc (do_intent): Catch NULL pointer dereference on
923 reference to invalid formal argument.
925 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
928 * resolve.cc (check_assumed_size_reference): Avoid NULL pointer
931 2023-02-15 Tobias Burnus <tobias@codesourcery.com>
934 * openmp.cc (gfc_resolve_omp_parallel_blocks): Handle combined 'loop'
936 (gfc_resolve_do_iterator): Set a source location for added
937 'private'-clause arguments.
938 * resolve.cc (gfc_resolve_code): Call gfc_resolve_omp_do_blocks
939 also for EXEC_OMP_LOOP and gfc_resolve_omp_parallel_blocks for
940 combined directives with loop + '{masked,master} taskloop (simd)'.
942 2023-02-13 Harald Anlauf <anlauf@gmx.de>
945 * primary.cc (gfc_expr_attr): Avoid NULL pointer dereference for
946 invalid use of CLASS variable.
948 2023-02-13 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
950 * decl.cc: Add EXT_ATTR_NOINLINE, EXT_ATTR_NORETURN, EXT_ATTR_WEAK.
951 * gfortran.h (ext_attr_id_t): Ditto.
952 * gfortran.texi (GCC$ ATTRIBUTES): Document them.
953 * trans-decl.cc (build_function_decl): Apply them.
955 2023-02-09 Harald Anlauf <anlauf@gmx.de>
956 Steven G. Kargl <kargl@gcc.gnu.org>
960 * intrinsic.cc (gfc_convert_chartype): Recover on invalid character
961 kind in conversion instead of generating an internal error.
963 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
966 * trans-openmp.cc (struct dovar_init_d): Add 'sym' and
967 'non_unit_incr' members.
968 (gfc_nonrect_loop_expr): New.
969 (gfc_trans_omp_do): Call it; use normal loop bounds
970 for unit stride - and only create local loop var.
972 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
974 * parse.cc (decode_omp_directive): Really ignore 'assumes' with
977 2023-02-08 Steve Kargl <kargl@gcc.gnu.org>
980 * resolve.cc (resolve_common_vars): Avoid NULL pointer dereference
981 when a symbol's location is not set.
983 2023-02-07 Harald Anlauf <anlauf@gmx.de>
986 * trans-decl.cc (gfc_finish_var_decl): With -fno-automatic, do not
987 make ASSOCIATE variables TREE_STATIC.
989 2023-02-05 Harald Anlauf <anlauf@gmx.de>
992 * arith.cc (gfc_arith_divide): Emit integer division truncation
993 warnings using gfc_warning instead of gfc_warning_now to prevent
996 2023-02-03 Jakub Jelinek <jakub@redhat.com>
999 * trans-decl.cc (gfc_trans_use_stmts): Call clear_slot before
1002 2023-02-01 Harald Anlauf <anlauf@gmx.de>
1005 * expr.cc (find_array_section): Add check to prevent interpreting an
1006 mpz non-integer constant as an integer.
1008 2023-02-01 Tobias Burnus <tobias@codesourcery.com>
1010 * openmp.cc (resolve_omp_clauses): Check also for
1013 2023-01-29 Mikael Morin <mikael@gcc.gnu.org>
1016 * check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
1017 (gfc_check_findloc): Ditto.
1019 2023-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1022 * parse.cc (parse_module): Remove use of a bool error value
1023 that prevented proper setting of the namespace pointer.
1025 2023-01-28 Harald Anlauf <anlauf@gmx.de>
1026 Steven G. Kargl <kargl@gcc.gnu.org>
1029 * resolve.cc (compare_bound_int): Expression to compare must be of
1031 (compare_bound_mpz_t): Likewise.
1032 (check_dimension): Fix comment on checks applied to array section
1033 and clean up associated logic.
1035 2023-01-28 Harald Anlauf <anlauf@gmx.de>
1038 * match.cc (gfc_match_common): A USE associated name shall not appear
1039 in a COMMON block (F2018:C8121).
1041 2023-01-27 Tobias Burnus <tobias@codesourcery.com>
1044 * trans-openmp.cc (gfc_split_omp_clauses): Handle has_device_addr.
1046 2023-01-26 Harald Anlauf <anlauf@gmx.de>
1049 * resolve.cc (check_host_association): Extend host association check
1050 so that it is not restricted to functions. Also prevent NULL pointer
1053 2023-01-25 Steve Kargl <kargl@gcc.gnu.org>
1056 * array.cc (compare_bounds): Return false instead of generating an
1057 internal error on an invalid argument type.
1059 2023-01-24 Harald Anlauf <anlauf@gmx.de>
1062 * simplify.cc (simplify_transformation): Do not try to simplify
1063 transformational intrinsic when the ARRAY argument has a NULL shape.
1065 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1068 * dependency.cc (gfc_check_dependency): Prevent NULL pointer
1069 dereference while recursively checking expressions.
1071 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1074 * interface.cc (get_expr_storage_size): Check array subscript triplets
1075 that we actually have integer values before trying to extract with
1078 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1081 * iresolve.cc (check_charlen_present): Preserve character length if
1082 there is no array constructor.
1084 2023-01-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1087 * data.cc (gfc_assign_data_value): Remove check for PARAMETER in DATA.
1088 * primary.cc (match_variable): Add check for PARAMETER in DATA.
1090 2023-01-19 Harald Anlauf <anlauf@gmx.de>
1093 * expr.cc (class_allocatable): Prevent NULL pointer dereference
1095 (class_pointer): Likewise.
1097 2023-01-17 Harald Anlauf <anlauf@gmx.de>
1100 * interface.cc (get_expr_storage_size): Check that we actually have
1101 an integer value before trying to extract it with mpz_get_si.
1103 2023-01-12 Tobias Burnus <tobias@codesourcery.com>
1106 * openmp.cc (gfc_resolve_omp_assumptions): Reject nonscalars.
1108 2023-01-11 Jakub Jelinek <jakub@redhat.com>
1111 * f95-lang.cc (gfc_init_builtin_function): Fix up function types
1112 for BUILT_IN_REALLOC and BUILT_IN_SINCOS{F,,L}. Formatting fixes.
1114 2023-01-10 Harald Anlauf <anlauf@gmx.de>
1117 * frontend-passes.cc (do_subscript): Clear used gmp variables.
1119 2023-01-02 Jakub Jelinek <jakub@redhat.com>
1121 * gfortranspec.cc (lang_specific_driver): Update copyright notice
1123 * gfc-internals.texi: Bump @copying's copyright year.
1124 * gfortran.texi: Ditto.
1125 * intrinsic.texi: Ditto.
1126 * invoke.texi: Ditto.
1129 Copyright (C) 2023 Free Software Foundation, Inc.
1131 Copying and distribution of this file, with or without modification,
1132 are permitted in any medium without royalty provided the copyright
1133 notice and this notice are preserved.