1 2023-06-23 Harald Anlauf <anlauf@gmx.de>
4 * trans-expr.cc (gfc_conv_procedure_call): Pass actual argument
5 to scalar CHARACTER(1),VALUE dummy argument by value.
7 2023-06-21 Paul Thomas <pault@gcc.gnu.org>
14 * decl.cc (char_len_param_value): Fix memory leak.
15 (resolve_block_construct): Remove unnecessary static decls.
16 * expr.cc (gfc_is_ptr_fcn): New function.
17 (gfc_check_vardef_context): Use it to permit pointer function
18 result selectors to be used for associate names in variable
20 * gfortran.h: Prototype for gfc_is_ptr_fcn.
21 * match.cc (build_associate_name): New function.
22 (gfc_match_select_type): Use the new function to replace inline
23 version and to build a new associate name for the case where
24 the supplied associate name is already used for that purpose.
25 * resolve.cc (resolve_assoc_var): Call gfc_is_ptr_fcn to allow
26 associate names with pointer function targets to be used in
27 variable definition context.
28 * trans-decl.cc (gfc_get_symbol_decl): Unlimited polymorphic
29 variables need deferred initialisation of the vptr.
30 (gfc_trans_deferred_vars): Do the vptr initialisation.
31 * trans-stmt.cc (trans_associate_var): Ensure that a pointer
32 associate name points to the target of the selector and not
35 2023-06-21 Paul Thomas <pault@gcc.gnu.org>
38 * trans-expr.cc (gfc_conv_procedure_call): The hidden string
39 length must not be passed to a formal arg of type(cptr).
41 2023-06-20 Tobias Burnus <tobias@codesourcery.com>
43 * dump-parse-tree.cc (show_omp_namelist): Fix dump of the allocator
44 modifier of OMP_LIST_ALLOCATE.
46 2023-06-20 Tobias Burnus <tobias@codesourcery.com>
48 * match.cc (gfc_match_char): Match with '%S' a symbol
51 2023-06-19 Tobias Burnus <tobias@codesourcery.com>
53 * intrinsic.texi (OpenMP Modules OMP_LIB and OMP_LIB_KINDS): Also
54 add references to the OpenMP 5.1 and 5.2 spec; add omp_initial_device
55 and omp_invalid_device named constants.
57 2023-06-13 Harald Anlauf <anlauf@gmx.de>
58 Mikael Morin <mikael@gcc.gnu.org>
61 * trans-array.cc (gfc_trans_allocate_array_storage): When passing a
62 zero-sized array with fixed (= non-dynamic) size, allocate temporary
63 by the caller, not by the callee.
65 2023-06-10 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
67 * f95-lang.cc (gfc_init_builtin_functions): Add fmax() and
68 fmin() built-ins, and their variants.
69 * mathbuiltins.def: Add FMAX and FMIN built-ins.
70 * trans-intrinsic.cc (conv_intrinsic_ieee_minmax): New function.
71 (gfc_conv_ieee_arithmetic_function): Handle IEEE_MIN_NUM and
72 IEEE_MAX_NUM functions.
74 2023-06-09 Jakub Jelinek <jakub@redhat.com>
77 * primary.cc (gfc_convert_to_structure_constructor): Only do
78 constant string ctor length verification and truncation/padding
79 if constant length has INTEGER type.
81 2023-06-08 Paul Thomas <pault@gcc.gnu.org>
87 * decl.cc (char_len_param_value): Simplify a copy of the expr
88 and replace the original if there is no error.
89 * gfortran.h : Remove the redundant field 'rankguessed' from
90 'gfc_association_list'.
91 * resolve.cc (resolve_assoc_var): Remove refs to 'rankguessed'.
92 (resolve_variable): Associate names with constant or structure
93 constructor targets cannot have array refs.
94 * trans-array.cc (gfc_conv_expr_descriptor): Guard expression
95 character length backend decl before using it. Suppress the
96 assignment if lhs equals rhs.
97 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
98 associate variables pointing to a variable. Add comment.
99 * trans-stmt.cc (trans_associate_var): Remove requirement that
100 the character length be deferred before assigning the value
101 returned by gfc_conv_expr_descriptor. Also, guard the backend
102 decl before testing with VAR_P.
104 2023-06-06 Kwok Cheung Yeung <kcy@codesourcery.com>
105 Tobias Burnus <tobias@codesourcery.com>
107 * dump-parse-tree.cc (show_omp_namelist): Display 'present' map
109 (show_omp_clauses): Display 'present' motion modifier for 'to'
111 * gfortran.h (enum gfc_omp_map_op): Add entries with 'present'
113 (struct gfc_omp_namelist): Add 'present_modifer'.
114 * openmp.cc (gfc_match_motion_var_list): New, handles optional
115 'present' modifier for to/from clauses.
116 (gfc_match_omp_clauses): Call it for to/from clauses; parse 'present'
117 in defaultmap and map clauses.
118 (resolve_omp_clauses): Allow 'present' modifiers on 'target',
119 'target data', 'target enter' and 'target exit' directives.
120 * trans-openmp.cc (gfc_trans_omp_clauses): Apply 'present' modifiers
121 to tree node for 'map', 'to' and 'from' clauses. Apply 'present' for
124 2023-06-02 Steve Kargl <kargl@gcc.gnu.org>
127 * resolve.cc (resolve_select_rank): Remove duplicate error.
128 (resolve_fl_var_and_proc): Prevent NULL pointer dereference and
129 suppress error message for temporary.
131 2023-06-02 Paul Thomas <pault@gcc.gnu.org>
134 * parse.cc (parse_associate): Replace the existing evaluation
135 of the target rank with calls to gfc_resolve_ref and
136 gfc_expression_rank. Identify untyped target function results
137 with structure constructors by finding the appropriate derived
139 * resolve.cc (resolve_symbol): Allow associate variables to be
142 2023-06-01 Harald Anlauf <anlauf@gmx.de>
145 * decl.cc (gfc_match_kind_spec): Use error path on missing right
147 (gfc_match_decl_type_spec): Use error return when an error occurred
148 during matching a KIND specifier.
150 2023-06-01 Tobias Burnus <tobias@codesourcery.com>
152 * parse.cc (decode_omp_directive): Accept all pure directives
153 inside a PURE procedures; handle 'error at(execution).
155 2023-05-26 Tobias Burnus <tobias@codesourcery.com>
157 * dump-parse-tree.cc (show_omp_namelist): Update allocator, fix
159 (show_omp_node, show_code_node): Handle EXEC_OMP_ALLOCATE.
160 * gfortran.h (enum gfc_statement): Add ST_OMP_ALLOCATE and ..._EXEC.
161 (enum gfc_exec_op): Add EXEC_OMP_ALLOCATE.
162 (struct gfc_omp_namelist): Add 'allocator' to 'u2' union.
163 (struct gfc_namespace): Add omp_allocate.
164 (gfc_resolve_omp_allocate): New.
165 * match.cc (gfc_free_omp_namelist): Free 'u2.allocator'.
166 * match.h (gfc_match_omp_allocate, gfc_match_omp_allocators): New.
167 * openmp.cc (gfc_omp_directives): Uncomment allocate/allocators.
168 (gfc_match_omp_variable_list): Add bool arg for
169 rejecting listening common-block vars separately.
170 (gfc_match_omp_clauses): Update for u2.allocators.
171 (OMP_ALLOCATORS_CLAUSES, gfc_match_omp_allocate,
172 gfc_match_omp_allocators, is_predefined_allocator,
173 gfc_resolve_omp_allocate): New.
174 (resolve_omp_clauses): Update 'allocate' clause checks.
175 (omp_code_to_statement, gfc_resolve_omp_directive): Handle
176 OMP ALLOCATE/ALLOCATORS.
177 * parse.cc (in_exec_part): New global var.
178 (check_omp_allocate_stmt, parse_openmp_allocate_block): New.
179 (decode_omp_directive, case_exec_markers, case_omp_decl,
180 gfc_ascii_statement, parse_omp_structured_block): Handle
181 OMP allocate/allocators.
182 (verify_st_order, parse_executable): Set in_exec_part.
183 * resolve.cc (gfc_resolve_blocks, resolve_codes): Handle
185 * st.cc (gfc_free_statement): Likewise.
186 * trans.cc (trans_code): Likewise.
187 * trans-openmp.cc (gfc_trans_omp_directive): Likewise.
188 (gfc_trans_omp_clauses, gfc_split_omp_clauses): Update for
189 u2.allocator, fix for u.align.
191 2023-05-24 Harald Anlauf <anlauf@gmx.de>
194 * simplify.cc (simplify_size): Reject DIM argument of intrinsic SIZE
195 with error when out of valid range.
197 2023-05-24 Harald Anlauf <anlauf@gmx.de>
200 * check.cc (gfc_check_reshape): Expand constant arguments SHAPE and
201 ORDER before checking.
202 * gfortran.h (gfc_is_constant_array_expr): Add prototype.
203 * iresolve.cc (gfc_resolve_reshape): Expand constant argument SHAPE.
204 * simplify.cc (is_constant_array_expr): If array is determined to be
205 constant, expand small array constructors if needed.
206 (gfc_is_constant_array_expr): Wrapper for is_constant_array_expr.
207 (gfc_simplify_reshape): Fix check for insufficient elements in SOURCE
208 when no padding specified.
210 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
213 * resolve.cc (gfc_resolve_ref): Conversion of array_ref into an
214 element should be done for all characters without a len expr,
215 not just deferred lens, and for integer expressions.
216 * trans-expr.cc (conv_inquiry): For len and kind inquiry refs,
217 set the se string_length to NULL_TREE.
219 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
220 Steven G. Kargl <kargl@gcc.gnu.org>
223 * decl.cc (variable_decl): Clean up white space issues.
224 (gfc_match_final_decl): Declaration of finalizable derived type
225 is allowed in a submodule.
227 2023-05-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
229 * expr.cc (gfc_get_corank): Use CLASS_DATA from gfortran.h.
230 * resolve.cc (resolve_component): Same.
231 (resolve_fl_derived0): Same.
232 * simplify.cc (gfc_simplify_extends_type_of): Same.
233 (simplify_cobound): Same.
235 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
237 * trans-array.cc (is_pointer_array): Use _P() defines from tree.h.
238 (gfc_conv_scalarized_array_ref): Ditto.
239 (gfc_conv_array_ref): Ditto.
240 * trans-decl.cc (gfc_finish_decl): Ditto.
241 (gfc_get_symbol_decl): Ditto.
242 * trans-expr.cc (gfc_trans_pointer_assignment): Ditto.
243 (gfc_trans_arrayfunc_assign): Ditto.
244 (gfc_trans_assignment_1): Ditto.
245 * trans-intrinsic.cc (gfc_conv_intrinsic_minmax): Ditto.
246 (conv_intrinsic_ieee_value): Ditto.
247 * trans-io.cc (gfc_convert_array_to_string): Ditto.
248 * trans-openmp.cc (gfc_omp_is_optional_argument): Ditto.
249 (gfc_trans_omp_clauses): Ditto.
250 * trans-stmt.cc (gfc_conv_label_variable): Ditto.
251 * trans.cc (gfc_build_addr_expr): Ditto.
252 (get_array_span): Ditto.
254 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
257 * array.cc (compare_bounds): Use narrower return type.
258 (gfc_compare_array_spec): Likewise.
259 (is_constant_element): Likewise.
260 (gfc_constant_ac): Likewise.
261 * check.cc (dim_rank_check): Likewise.
262 * cpp.cc (gfc_cpp_init_options): Likewise.
263 (dump_macro): Likewise.
264 * cpp.h (gfc_cpp_handle_option): Likewise.
265 * dependency.cc (gfc_ref_needs_temporary_p): Likewise.
266 (gfc_check_argument_dependency): Likewise.
267 (gfc_check_fncall_dependency): Likewise.
268 (ref_same_as_full_array): Likewise.
269 * dependency.h (gfc_check_fncall_dependency): Likewise.
270 (gfc_dep_resolver): Likewise.
271 (gfc_are_equivalenced_arrays): Likewise.
272 * expr.cc (gfc_copy_ref): Likewise.
273 (gfc_kind_max): Likewise.
274 (numeric_type): Likewise.
275 * gfortran.h (gfc_at_end): Likewise.
276 (gfc_at_eof): Likewise.
277 (gfc_at_bol): Likewise.
278 (gfc_at_eol): Likewise.
279 (gfc_define_undef_line): Likewise.
280 (gfc_wide_is_printable): Likewise.
281 (gfc_wide_is_digit): Likewise.
282 (gfc_wide_fits_in_byte): Likewise.
283 (gfc_find_sym_tree): Likewise.
284 (gfc_generic_intrinsic): Likewise.
285 (gfc_specific_intrinsic): Likewise.
286 (gfc_intrinsic_actual_ok): Likewise.
287 (gfc_has_vector_index): Likewise.
288 (gfc_numeric_ts): Likewise.
289 (gfc_impure_variable): Likewise.
290 (gfc_pure): Likewise.
291 (gfc_implicit_pure): Likewise.
292 (gfc_elemental): Likewise.
293 (gfc_pure_function): Likewise.
294 (gfc_implicit_pure_function): Likewise.
295 (gfc_compare_array_spec): Likewise.
296 (gfc_constant_ac): Likewise.
297 (gfc_expanded_ac): Likewise.
298 (gfc_check_digit): Likewise.
299 * intrinsic.cc (gfc_find_subroutine): Likewise.
300 (gfc_generic_intrinsic): Likewise.
301 (gfc_specific_intrinsic): Likewise.
302 * io.cc (compare_to_allowed_values): Likewise. And remove
303 unneeded forward declaration.
304 * parse.cc: Likewise.
305 * parse.h (gfc_check_do_variable): Likewise.
306 * primary.cc (gfc_check_digit): Likewise.
307 * resolve.cc (resolve_structure_cons): Likewise.
308 (pure_stmt_function): Likewise.
309 (gfc_pure_function): Likewise.
310 (impure_stmt_fcn): Likewise.
311 (resolve_forall_iterators): Likewise.
312 (resolve_data): Likewise.
313 (gfc_impure_variable): Likewise.
314 (gfc_pure): Likewise.
315 (gfc_unset_implicit_pure): Likewise.
316 * scanner.cc (wide_is_ascii): Likewise.
317 (gfc_wide_toupper): Likewise.
318 (gfc_open_included_file): Likewise.
319 (gfc_at_end): Likewise.
320 (gfc_at_eof): Likewise.
321 (gfc_at_bol): Likewise.
322 (skip_comment_line): Likewise.
323 (gfc_gobble_whitespace): Likewise.
324 * symbol.cc (gfc_find_symtree_in_proc): Likewise.
325 * trans-array.cc: Likewise.
326 * trans-decl.cc (gfc_set_decl_assembler_name): Likewise.
327 * trans-types.cc (gfc_get_element_type): Likewise.
328 (gfc_add_field_to_struct): Likewise.
329 * trans-types.h (gfc_copy_dt_decls_ifequal): Likewise.
330 (gfc_return_by_reference): Likewise.
331 (gfc_is_nodesc_array): Likewise.
332 * trans.h (gfc_can_put_var_on_stack): Likewise.
334 2023-05-17 Harald Anlauf <anlauf@gmx.de>
338 * decl.cc (add_init_expr_to_sym): Set shape of initializer also for
339 zero-sized arrays, so that bounds violations can be detected later.
341 2023-05-17 Tobias Burnus <tobias@codesourcery.com>
343 * trans-decl.cc (gfc_get_symbol_decl): Add attributes
344 such as 'declare target' also to hidden artificial
345 variable for deferred-length character variables.
346 * trans-openmp.cc (gfc_trans_omp_array_section,
347 gfc_trans_omp_clauses, gfc_trans_omp_target_exit_data):
348 Improve mapping of array descriptors and deferred-length
351 2023-05-16 Paul Thomas <pault@gcc.gnu.org>
359 * interface.cc (gfc_compare_actual_formal): Emit an error if an
360 unlimited polymorphic actual is not matched either to an
361 unlimited or assumed type formal argument.
362 * resolve.cc (resolve_ordinary_assign): Emit an error if the
363 var expression of an ordinary assignment is a proc pointer
365 * trans-array.cc (gfc_walk_array_ref): Provide assumed shape
366 arrays coming from interface mapping with a viable arrayspec.
367 * trans-expr.cc (gfc_conv_intrinsic_to_class): Tidy up flagging
368 of unlimited polymorphic 'class_ts'.
369 (gfc_conv_gfc_desc_to_cfi_desc): Assumed type is unlimited
370 polymorphic and should accept any actual type.
371 (gfc_conv_procedure_call): Replace dreadful kludge with a call
372 to gfc_finalize_tree_expr. Avoid dereferencing a void pointer
373 by giving it the pointer type of the actual argument.
374 (alloc_scalar_allocatable_subcomponent): Shorten the function
375 name and replace the symbol argument with the se string length.
376 If a deferred length character length is either not present or
377 is not a variable, give the typespec a variable and assign the
378 string length to that. Use gfc_deferred_strlen to find the
379 hidden string length component.
380 (gfc_trans_subcomponent_assign): Convert the expression before
381 the call to alloc_scalar_allocatable_subcomponent so that a
382 good string length is provided.
383 (gfc_trans_structure_assign): Remove the unneeded derived type
384 symbol from calls to gfc_trans_subcomponent_assign.
386 2023-05-15 Harald Anlauf <anlauf@gmx.de>
389 * expr.cc (gfc_check_vardef_context): Check appropriate pointer
390 attribute for CLASS vs. non-CLASS function result in variable
393 2023-05-11 Xi Ruoyao <xry111@xry111.site>
395 * Make-lang.in: Use grep instead of fgrep.
397 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
399 * dump-parse-tree.cc (gfc_debug_expr): Remove forward declaration.
400 (debug): Add DEBUG_FUNCTION.
401 (show_code_node): Remove erroneous whitespace.
403 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
406 * dump-parse-tree.cc (debug): New function for gfc_namespace.
407 (gfc_debug_code): Delete forward declaration.
408 (show_attr): Make sure to print balanced braces.
410 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
412 * resolve.cc (resolve_select_type): Fix coding style.
414 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
416 * resolve.cc (resolve_select_type): Call free() unconditionally.
418 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
421 * expr.cc (find_array_section): Fix mpz memory leak.
422 * simplify.cc (gfc_simplify_reshape): Fix mpz memory leaks in
425 2023-05-05 Harald Anlauf <anlauf@gmx.de>
428 * arith.cc (eval_intrinsic): Check conformability of ranks of operands
429 for intrinsic binary operators before performing type conversions.
430 * gfortran.h (gfc_op_rank_conformable): Add prototype.
431 * resolve.cc (resolve_operator): Check conformability of ranks of
432 operands for intrinsic binary operators before performing type
434 (gfc_op_rank_conformable): New helper function to compare ranks of
435 operands of binary operator.
437 2023-05-04 Julian Brown <julian@codesourcery.com>
440 * openmp.cc (resolve_omp_clauses): Add diagnostic for
441 non-pointer/non-allocatable attach/detach.
442 * trans-openmp.cc (gfc_trans_omp_clauses): Remove dereference for
443 pointer-to-scalar derived type component attach/detach. Fix
444 attach/detach handling for descriptors.
446 2023-04-28 Julian Brown <julian@codesourcery.com>
449 * trans-openmp.cc (gfc_trans_omp_clauses): Attach/detach clause fixes.
451 2023-04-28 Tobias Burnus <tobias@codesourcery.com>
453 * gfortran.texi: Fix typos.
454 * decl.cc: Fix typos in comments and in a variable name.
455 * arith.cc: Fix comment typos.
456 * check.cc: Likewise.
457 * class.cc: Likewise.
458 * dependency.cc: Likewise.
460 * frontend-passes.cc: Likewise.
461 * gfortran.h: Likewise.
462 * intrinsic.cc: Likewise.
463 * iresolve.cc: Likewise.
464 * match.cc: Likewise.
465 * module.cc: Likewise.
466 * primary.cc: Likewise.
467 * resolve.cc: Likewise.
468 * simplify.cc: Likewise.
469 * trans-array.cc: Likewise.
470 * trans-decl.cc: Likewise.
471 * trans-expr.cc: Likewise.
472 * trans-intrinsic.cc: Likewise.
473 * trans-openmp.cc: Likewise.
474 * trans-stmt.cc: Likewise.
476 2023-04-25 Tobias Burnus <tobias@codesourcery.com>
478 * openmp.cc (gfc_resolve_omp_do_blocks): Handle zero
479 or more than one exec statements before/after 'omp scan'.
480 * trans-openmp.cc (gfc_trans_omp_do): Likewise.
482 2023-04-22 Harald Anlauf <anlauf@gmx.de>
483 Steven G. Kargl <kargl@gcc.gnu.org>
486 * interface.cc (gfc_compare_actual_formal): Reject allocatable
487 functions being used as actual argument for allocable dummy.
489 2023-04-14 Harald Anlauf <anlauf@gmx.de>
492 * simplify.cc (gfc_simplify_set_exponent): Fix implementation of
493 compile-time simplification of intrinsic SET_EXPONENT for argument
496 2023-04-14 Paul Thomas <pault@gcc.gnu.org>
499 * gfortran.h : Add expr3_not_explicit bit field to gfc_code.
500 * resolve.cc (resolve_allocate_expr): Set bit field when the
501 default initializer is applied to expr3.
502 * trans-stmt.cc (gfc_trans_allocate): If expr3_not_explicit is
503 set, do not deallocate expr3.
505 2023-04-13 Harald Anlauf <anlauf@gmx.de>
508 * trans-expr.cc (gfc_conv_power_op): Use absu_hwi and
509 unsigned HOST_WIDE_INT for portability.
511 2023-04-12 Harald Anlauf <anlauf@gmx.de>
514 * resolve.cc (resolve_entries): Handle functions with ENTRY and
516 * trans-expr.cc (gfc_conv_procedure_call): Functions with a result
517 with the POINTER or ALLOCATABLE attribute shall not get any special
518 treatment with -ff2c, as they cannot be written in Fortran 77.
519 * trans-types.cc (gfc_return_by_reference): Likewise.
520 (gfc_get_function_type): Likewise.
522 2023-04-12 Harald Anlauf <anlauf@gmx.de>
526 * interface.cc (compare_parameter): Enable type and rank checks for
527 arguments of derived type from the intrinsic module ISO_C_BINDING.
529 2023-04-08 Paul Thomas <pault@gcc.gnu.org>
532 * iresolve.cc (gfc_resolve_adjustl, gfc_resolve_adjustr): if
533 string length is deferred use the string typespec for result.
534 * resolve.cc (resolve_assoc_var): Handle parentheses around the
536 (resolve_block_construct): Remove unnecessary static decls.
537 * trans-array.cc (gfc_conv_expr_descriptor): Guard string len
538 expression in condition. Improve handling of string length and
539 span, especially for substrings of the descriptor.
540 (duplicate_allocatable): Make element type more explicit with
542 * trans-decl.cc (gfc_get_symbol_decl): Emit a fatal error with
543 appropriate message instead of ICE if symbol type is unknown.
544 (gfc_generate_function_code): Set current locus to proc_sym
546 * trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in
547 'previous' and use if end expression in substring reference is
549 (gfc_conv_string_length): Use gfc_conv_expr_descriptor if
550 'expr_flat' is an array. Add post block to catch deallocation
552 (gfc_conv_procedure_call): Assign the parmse string length to
553 the expression string length, if it is deferred.
554 (gfc_trans_alloc_subarray_assign): If this is a deferred string
555 length component, store the string length in the hidden comp.
556 Update the typespec length accordingly. Generate a new type
557 spec for the call to gfc_duplicate-allocatable in this case.
558 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
559 deferred character array components.
561 2023-04-04 Harald Anlauf <anlauf@gmx.de>
564 * expr.cc (check_restricted): Adjust check for valid variables in
565 restricted expressions: make no exception for module variables.
567 2023-04-01 Thomas Koenig <tkoenig@gcc.gnu.org>
569 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
570 type name to be "long long".
572 2023-03-30 Andrew Pinski <apinski@marvell.com>
574 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
575 type name to be "long long". Add a comment on why adding
578 2023-03-28 Jakub Jelinek <jakub@redhat.com>
581 * openmp.cc (gfc_omp_absent_contains_clause): Fix typo in diagnostics
582 - composit -> composite.
584 2023-03-25 Harald Anlauf <anlauf@gmx.de>
587 * trans-decl.cc (gfc_conv_cfi_to_gfc): Remove dead code.
589 2023-03-24 Harald Anlauf <anlauf@gmx.de>
591 * expr.cc (free_expr0): Free also BOZ strings as part of an expression.
593 2023-03-24 Haochen Gui <guihaoc@gcc.gnu.org>
594 Tobias Burnus <tobias@codesourcery.com>
597 * target-memory.cc (gfc_interpret_float): Return FAIL when
598 native_interpret_expr gets a NULL tree.
599 * arith.cc (gfc_hollerith2real): Return NULL when
600 gfc_interpret_float fails.
601 * error.cc (gfc_buffered_p): Define.
602 * gfortran.h (gfc_buffered_p): Declare.
603 * intrinsic.cc: Add diagnostic.h to include list.
604 (do_simplify): Save errorcount and check it at finish. Report a
605 "Cannot simplify expression" error on a bad result if error count
606 doesn't change and no other errors buffered.
608 2023-03-22 Harald Anlauf <anlauf@gmx.de>
609 Steven G. Kargl <kargl@gcc.gnu.org>
612 * resolve.cc (gfc_resolve_finalizers): Argument of a FINAL subroutine
613 cannot be an alternate return.
615 2023-03-21 Harald Anlauf <anlauf@gmx.de>
618 * decl.cc (gfc_match_modproc): Reject MODULE PROCEDURE if not in a
619 generic module interface.
621 2023-03-21 Arsen Arsenović <arsen@aarsen.me>
623 * invoke.texi: Remove usages of @gol.
624 * intrinsic.texi: Ditto.
626 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
629 * trans-array.cc (gfc_trans_array_constructor_value): Correct
630 incorrect setting of typespec.
632 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
635 * resolve.cc (generate_component_assignments): Restore the
636 exclusion of allocatable components from the loop.
638 2023-03-20 Harald Anlauf <anlauf@gmx.de>
641 * invoke.texi: Correct documentation of how underscores are appended
644 2023-03-20 Harald Anlauf <anlauf@gmx.de>
647 * simplify.cc (gfc_simplify_nearest): Fix off-by-one error in setting
648 up real kind-specific maximum exponent for mpfr.
650 2023-03-20 Paul Thomas <pault@gcc.gnu.org>
653 * resolve.cc (check_host_association): If an external function
654 is typed but not declared explicitly to be external, change the
655 old symbol from a variable to an external function.
657 2023-03-19 Harald Anlauf <anlauf@gmx.de>
660 * resolve.cc (resolve_fl_procedure): Check for an explicit interface
661 of procedures with the BIND(C) attribute (F2018:15.4.2.2).
663 2023-03-19 Thomas Koenig <tkoenig@gcc.gnu.org>
665 * gfortran.texi: Mention behavior on overflow.
667 2023-03-18 Paul Thomas <pault@gcc.gnu.org>
672 * class.cc (finalize_component): Include the missing arguments
673 in the call to the component's finalizer wrapper.
674 (has_finalizer_component): Do not return true for procedure
676 (finalizer_insert_packed_call): Remove the redundant argument
677 in the call to the final subroutine.
678 (generate_finalization_wrapper): Add support for assumed rank
680 (gfc_may_be_finalized): New helper function.
681 * dump-parse-tree.cc (write_proc): Whitespace.
682 * gfortran.h : Add prototype for gfc_may_be_finalized.
683 * resolve.cc (resolve_function): Correct derived types that
684 have an incomplete namespace.
685 (resolve_where, gfc_resolve_where_code_in_forall,
686 gfc_resolve_forall_body, gfc_resolve_code): Check that the op
687 code is still EXEC_ASSIGN. If it is set lhs to must finalize.
688 (is_finalizable_type): New function.
689 (generate_component_assignments): Set must_finalize if needed.
690 (gfc_resolve_finalizers): Error if assumed rank finalizer is
691 not the only one. Warning on lack of scalar finalizer modified
692 to account for assumed rank finalizers.
693 (generate_final_call): New function.
694 (generate_component_assignments): Enclose the outermost call in
695 a block to capture automatic deallocation and final calls.
696 Set must_finalize as required to satisfy the standards. Use an
697 explicit pointer assignment for pointer components to capture
698 finalization of the target. Likewise use explicit assignment
699 for allocatable components. Do not use the temporary copy of
700 the lhs in defined assignment if the component is allocatable.
701 Put the temporary in the same namespace as the lhs symbol if
702 the component may be finalized. Remove the leading assignment
703 from the expansion of assignment of components that have their
704 own defined assignment components. Suppress finalization of
705 assignment of temporary components to the lhs. Make an explicit
706 final call for the rhs function temporary if it exists.
707 (gfc_resolve_code): Set must_finalize for assignments with an
708 array constructor on the rhs.
709 (gfc_resolve_finalizers): Ensure that an assumed rank finalizer
710 is the only finalizer for that type and correct the surprising
711 warning for the lack of a scalar finalizer.
712 (check_defined_assignments): Handle allocatable components.
713 (resolve_fl_derived): Set referenced the vtab for use
715 (resolve_symbol): Set referenced an unreferenced symbol that
717 * trans-array.cc (gfc_trans_array_constructor_value): Add code
718 to finalize the constructor result. Warn that this feature was
719 removed in F2018 and that it is suppressed by -std=2018.
720 (trans_array_constructor): Add finalblock, pass to previous
721 and apply to loop->post if filled.
722 (gfc_add_loop_ss_code): Add se finalblock to outer loop post.
723 (gfc_trans_array_cobounds, gfc_trans_array_bounds): Add any
724 generated finalization code to the main block.
725 (structure_alloc_comps): Add boolean argument to suppress
726 finalization and use it for calls from
727 gfc_deallocate_alloc_comp_no_caf. Otherwise it defaults to
729 (gfc_copy_alloc_comp_no_fini): New wrapper for
730 structure_alloc_comps.
731 (gfc_alloc_allocatable_for_assignment): Suppress finalization
732 by setting new arg in call to gfc_deallocate_alloc_comp_no_caf.
733 (gfc_trans_deferred_array): Use gfc_may_be_finalized and do not
734 deallocate the components of entities with a leading '_' in the
735 name that are also marked as artificial.
736 * trans-array.h : Add the new boolean argument to the prototype
737 of gfc_deallocate_alloc_comp_no_caf with a default of false.
738 Add prototype for gfc_copy_alloc_comp_no_fini.
739 * trans-decl.cc(init_intent_out_dt): Tidy up the code.
740 * trans-expr.cc (gfc_init_se): Initialize finalblock.
741 (gfc_conv_procedure_call): Use gfc_finalize_tree_expr to
742 finalize function results. Replace in-line block for class
743 results with call to new function.
744 (gfc_conv_expr): Finalize structure constructors for F2003 and
745 F2008. Warn that this feature was deleted in F2018 and, unlike
746 array constructors, is not default. Add array constructor
747 finalblock to the post block.
748 (gfc_trans_scalar_assign): Suppress finalization by setting new
749 argument in call to gfc_deallocate_alloc_comp_no_caf. Add the
750 finalization blocks to the main block.
751 (gfc_trans_arrayfunc_assign): Use gfc_assignment_finalizer_call
752 and ensure that finalization occurs after the evaluation of the
753 rhs but using the initial value for the lhs. Finalize rhs
754 function results using gfc_finalize_tree_expr.
755 (trans_class_assignment, gfc_trans_assignment_1): As previous
756 function, taking care to order evaluation, assignment and
757 finalization correctly.
758 * trans-io.cc (gfc_trans_transfer): Add the final block.
759 * trans-stmt.cc (gfc_trans_call, gfc_trans_allocate): likewise.
760 (trans_associate_var): Nullify derived allocatable components
761 and finalize function targets with defined assignment
762 components on leaving the block scope.
763 (trans_allocate): Finalize source expressions, if required,
764 and set init_expr artificial temporarily to suppress the
765 finalization in gfc_trans_assignment.
766 * trans.cc (gfc_add_finalizer_call): Do not finalize the
767 temporaries generated in type assignment with defined
768 assignment components.
769 (gfc_assignment_finalizer_call): New function.
770 (gfc_finalize_tree_expr): New function.
771 * trans.h: Add finalblock to gfc_se. Add the prototypes for
772 gfc_finalize_tree_expr and gfc_assignment_finalizer_call.
774 2023-03-15 Harald Anlauf <anlauf@gmx.de>
775 Tobias Burnus <tobias@codesourcery.com>
778 * interface.cc (compare_parameter): Adjust check of array dummy
779 arguments to handle the case of CLASS variables.
781 2023-03-11 Harald Anlauf <anlauf@gmx.de>
784 * trans-expr.cc (gfc_copy_class_to_class): Convert element counts in
785 bounds check to common type for comparison.
787 2023-03-10 Harald Anlauf <anlauf@gmx.de>
790 * resolve.cc (resolve_symbol): Avoid NULL pointer dereference while
791 checking a symbol with the BIND(C) attribute.
793 2023-03-05 Harald Anlauf <anlauf@gmx.de>
794 Tobias Burnus <tobias@codesourcery.com>
797 * class.cc (gfc_build_class_symbol): Handle update of attributes of
798 existing class container.
799 (gfc_find_derived_vtab): Fix several memory leaks.
800 (find_intrinsic_vtab): Ditto.
801 * decl.cc (attr_decl1): Manage update of symbol attributes from
803 * primary.cc (gfc_variable_attr): OPTIONAL shall not be taken or
804 updated from the class container.
805 * symbol.cc (free_old_symbol): Adjust management of symbol versions
806 to not prematurely free array specs while working on the declation
809 2023-03-01 Tobias Burnus <tobias@codesourcery.com>
812 * trans-openmp.cc (gfc_trans_omp_clauses): Fix mapping of
813 type(C_ptr) variables.
815 2023-02-27 Harald Anlauf <anlauf@gmx.de>
818 * trans-intrinsic.cc (gfc_conv_intrinsic_ibits): Handle corner case
819 LEN argument of IBITS equal to BITSIZE(I).
821 2023-02-25 Mikael Morin <mikael@gcc.gnu.org>
824 * intrinsic.cc (get_intrinsic_dummy_arg,
825 set_intrinsic_dummy_arg): Rename the former to the latter.
826 Remove the return value, add a reference to the lhs as argument,
827 and do the pointer assignment inside the function. Don't do
828 it if the pointer is already non-NULL.
829 (sort_actual): Update caller.
831 2023-02-25 Harald Anlauf <anlauf@gmx.de>
833 * arith.cc (gfc_real2int): Clear mpfr variable after use.
835 2023-02-25 Tobias Burnus <tobias@codesourcery.com>
838 * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Skip setting of
839 bounds of CFI desc for 'pointer,intent(out)'.
841 2023-02-24 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
843 * trans-decl.cc (gfc_finish_var_decl): Apply attribute.
844 (generate_local_decl): Add diagnostic for dummy and local variables.
846 2023-02-24 Mikael Morin <mikael@gcc.gnu.org>
849 * expr.cc (gfc_free_actual_arglist): Free associated_dummy
851 (gfc_copy_actual_arglist): Make a copy of the associated_dummy
852 field if it is set in the original element.
854 2023-02-24 Harald Anlauf <anlauf@gmx.de>
857 * frontend-passes.cc (do_subscript): Clear used gmp variable.
859 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
861 * invoke.texi: Reorder index entries around @items.
863 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
865 * invoke.texi: Reorder @opindex commands to precede @items they
868 2023-02-22 Harald Anlauf <anlauf@gmx.de>
871 * resolve.cc (resolve_component): The type of a CHARACTER length
872 expression must be INTEGER.
874 2023-02-21 Harald Anlauf <anlauf@gmx.de>
877 * parse.cc (check_function_result_typed): Improve type check of
878 specification expression for character length and return status.
879 (parse_spec): Use status from above.
880 * resolve.cc (resolve_fntype): Prevent use of invalid specification
881 expression for character length.
883 2023-02-16 Patrick Palka <ppalka@redhat.com>
885 * gfortran.h: Mechanically drop static from static inline
886 functions via s/^static inline/inline/g.
888 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
891 * frontend-passes.cc (do_intent): Catch NULL pointer dereference on
892 reference to invalid formal argument.
894 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
897 * resolve.cc (check_assumed_size_reference): Avoid NULL pointer
900 2023-02-15 Tobias Burnus <tobias@codesourcery.com>
903 * openmp.cc (gfc_resolve_omp_parallel_blocks): Handle combined 'loop'
905 (gfc_resolve_do_iterator): Set a source location for added
906 'private'-clause arguments.
907 * resolve.cc (gfc_resolve_code): Call gfc_resolve_omp_do_blocks
908 also for EXEC_OMP_LOOP and gfc_resolve_omp_parallel_blocks for
909 combined directives with loop + '{masked,master} taskloop (simd)'.
911 2023-02-13 Harald Anlauf <anlauf@gmx.de>
914 * primary.cc (gfc_expr_attr): Avoid NULL pointer dereference for
915 invalid use of CLASS variable.
917 2023-02-13 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
919 * decl.cc: Add EXT_ATTR_NOINLINE, EXT_ATTR_NORETURN, EXT_ATTR_WEAK.
920 * gfortran.h (ext_attr_id_t): Ditto.
921 * gfortran.texi (GCC$ ATTRIBUTES): Document them.
922 * trans-decl.cc (build_function_decl): Apply them.
924 2023-02-09 Harald Anlauf <anlauf@gmx.de>
925 Steven G. Kargl <kargl@gcc.gnu.org>
929 * intrinsic.cc (gfc_convert_chartype): Recover on invalid character
930 kind in conversion instead of generating an internal error.
932 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
935 * trans-openmp.cc (struct dovar_init_d): Add 'sym' and
936 'non_unit_incr' members.
937 (gfc_nonrect_loop_expr): New.
938 (gfc_trans_omp_do): Call it; use normal loop bounds
939 for unit stride - and only create local loop var.
941 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
943 * parse.cc (decode_omp_directive): Really ignore 'assumes' with
946 2023-02-08 Steve Kargl <kargl@gcc.gnu.org>
949 * resolve.cc (resolve_common_vars): Avoid NULL pointer dereference
950 when a symbol's location is not set.
952 2023-02-07 Harald Anlauf <anlauf@gmx.de>
955 * trans-decl.cc (gfc_finish_var_decl): With -fno-automatic, do not
956 make ASSOCIATE variables TREE_STATIC.
958 2023-02-05 Harald Anlauf <anlauf@gmx.de>
961 * arith.cc (gfc_arith_divide): Emit integer division truncation
962 warnings using gfc_warning instead of gfc_warning_now to prevent
965 2023-02-03 Jakub Jelinek <jakub@redhat.com>
968 * trans-decl.cc (gfc_trans_use_stmts): Call clear_slot before
971 2023-02-01 Harald Anlauf <anlauf@gmx.de>
974 * expr.cc (find_array_section): Add check to prevent interpreting an
975 mpz non-integer constant as an integer.
977 2023-02-01 Tobias Burnus <tobias@codesourcery.com>
979 * openmp.cc (resolve_omp_clauses): Check also for
982 2023-01-29 Mikael Morin <mikael@gcc.gnu.org>
985 * check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
986 (gfc_check_findloc): Ditto.
988 2023-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
991 * parse.cc (parse_module): Remove use of a bool error value
992 that prevented proper setting of the namespace pointer.
994 2023-01-28 Harald Anlauf <anlauf@gmx.de>
995 Steven G. Kargl <kargl@gcc.gnu.org>
998 * resolve.cc (compare_bound_int): Expression to compare must be of
1000 (compare_bound_mpz_t): Likewise.
1001 (check_dimension): Fix comment on checks applied to array section
1002 and clean up associated logic.
1004 2023-01-28 Harald Anlauf <anlauf@gmx.de>
1007 * match.cc (gfc_match_common): A USE associated name shall not appear
1008 in a COMMON block (F2018:C8121).
1010 2023-01-27 Tobias Burnus <tobias@codesourcery.com>
1013 * trans-openmp.cc (gfc_split_omp_clauses): Handle has_device_addr.
1015 2023-01-26 Harald Anlauf <anlauf@gmx.de>
1018 * resolve.cc (check_host_association): Extend host association check
1019 so that it is not restricted to functions. Also prevent NULL pointer
1022 2023-01-25 Steve Kargl <kargl@gcc.gnu.org>
1025 * array.cc (compare_bounds): Return false instead of generating an
1026 internal error on an invalid argument type.
1028 2023-01-24 Harald Anlauf <anlauf@gmx.de>
1031 * simplify.cc (simplify_transformation): Do not try to simplify
1032 transformational intrinsic when the ARRAY argument has a NULL shape.
1034 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1037 * dependency.cc (gfc_check_dependency): Prevent NULL pointer
1038 dereference while recursively checking expressions.
1040 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1043 * interface.cc (get_expr_storage_size): Check array subscript triplets
1044 that we actually have integer values before trying to extract with
1047 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1050 * iresolve.cc (check_charlen_present): Preserve character length if
1051 there is no array constructor.
1053 2023-01-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1056 * data.cc (gfc_assign_data_value): Remove check for PARAMETER in DATA.
1057 * primary.cc (match_variable): Add check for PARAMETER in DATA.
1059 2023-01-19 Harald Anlauf <anlauf@gmx.de>
1062 * expr.cc (class_allocatable): Prevent NULL pointer dereference
1064 (class_pointer): Likewise.
1066 2023-01-17 Harald Anlauf <anlauf@gmx.de>
1069 * interface.cc (get_expr_storage_size): Check that we actually have
1070 an integer value before trying to extract it with mpz_get_si.
1072 2023-01-12 Tobias Burnus <tobias@codesourcery.com>
1075 * openmp.cc (gfc_resolve_omp_assumptions): Reject nonscalars.
1077 2023-01-11 Jakub Jelinek <jakub@redhat.com>
1080 * f95-lang.cc (gfc_init_builtin_function): Fix up function types
1081 for BUILT_IN_REALLOC and BUILT_IN_SINCOS{F,,L}. Formatting fixes.
1083 2023-01-10 Harald Anlauf <anlauf@gmx.de>
1086 * frontend-passes.cc (do_subscript): Clear used gmp variables.
1088 2023-01-02 Jakub Jelinek <jakub@redhat.com>
1090 * gfortranspec.cc (lang_specific_driver): Update copyright notice
1092 * gfc-internals.texi: Bump @copying's copyright year.
1093 * gfortran.texi: Ditto.
1094 * intrinsic.texi: Ditto.
1095 * invoke.texi: Ditto.
1098 Copyright (C) 2023 Free Software Foundation, Inc.
1100 Copying and distribution of this file, with or without modification,
1101 are permitted in any medium without royalty provided the copyright
1102 notice and this notice are preserved.