1 2023-10-02 David Malcolm <dmalcolm@redhat.com>
3 * error.cc (gfc_diagnostics_init): Update for change to start_span.
5 2023-10-02 David Malcolm <dmalcolm@redhat.com>
7 * error.cc (gfc_diagnostic_starter): Update for reorganization of
8 source-printing fields of diagnostic_context.
9 (gfc_diagnostics_init): Likewise.
10 (gfc_diagnostics_finish): Likewise.
12 2023-09-29 Andre Vehreschild <vehre@gcc.gnu.org>
15 * trans-array.cc (structure_alloc_comps): Deref coarray.
16 (gfc_trans_deferred_array): Add freeing of components after
17 check for allocated coarray.
19 2023-09-24 Paul Thomas <pault@gcc.gnu.org>
23 * decl.cc (fix_initializer_charlen): New function broken out of
25 (add_init_expr_to_sym, build_struct): Call the new function.
26 * trans-expr.cc (gfc_conv_intrinsic_to_class): Remove repeated
29 2023-09-23 Harald Anlauf <anlauf@gmx.de>
32 * class.cc (gfc_build_class_symbol): Do not try to build class
33 container for invalid typespec.
34 * resolve.cc (resolve_fl_var_and_proc): Prevent NULL pointer
36 (resolve_symbol): Likewise.
38 2023-09-19 Harald Anlauf <anlauf@gmx.de>
41 * trans-array.cc (trans_array_constructor): In absence of a typespec,
42 use string length determined by get_array_ctor_strlen() to reasonably
43 initialize auxiliary variable for bounds-checking.
45 2023-09-15 Harald Anlauf <anlauf@gmx.de>
48 * trans-array.cc (trans_array_bound_check): Add optional argument
49 COMPNAME for explicit specification of array component name.
50 (array_bound_check_elemental): Helper function for generating
51 bounds-checking code for elemental dimensions.
52 (gfc_conv_expr_descriptor): Use bounds-checking also for elemental
53 dimensions, i.e. those not handled by the scalarizer.
55 2023-09-15 Mikael Morin <mikael@gcc.gnu.org>
58 * gfortran.h (gfc_symbol): Add comment documenting reference counting.
59 * parse.cc (parse_interface): Remove reference count incrementation.
61 2023-09-12 Mikael Morin <mikael@gcc.gnu.org>
64 * gfortran.h (gfc_release_symbol): Set return type to bool.
65 * symbol.cc (gfc_release_symbol): Ditto. Return whether symbol was
67 (delete_symbol_from_ns): New, outline code from...
68 (gfc_restore_last_undo_checkpoint): ... here. Delete new symbols
69 from two more namespaces.
71 2023-09-09 Mikael Morin <mikael@gcc.gnu.org>
73 * bbt.cc (delete_treap): Add argument REMOVED, set it to the removed
74 element from the tree. Change NULL to nullptr.
75 (gfc_delete_bbt): Return the removed element from the tree.
76 * gfortran.h (gfc_delete_symtree): Remove prototype.
77 (gfc_delete_bbt): Set return type to pointer.
78 * symbol.cc (gfc_delete_symtree): Make static. Get the element to be
79 freed from the result of gfc_delete_bbt. Remove the preliminary walk to
82 2023-09-01 Harald Anlauf <anlauf@gmx.de>
85 * trans-array.cc (gfc_conv_ss_startstride): For array bounds checking,
86 consider also array constructors in expressions, and use their shape.
88 2023-08-31 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
90 * gfortran.texi: Likewise.
92 2023-08-30 Mikael Morin <mikael@gcc.gnu.org>
95 * gfortran.h (gfc_drop_interface_elements_before): New prototype.
96 (gfc_current_interface_head): Return a reference to the pointer.
97 * interface.cc (gfc_current_interface_head): Ditto.
98 (free_interface_elements_until): New function, generalizing
100 (gfc_free_interface): Use free_interface_elements_until.
101 (gfc_drop_interface_elements_before): New function.
103 (current_interface_ptr, previous_interface_head): New static variables.
104 (current_interface_valid_p, get_current_interface_ptr): New functions.
105 (decode_statement): Initialize previous_interface_head.
106 (reject_statement): Restore current interface pointer to point to
107 previous_interface_head.
109 2023-08-26 Paul Thomas <pault@gcc.gnu.org>
112 * trans-expr.cc (gfc_trans_arrayfunc_assign): Supply a missing
113 dereference for the call to gfc_deallocate_alloc_comp_no_caf.
115 2023-08-25 Sandra Loosemore <sandra@codesourcery.com>
117 * gfortran.h (struct gfc_namespace): Add omp_structured_block bit.
118 * openmp.cc: Include omp-api.h.
119 (resolve_omp_clauses): Consolidate inscan reduction clause conflict
121 (find_nested_loop_in_chain): New.
122 (find_nested_loop_in_block): New.
123 (gfc_resolve_omp_do_blocks): Set omp_current_do_collapse properly.
124 Handle imperfectly-nested loops when looking for nested omp scan.
125 Refactor to move inscan reduction clause conflict checking to
127 (gfc_resolve_do_iterator): Handle imperfectly-nested loops.
128 (struct icode_error_state): New.
129 (icode_code_error_callback): New.
130 (icode_expr_error_callback): New.
131 (diagnose_intervening_code_errors_1): New.
132 (diagnose_intervening_code_errors): New.
133 (make_structured_block): New.
134 (restructure_intervening_code): New.
135 (is_outer_iteration_variable): Do not assume loops are perfectly
137 (check_nested_loop_in_chain): New.
138 (check_nested_loop_in_block_state): New.
139 (check_nested_loop_in_block_symbol): New.
140 (check_nested_loop_in_block): New.
141 (expr_uses_intervening_var): New.
142 (is_intervening_var): New.
143 (expr_is_invariant): Do not assume loops are perfectly nested.
144 (resolve_omp_do): Handle imperfectly-nested loops.
145 * trans-stmt.cc (gfc_trans_block_construct): Generate
146 OMP_STRUCTURED_BLOCK if magic bit is set on block namespace.
148 2023-08-25 Harald Anlauf <anlauf@gmx.de>
151 * data.cc (get_array_index): Add bounds-checking code and return error
152 status. Overindexing will be allowed as an extension for -std=legacy
153 and generate an error in standard-conforming mode.
154 (gfc_assign_data_value): Use error status from get_array_index for
155 graceful error recovery.
157 2023-08-25 Uros Bizjak <ubizjak@gmail.com>
159 * match.cc (gfc_match_equivalence): Rename TRUE/FALSE to true/false.
160 * module.cc (check_access): Ditto.
161 * primary.cc (match_real_constant): Ditto.
162 * trans-array.cc (gfc_trans_allocate_array_storage): Ditto.
163 (get_array_ctor_strlen): Ditto.
164 * trans-common.cc (find_equivalence): Ditto.
165 (add_equivalences): Ditto.
167 2023-08-23 Harald Anlauf <anlauf@gmx.de>
170 * resolve.cc (is_non_constant_shape_array): Add forward declaration.
171 (resolve_common_vars): Diagnose automatic array object in COMMON.
172 (resolve_symbol): Prevent confusing follow-on error.
174 2023-08-22 Tobias Burnus <tobias@codesourcery.com>
176 * gfortran.h (enum gfc_omp_defaultmap_category):
177 Add OMP_DEFAULTMAP_CAT_ALL.
178 * openmp.cc (gfc_match_omp_clauses): Parse
180 * trans-openmp.cc (gfc_trans_omp_clauses): Handle it.
182 2023-08-22 Harald Anlauf <anlauf@gmx.de>
185 * data.cc (gfc_advance_section): Derive next index set and next offset
186 into DATA variable also for array references using vector sections.
187 Use auxiliary array to keep track of offsets into indexing vectors.
188 (gfc_get_section_index): Set up initial indices also for DATA variables
189 with array references using vector sections.
190 * data.h (gfc_get_section_index): Adjust prototype.
191 (gfc_advance_section): Likewise.
192 * resolve.cc (check_data_variable): Pass vector offsets.
194 2023-08-16 Harald Anlauf <anlauf@gmx.de>
197 * trans-expr.cc (conv_scalar_char_value): Use gfc_replace_expr to
198 avoid leaking replaced gfc_expr.
200 2023-08-15 Martin Jambor <mjambor@suse.cz>
201 Harald Anlauf <anlauf@gmx.de>
204 * resolve.cc (resolve_structure_cons): Check comp->ts is character
205 type before accessing stuff through comp->ts.u.cl.
207 2023-08-15 Chung-Lin Tang <cltang@codesourcery.com>
208 Thomas Schwinge <thomas@codesourcery.com>
210 * openmp.cc (OACC_DATA_CLAUSES): Add OMP_CLAUSE_DEFAULT.
212 2023-08-14 Mikael Morin <mikael@gcc.gnu.org>
216 * trans-types.cc (gfc_sym_type): Use a bare character type for length
217 one value character dummy arguments.
218 * trans-expr.cc (gfc_conv_string_parameter): Handle single character
220 (gfc_conv_procedure_call): Don't exclude interoperable kinds
221 from single character handling. For single character dummy arguments,
222 extend the existing handling of non-constant expressions to constant
225 2023-08-14 Mikael Morin <mikael@gcc.gnu.org>
227 * gfortran.h (gfc_length_one_character_type_p): New inline
229 * check.cc (is_c_interoperable): Use
230 gfc_length_one_character_type_p.
231 * decl.cc (verify_bind_c_sym): Same.
232 * trans-expr.cc (gfc_conv_procedure_call): Same.
234 2023-08-09 Steve Kargl <sgk@troutmask.apl.washington.edu>
237 * resolve.cc (resolve_types): Exclude contained procedures with
238 the artificial attribute from test for pureness.
240 2023-07-31 Chung-Lin Tang <cltang@codesourcery.com>
242 * openmp.cc (resolve_omp_clauses): Add checking requiring
243 OpenACC host_data construct to have an use_device clause.
245 2023-07-28 Harald Anlauf <anlauf@gmx.de>
248 * gfortran.texi: Clarify argument passing convention.
249 * trans-expr.cc (gfc_conv_procedure_call): Do not pass the character
250 length as hidden argument when the declared dummy argument is
253 2023-07-27 Tobias Burnus <tobias@codesourcery.com>
255 * openmp.cc (resolve_omp_target): Minor cleanup.
256 * parse.cc (decode_omp_directive): Find TARGET statement
257 also higher in the stack.
259 2023-07-26 Harald Anlauf <anlauf@gmx.de>
262 * resolve.cc (check_data_variable): Do not accept strings with
263 deferred length or non-constant length in a DATA statement.
264 Reject also substrings of string variables of non-constant length.
266 2023-07-25 Tobias Burnus <tobias@codesourcery.com>
270 * gfortran.h (gfc_omp_clauses): Add target_first_st_is_teams.
271 * parse.cc (parse_omp_structured_block): Set it if the first
272 statement in the structured block of a TARGET is TEAMS or
273 a combined/composite starting with TEAMS.
274 * openmp.cc (resolve_omp_target): Also show an error for
275 contains_teams_construct without target_first_st_is_teams.
277 2023-07-24 Tobias Burnus <tobias@codesourcery.com>
281 * gfortran.h (gfc_omp_clauses): Add contains_teams_construct.
282 * openmp.cc (resolve_omp_target): New; check for teams nesting.
283 (gfc_resolve_omp_directive): Call it.
284 * parse.cc (decode_omp_directive): Set contains_teams_construct
285 on enclosing ST_OMP_TARGET.
287 2023-07-20 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
289 * trans-intrinsic.cc (conv_intrinsic_ieee_comparison): Only
292 2023-07-20 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
294 * f95-lang.cc (gfc_init_builtin_functions): Add __builtin_iseqsig.
295 * trans-intrinsic.cc (conv_intrinsic_ieee_comparison): New
297 (gfc_conv_ieee_arithmetic_function): Handle IEEE comparisons.
299 2023-07-19 Tobias Burnus <tobias@codesourcery.com>
302 * trans-openmp.cc (gfc_nonrect_loop_expr): Accept all
304 (gfc_trans_omp_do): Likewise; use sign to determine
307 2023-07-17 Harald Anlauf <anlauf@gmx.de>
311 * trans-expr.cc (gfc_conv_procedure_call): For intrinsic procedures
312 whose result characteristics depends on the first argument and which
313 can be of type character, the character length will not be deferred.
315 2023-07-17 Tobias Burnus <tobias@codesoucery.com>
316 Chung-Lin Tang <cltang@codesourcery.com>
318 * dump-parse-tree.cc (show_omp_namelist, show_omp_clauses): Dump
319 uses_allocators clause.
320 * gfortran.h (gfc_free_omp_namelist): Add memspace_sym to u union
321 and traits_sym to u2 union.
322 (OMP_LIST_USES_ALLOCATORS): New enum value.
323 (gfc_free_omp_namelist): Add 'bool free_mem_traits_space' arg.
324 * match.cc (gfc_free_omp_namelist): Likewise.
325 * openmp.cc (gfc_free_omp_clauses, gfc_match_omp_variable_list,
326 gfc_match_omp_to_link, gfc_match_omp_doacross_sink,
327 gfc_match_omp_clause_reduction, gfc_match_omp_allocate,
328 gfc_match_omp_flush): Update call.
329 (gfc_match_omp_clauses): Likewise. Parse uses_allocators clause.
330 (gfc_match_omp_clause_uses_allocators): New.
331 (enum omp_mask2): Add new OMP_CLAUSE_USES_ALLOCATORS.
332 (OMP_TARGET_CLAUSES): Accept it.
333 (resolve_omp_clauses): Resolve uses_allocators clause
334 * st.cc (gfc_free_statement): Update gfc_free_omp_namelist call.
335 * trans-openmp.cc (gfc_trans_omp_clauses): Handle
336 OMP_LIST_USES_ALLOCATORS; fail with sorry unless predefined allocator.
337 (gfc_split_omp_clauses): Handle uses_allocators.
339 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
342 * trans.h (gfc_deallocate_with_status): Add class container
344 (gfc_deallocate_scalar_with_status): Ditto.
345 * trans.cc (gfc_deallocate_with_status): Add class container
346 argument and pass it down to gfc_add_finalize_call.
347 (gfc_deallocate_scalar_with_status): Same.
348 * trans-array.cc (structure_alloc_comps): Update caller.
349 * trans-stmt.cc (gfc_trans_deallocate): Ditto.
350 * trans-expr.cc (gfc_conv_procedure_call): Ditto. Pass
351 pre-evaluated class container argument if it's available.
353 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
356 * trans.h (gfc_add_finalizer_call): Add class container argument.
357 * trans.cc (gfc_add_finalizer_call): Ditto. Pass down new
358 argument to get_final_proc_ref, get_elem_size, get_var_desc,
360 (get_elem_size): Add class container argument.
361 Use provided class container if it's available.
362 (get_var_descr): Same.
364 (get_final_proc_ref): Same. Add boolean telling the class
365 container argument is used. Set it. Don't try to use
366 final_wrapper if class container argument was used.
368 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
370 * trans.cc (get_var_descr): Factor scalar descriptor generation.
372 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
374 * trans.cc (get_vptr): New function.
375 (gfc_add_finalizer_call): Move virtual table pointer evaluation
378 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
380 * trans.cc (get_var_descr): Remove argument ts. Use var->ts
382 (gfc_add_finalizer_call): Update caller.
384 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
386 * trans.cc (gfc_add_finalizer_call): Inline definition of
387 variable has_finalizer. Merge nested conditions.
389 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
391 * trans.cc (gfc_add_finalizer_call): Remove local variable
392 final_expr. Pass down expr to get_final_proc_ref and move
393 final procedure expression generation down to its one usage
394 in get_final_proc_ref.
395 (get_final_proc_ref): Add argument expr. Remove argument
396 final_wrapper. Recreate final_wrapper from expr.
398 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
400 * trans.cc (gfc_add_finalizer_call): Remove local variable
401 elem_size. Pass expression to get_elem_size and move the
402 element size expression generation close to its usage there.
403 (get_elem_size): Add argument expr, remove class_size argument
404 and rebuild it from expr. Remove ts argument and use the
405 type of expr instead.
407 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
409 * trans.cc (gfc_add_finalizer_call): Move pre and post code for
410 the final procedure pointer expression to the outer block.
411 Reuse the previously evaluated final procedure pointer
414 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
416 * trans.cc (gfc_add_finalizer_call): Add post code for desc_se
417 after the finalizer call. Add post code for final_se and
420 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
422 * trans.cc (gfc_build_final_call): Inline...
423 (gfc_add_finalizer_call): ... to its one caller.
425 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
427 * trans.cc (get_var_descr): New function.
428 (gfc_build_final_call): Outline the data reference descriptor
429 evaluation code to get_var_descr.
431 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
433 * trans.cc (get_elem_size): New function.
434 (gfc_build_final_call): Outline the element size evaluation
437 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
439 * trans.cc (get_final_proc_ref): New function.
440 (gfc_build_final_call): Outline the pointer evaluation code
441 to get_final_proc_ref.
443 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
445 * trans.cc (gfc_build_final_call): Remove commented assertion.
447 2023-07-14 Mikael Morin <mikael@gcc.gnu.org>
450 * trans.h (gfc_reset_vptr): Add class_container argument.
451 * trans-expr.cc (gfc_reset_vptr): Ditto. If a valid vptr can
452 be obtained through class_container argument, bypass evaluation
454 (gfc_conv_procedure_call): Wrap the argument evaluation code
455 in a conditional if the associated dummy is optional. Evaluate
456 the data reference to a pointer now, and replace later
457 references with usage of the pointer.
459 2023-07-14 Mikael Morin <mikael@gcc.gnu.org>
462 * trans.h (struct gfc_se): New field class_container.
463 (struct gfc_ss_info): Ditto.
464 (gfc_evaluate_data_ref_now): New prototype.
465 * trans.cc (gfc_evaluate_data_ref_now): Implement it.
466 * trans-array.cc (gfc_conv_ss_descriptor): Copy class_container
467 field from gfc_se struct to gfc_ss_info struct.
468 (gfc_conv_expr_descriptor): Copy class_container field from
469 gfc_ss_info struct to gfc_se struct.
470 * trans-expr.cc (gfc_conv_class_to_class): Use class container
471 set in class_container field if available.
472 (gfc_conv_variable): Set class_container field on encountering
473 class variables or components, clear it on encountering
474 non-class components.
475 (gfc_conv_procedure_call): Evaluate data ref to a pointer now,
476 and replace later references by usage of the pointer.
478 2023-07-14 Mikael Morin <mikael@gcc.gnu.org>
481 * trans-expr.cc (gfc_conv_procedure_call): Use a separate gfc_se
482 struct, initalized from parmse, to generate the class wrapper.
483 After the class wrapper code has been generated, copy it back
484 depending on whether parameter deallocation code has been
487 2023-07-13 Mikael Morin <mikael@gcc.gnu.org>
490 * symbol.cc (gfc_restore_last_undo_checkpoint): Release symbols
493 2023-07-12 Andre Vehreschild <vehre@gcc.gnu.org>
496 * expr.cc (find_inquiry_ref): Replace len of pdt_string by
498 (simplify_ref_chain): Ensure input to find_inquiry_ref is
500 (gfc_match_init_expr): Prevent PDT analysis for function calls.
501 (gfc_pdt_find_component_copy_initializer): Get the initializer
502 value for given component.
503 * gfortran.h (gfc_pdt_find_component_copy_initializer): New
505 * simplify.cc (gfc_simplify_len): Replace len() of PDT with pdt
506 component ref or constant.
508 2023-07-11 Harald Anlauf <anlauf@gmx.de>
511 * symbol.cc (gfc_copy_formal_args_intr): When deriving the formal
512 argument attributes from the actual ones for intrinsic procedure
513 calls, take special care of CHARACTER arguments that we do not
514 wrongly treat them formally as deferred-length.
516 2023-07-08 Steve Kargl <sgk@troutmask.apl.washington.edu>
520 * match.cc (gfc_match_namelist): Check for host associated or
521 defined types before applying default type.
522 (gfc_match_select_rank): Apply default type to selector of
523 unknown type if possible.
524 * resolve.cc (resolve_fl_variable): Do not apply local default
525 initialization to assumed rank entities.
527 2023-07-08 Harald Anlauf <anlauf@gmx.de>
528 Steven G. Kargl <kargl@gcc.gnu.org>
531 * trans-expr.cc (gfc_conv_procedure_call): Check procedures for
532 allocatable dummy arguments with INTENT(OUT) and move deallocation
533 of actual arguments after evaluation of argument expressions before
534 the procedure is executed.
536 2023-07-08 Harald Anlauf <anlauf@gmx.de>
539 * arith.cc (gfc_compare_expr): Handle equality comparison of constant
540 complex gfc_expr arguments.
542 2023-07-05 Robin Dapp <rdapp@ventanamicro.com>
543 Juzhe-Zhong <juzhe.zhong@rivai.ai>
545 * trans-types.cc (gfc_type_for_mode): Ditto.
547 2023-06-28 Harald Anlauf <anlauf@gmx.de>
550 * trans-expr.cc (gfc_conv_procedure_call): For non-constant string
551 argument passed to CHARACTER(LEN=1),VALUE dummy, ensure proper
552 dereferencing and truncation of string to length 1.
554 2023-06-28 Paul Thomas <pault@gcc.gnu.org>
557 * expr.cc (gfc_is_ptr_fcn): Remove reference to class_pointer.
558 * resolve.cc (resolve_assoc_var): Call gfc_is_ptr_fcn to allow
559 associate names with pointer function targets to be used in
560 variable definition context.
561 * trans-decl.cc (get_symbol_decl): Remove extraneous line.
562 * trans-expr.cc (alloc_scalar_allocatable_subcomponent): Obtain
563 size of intrinsic and character expressions.
564 (gfc_trans_subcomponent_assign): Expand assignment to class
565 components to include intrinsic and character expressions.
567 2023-06-24 Harald Anlauf <anlauf@gmx.de>
570 * trans-expr.cc (gfc_conv_procedure_call): Truncate constant string
571 argument of length > 1 passed to scalar CHARACTER(1),VALUE dummy.
573 2023-06-23 Harald Anlauf <anlauf@gmx.de>
576 * trans-expr.cc (gfc_conv_procedure_call): Pass actual argument
577 to scalar CHARACTER(1),VALUE dummy argument by value.
579 2023-06-21 Paul Thomas <pault@gcc.gnu.org>
586 * decl.cc (char_len_param_value): Fix memory leak.
587 (resolve_block_construct): Remove unnecessary static decls.
588 * expr.cc (gfc_is_ptr_fcn): New function.
589 (gfc_check_vardef_context): Use it to permit pointer function
590 result selectors to be used for associate names in variable
592 * gfortran.h: Prototype for gfc_is_ptr_fcn.
593 * match.cc (build_associate_name): New function.
594 (gfc_match_select_type): Use the new function to replace inline
595 version and to build a new associate name for the case where
596 the supplied associate name is already used for that purpose.
597 * resolve.cc (resolve_assoc_var): Call gfc_is_ptr_fcn to allow
598 associate names with pointer function targets to be used in
599 variable definition context.
600 * trans-decl.cc (gfc_get_symbol_decl): Unlimited polymorphic
601 variables need deferred initialisation of the vptr.
602 (gfc_trans_deferred_vars): Do the vptr initialisation.
603 * trans-stmt.cc (trans_associate_var): Ensure that a pointer
604 associate name points to the target of the selector and not
607 2023-06-21 Paul Thomas <pault@gcc.gnu.org>
610 * trans-expr.cc (gfc_conv_procedure_call): The hidden string
611 length must not be passed to a formal arg of type(cptr).
613 2023-06-20 Tobias Burnus <tobias@codesourcery.com>
615 * dump-parse-tree.cc (show_omp_namelist): Fix dump of the allocator
616 modifier of OMP_LIST_ALLOCATE.
618 2023-06-20 Tobias Burnus <tobias@codesourcery.com>
620 * match.cc (gfc_match_char): Match with '%S' a symbol
623 2023-06-19 Tobias Burnus <tobias@codesourcery.com>
625 * intrinsic.texi (OpenMP Modules OMP_LIB and OMP_LIB_KINDS): Also
626 add references to the OpenMP 5.1 and 5.2 spec; add omp_initial_device
627 and omp_invalid_device named constants.
629 2023-06-13 Harald Anlauf <anlauf@gmx.de>
630 Mikael Morin <mikael@gcc.gnu.org>
633 * trans-array.cc (gfc_trans_allocate_array_storage): When passing a
634 zero-sized array with fixed (= non-dynamic) size, allocate temporary
635 by the caller, not by the callee.
637 2023-06-10 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
639 * f95-lang.cc (gfc_init_builtin_functions): Add fmax() and
640 fmin() built-ins, and their variants.
641 * mathbuiltins.def: Add FMAX and FMIN built-ins.
642 * trans-intrinsic.cc (conv_intrinsic_ieee_minmax): New function.
643 (gfc_conv_ieee_arithmetic_function): Handle IEEE_MIN_NUM and
644 IEEE_MAX_NUM functions.
646 2023-06-09 Jakub Jelinek <jakub@redhat.com>
649 * primary.cc (gfc_convert_to_structure_constructor): Only do
650 constant string ctor length verification and truncation/padding
651 if constant length has INTEGER type.
653 2023-06-08 Paul Thomas <pault@gcc.gnu.org>
659 * decl.cc (char_len_param_value): Simplify a copy of the expr
660 and replace the original if there is no error.
661 * gfortran.h : Remove the redundant field 'rankguessed' from
662 'gfc_association_list'.
663 * resolve.cc (resolve_assoc_var): Remove refs to 'rankguessed'.
664 (resolve_variable): Associate names with constant or structure
665 constructor targets cannot have array refs.
666 * trans-array.cc (gfc_conv_expr_descriptor): Guard expression
667 character length backend decl before using it. Suppress the
668 assignment if lhs equals rhs.
669 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
670 associate variables pointing to a variable. Add comment.
671 * trans-stmt.cc (trans_associate_var): Remove requirement that
672 the character length be deferred before assigning the value
673 returned by gfc_conv_expr_descriptor. Also, guard the backend
674 decl before testing with VAR_P.
676 2023-06-06 Kwok Cheung Yeung <kcy@codesourcery.com>
677 Tobias Burnus <tobias@codesourcery.com>
679 * dump-parse-tree.cc (show_omp_namelist): Display 'present' map
681 (show_omp_clauses): Display 'present' motion modifier for 'to'
683 * gfortran.h (enum gfc_omp_map_op): Add entries with 'present'
685 (struct gfc_omp_namelist): Add 'present_modifer'.
686 * openmp.cc (gfc_match_motion_var_list): New, handles optional
687 'present' modifier for to/from clauses.
688 (gfc_match_omp_clauses): Call it for to/from clauses; parse 'present'
689 in defaultmap and map clauses.
690 (resolve_omp_clauses): Allow 'present' modifiers on 'target',
691 'target data', 'target enter' and 'target exit' directives.
692 * trans-openmp.cc (gfc_trans_omp_clauses): Apply 'present' modifiers
693 to tree node for 'map', 'to' and 'from' clauses. Apply 'present' for
696 2023-06-02 Steve Kargl <kargl@gcc.gnu.org>
699 * resolve.cc (resolve_select_rank): Remove duplicate error.
700 (resolve_fl_var_and_proc): Prevent NULL pointer dereference and
701 suppress error message for temporary.
703 2023-06-02 Paul Thomas <pault@gcc.gnu.org>
706 * parse.cc (parse_associate): Replace the existing evaluation
707 of the target rank with calls to gfc_resolve_ref and
708 gfc_expression_rank. Identify untyped target function results
709 with structure constructors by finding the appropriate derived
711 * resolve.cc (resolve_symbol): Allow associate variables to be
714 2023-06-01 Harald Anlauf <anlauf@gmx.de>
717 * decl.cc (gfc_match_kind_spec): Use error path on missing right
719 (gfc_match_decl_type_spec): Use error return when an error occurred
720 during matching a KIND specifier.
722 2023-06-01 Tobias Burnus <tobias@codesourcery.com>
724 * parse.cc (decode_omp_directive): Accept all pure directives
725 inside a PURE procedures; handle 'error at(execution).
727 2023-05-26 Tobias Burnus <tobias@codesourcery.com>
729 * dump-parse-tree.cc (show_omp_namelist): Update allocator, fix
731 (show_omp_node, show_code_node): Handle EXEC_OMP_ALLOCATE.
732 * gfortran.h (enum gfc_statement): Add ST_OMP_ALLOCATE and ..._EXEC.
733 (enum gfc_exec_op): Add EXEC_OMP_ALLOCATE.
734 (struct gfc_omp_namelist): Add 'allocator' to 'u2' union.
735 (struct gfc_namespace): Add omp_allocate.
736 (gfc_resolve_omp_allocate): New.
737 * match.cc (gfc_free_omp_namelist): Free 'u2.allocator'.
738 * match.h (gfc_match_omp_allocate, gfc_match_omp_allocators): New.
739 * openmp.cc (gfc_omp_directives): Uncomment allocate/allocators.
740 (gfc_match_omp_variable_list): Add bool arg for
741 rejecting listening common-block vars separately.
742 (gfc_match_omp_clauses): Update for u2.allocators.
743 (OMP_ALLOCATORS_CLAUSES, gfc_match_omp_allocate,
744 gfc_match_omp_allocators, is_predefined_allocator,
745 gfc_resolve_omp_allocate): New.
746 (resolve_omp_clauses): Update 'allocate' clause checks.
747 (omp_code_to_statement, gfc_resolve_omp_directive): Handle
748 OMP ALLOCATE/ALLOCATORS.
749 * parse.cc (in_exec_part): New global var.
750 (check_omp_allocate_stmt, parse_openmp_allocate_block): New.
751 (decode_omp_directive, case_exec_markers, case_omp_decl,
752 gfc_ascii_statement, parse_omp_structured_block): Handle
753 OMP allocate/allocators.
754 (verify_st_order, parse_executable): Set in_exec_part.
755 * resolve.cc (gfc_resolve_blocks, resolve_codes): Handle
757 * st.cc (gfc_free_statement): Likewise.
758 * trans.cc (trans_code): Likewise.
759 * trans-openmp.cc (gfc_trans_omp_directive): Likewise.
760 (gfc_trans_omp_clauses, gfc_split_omp_clauses): Update for
761 u2.allocator, fix for u.align.
763 2023-05-24 Harald Anlauf <anlauf@gmx.de>
766 * simplify.cc (simplify_size): Reject DIM argument of intrinsic SIZE
767 with error when out of valid range.
769 2023-05-24 Harald Anlauf <anlauf@gmx.de>
772 * check.cc (gfc_check_reshape): Expand constant arguments SHAPE and
773 ORDER before checking.
774 * gfortran.h (gfc_is_constant_array_expr): Add prototype.
775 * iresolve.cc (gfc_resolve_reshape): Expand constant argument SHAPE.
776 * simplify.cc (is_constant_array_expr): If array is determined to be
777 constant, expand small array constructors if needed.
778 (gfc_is_constant_array_expr): Wrapper for is_constant_array_expr.
779 (gfc_simplify_reshape): Fix check for insufficient elements in SOURCE
780 when no padding specified.
782 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
785 * resolve.cc (gfc_resolve_ref): Conversion of array_ref into an
786 element should be done for all characters without a len expr,
787 not just deferred lens, and for integer expressions.
788 * trans-expr.cc (conv_inquiry): For len and kind inquiry refs,
789 set the se string_length to NULL_TREE.
791 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
792 Steven G. Kargl <kargl@gcc.gnu.org>
795 * decl.cc (variable_decl): Clean up white space issues.
796 (gfc_match_final_decl): Declaration of finalizable derived type
797 is allowed in a submodule.
799 2023-05-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
801 * expr.cc (gfc_get_corank): Use CLASS_DATA from gfortran.h.
802 * resolve.cc (resolve_component): Same.
803 (resolve_fl_derived0): Same.
804 * simplify.cc (gfc_simplify_extends_type_of): Same.
805 (simplify_cobound): Same.
807 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
809 * trans-array.cc (is_pointer_array): Use _P() defines from tree.h.
810 (gfc_conv_scalarized_array_ref): Ditto.
811 (gfc_conv_array_ref): Ditto.
812 * trans-decl.cc (gfc_finish_decl): Ditto.
813 (gfc_get_symbol_decl): Ditto.
814 * trans-expr.cc (gfc_trans_pointer_assignment): Ditto.
815 (gfc_trans_arrayfunc_assign): Ditto.
816 (gfc_trans_assignment_1): Ditto.
817 * trans-intrinsic.cc (gfc_conv_intrinsic_minmax): Ditto.
818 (conv_intrinsic_ieee_value): Ditto.
819 * trans-io.cc (gfc_convert_array_to_string): Ditto.
820 * trans-openmp.cc (gfc_omp_is_optional_argument): Ditto.
821 (gfc_trans_omp_clauses): Ditto.
822 * trans-stmt.cc (gfc_conv_label_variable): Ditto.
823 * trans.cc (gfc_build_addr_expr): Ditto.
824 (get_array_span): Ditto.
826 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
829 * array.cc (compare_bounds): Use narrower return type.
830 (gfc_compare_array_spec): Likewise.
831 (is_constant_element): Likewise.
832 (gfc_constant_ac): Likewise.
833 * check.cc (dim_rank_check): Likewise.
834 * cpp.cc (gfc_cpp_init_options): Likewise.
835 (dump_macro): Likewise.
836 * cpp.h (gfc_cpp_handle_option): Likewise.
837 * dependency.cc (gfc_ref_needs_temporary_p): Likewise.
838 (gfc_check_argument_dependency): Likewise.
839 (gfc_check_fncall_dependency): Likewise.
840 (ref_same_as_full_array): Likewise.
841 * dependency.h (gfc_check_fncall_dependency): Likewise.
842 (gfc_dep_resolver): Likewise.
843 (gfc_are_equivalenced_arrays): Likewise.
844 * expr.cc (gfc_copy_ref): Likewise.
845 (gfc_kind_max): Likewise.
846 (numeric_type): Likewise.
847 * gfortran.h (gfc_at_end): Likewise.
848 (gfc_at_eof): Likewise.
849 (gfc_at_bol): Likewise.
850 (gfc_at_eol): Likewise.
851 (gfc_define_undef_line): Likewise.
852 (gfc_wide_is_printable): Likewise.
853 (gfc_wide_is_digit): Likewise.
854 (gfc_wide_fits_in_byte): Likewise.
855 (gfc_find_sym_tree): Likewise.
856 (gfc_generic_intrinsic): Likewise.
857 (gfc_specific_intrinsic): Likewise.
858 (gfc_intrinsic_actual_ok): Likewise.
859 (gfc_has_vector_index): Likewise.
860 (gfc_numeric_ts): Likewise.
861 (gfc_impure_variable): Likewise.
862 (gfc_pure): Likewise.
863 (gfc_implicit_pure): Likewise.
864 (gfc_elemental): Likewise.
865 (gfc_pure_function): Likewise.
866 (gfc_implicit_pure_function): Likewise.
867 (gfc_compare_array_spec): Likewise.
868 (gfc_constant_ac): Likewise.
869 (gfc_expanded_ac): Likewise.
870 (gfc_check_digit): Likewise.
871 * intrinsic.cc (gfc_find_subroutine): Likewise.
872 (gfc_generic_intrinsic): Likewise.
873 (gfc_specific_intrinsic): Likewise.
874 * io.cc (compare_to_allowed_values): Likewise. And remove
875 unneeded forward declaration.
876 * parse.cc: Likewise.
877 * parse.h (gfc_check_do_variable): Likewise.
878 * primary.cc (gfc_check_digit): Likewise.
879 * resolve.cc (resolve_structure_cons): Likewise.
880 (pure_stmt_function): Likewise.
881 (gfc_pure_function): Likewise.
882 (impure_stmt_fcn): Likewise.
883 (resolve_forall_iterators): Likewise.
884 (resolve_data): Likewise.
885 (gfc_impure_variable): Likewise.
886 (gfc_pure): Likewise.
887 (gfc_unset_implicit_pure): Likewise.
888 * scanner.cc (wide_is_ascii): Likewise.
889 (gfc_wide_toupper): Likewise.
890 (gfc_open_included_file): Likewise.
891 (gfc_at_end): Likewise.
892 (gfc_at_eof): Likewise.
893 (gfc_at_bol): Likewise.
894 (skip_comment_line): Likewise.
895 (gfc_gobble_whitespace): Likewise.
896 * symbol.cc (gfc_find_symtree_in_proc): Likewise.
897 * trans-array.cc: Likewise.
898 * trans-decl.cc (gfc_set_decl_assembler_name): Likewise.
899 * trans-types.cc (gfc_get_element_type): Likewise.
900 (gfc_add_field_to_struct): Likewise.
901 * trans-types.h (gfc_copy_dt_decls_ifequal): Likewise.
902 (gfc_return_by_reference): Likewise.
903 (gfc_is_nodesc_array): Likewise.
904 * trans.h (gfc_can_put_var_on_stack): Likewise.
906 2023-05-17 Harald Anlauf <anlauf@gmx.de>
910 * decl.cc (add_init_expr_to_sym): Set shape of initializer also for
911 zero-sized arrays, so that bounds violations can be detected later.
913 2023-05-17 Tobias Burnus <tobias@codesourcery.com>
915 * trans-decl.cc (gfc_get_symbol_decl): Add attributes
916 such as 'declare target' also to hidden artificial
917 variable for deferred-length character variables.
918 * trans-openmp.cc (gfc_trans_omp_array_section,
919 gfc_trans_omp_clauses, gfc_trans_omp_target_exit_data):
920 Improve mapping of array descriptors and deferred-length
923 2023-05-16 Paul Thomas <pault@gcc.gnu.org>
931 * interface.cc (gfc_compare_actual_formal): Emit an error if an
932 unlimited polymorphic actual is not matched either to an
933 unlimited or assumed type formal argument.
934 * resolve.cc (resolve_ordinary_assign): Emit an error if the
935 var expression of an ordinary assignment is a proc pointer
937 * trans-array.cc (gfc_walk_array_ref): Provide assumed shape
938 arrays coming from interface mapping with a viable arrayspec.
939 * trans-expr.cc (gfc_conv_intrinsic_to_class): Tidy up flagging
940 of unlimited polymorphic 'class_ts'.
941 (gfc_conv_gfc_desc_to_cfi_desc): Assumed type is unlimited
942 polymorphic and should accept any actual type.
943 (gfc_conv_procedure_call): Replace dreadful kludge with a call
944 to gfc_finalize_tree_expr. Avoid dereferencing a void pointer
945 by giving it the pointer type of the actual argument.
946 (alloc_scalar_allocatable_subcomponent): Shorten the function
947 name and replace the symbol argument with the se string length.
948 If a deferred length character length is either not present or
949 is not a variable, give the typespec a variable and assign the
950 string length to that. Use gfc_deferred_strlen to find the
951 hidden string length component.
952 (gfc_trans_subcomponent_assign): Convert the expression before
953 the call to alloc_scalar_allocatable_subcomponent so that a
954 good string length is provided.
955 (gfc_trans_structure_assign): Remove the unneeded derived type
956 symbol from calls to gfc_trans_subcomponent_assign.
958 2023-05-15 Harald Anlauf <anlauf@gmx.de>
961 * expr.cc (gfc_check_vardef_context): Check appropriate pointer
962 attribute for CLASS vs. non-CLASS function result in variable
965 2023-05-11 Xi Ruoyao <xry111@xry111.site>
967 * Make-lang.in: Use grep instead of fgrep.
969 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
971 * dump-parse-tree.cc (gfc_debug_expr): Remove forward declaration.
972 (debug): Add DEBUG_FUNCTION.
973 (show_code_node): Remove erroneous whitespace.
975 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
978 * dump-parse-tree.cc (debug): New function for gfc_namespace.
979 (gfc_debug_code): Delete forward declaration.
980 (show_attr): Make sure to print balanced braces.
982 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
984 * resolve.cc (resolve_select_type): Fix coding style.
986 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
988 * resolve.cc (resolve_select_type): Call free() unconditionally.
990 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
993 * expr.cc (find_array_section): Fix mpz memory leak.
994 * simplify.cc (gfc_simplify_reshape): Fix mpz memory leaks in
997 2023-05-05 Harald Anlauf <anlauf@gmx.de>
1000 * arith.cc (eval_intrinsic): Check conformability of ranks of operands
1001 for intrinsic binary operators before performing type conversions.
1002 * gfortran.h (gfc_op_rank_conformable): Add prototype.
1003 * resolve.cc (resolve_operator): Check conformability of ranks of
1004 operands for intrinsic binary operators before performing type
1006 (gfc_op_rank_conformable): New helper function to compare ranks of
1007 operands of binary operator.
1009 2023-05-04 Julian Brown <julian@codesourcery.com>
1012 * openmp.cc (resolve_omp_clauses): Add diagnostic for
1013 non-pointer/non-allocatable attach/detach.
1014 * trans-openmp.cc (gfc_trans_omp_clauses): Remove dereference for
1015 pointer-to-scalar derived type component attach/detach. Fix
1016 attach/detach handling for descriptors.
1018 2023-04-28 Julian Brown <julian@codesourcery.com>
1021 * trans-openmp.cc (gfc_trans_omp_clauses): Attach/detach clause fixes.
1023 2023-04-28 Tobias Burnus <tobias@codesourcery.com>
1025 * gfortran.texi: Fix typos.
1026 * decl.cc: Fix typos in comments and in a variable name.
1027 * arith.cc: Fix comment typos.
1028 * check.cc: Likewise.
1029 * class.cc: Likewise.
1030 * dependency.cc: Likewise.
1031 * expr.cc: Likewise.
1032 * frontend-passes.cc: Likewise.
1033 * gfortran.h: Likewise.
1034 * intrinsic.cc: Likewise.
1035 * iresolve.cc: Likewise.
1036 * match.cc: Likewise.
1037 * module.cc: Likewise.
1038 * primary.cc: Likewise.
1039 * resolve.cc: Likewise.
1040 * simplify.cc: Likewise.
1041 * trans-array.cc: Likewise.
1042 * trans-decl.cc: Likewise.
1043 * trans-expr.cc: Likewise.
1044 * trans-intrinsic.cc: Likewise.
1045 * trans-openmp.cc: Likewise.
1046 * trans-stmt.cc: Likewise.
1048 2023-04-25 Tobias Burnus <tobias@codesourcery.com>
1050 * openmp.cc (gfc_resolve_omp_do_blocks): Handle zero
1051 or more than one exec statements before/after 'omp scan'.
1052 * trans-openmp.cc (gfc_trans_omp_do): Likewise.
1054 2023-04-22 Harald Anlauf <anlauf@gmx.de>
1055 Steven G. Kargl <kargl@gcc.gnu.org>
1058 * interface.cc (gfc_compare_actual_formal): Reject allocatable
1059 functions being used as actual argument for allocable dummy.
1061 2023-04-14 Harald Anlauf <anlauf@gmx.de>
1064 * simplify.cc (gfc_simplify_set_exponent): Fix implementation of
1065 compile-time simplification of intrinsic SET_EXPONENT for argument
1066 X < 1 and for I < 0.
1068 2023-04-14 Paul Thomas <pault@gcc.gnu.org>
1071 * gfortran.h : Add expr3_not_explicit bit field to gfc_code.
1072 * resolve.cc (resolve_allocate_expr): Set bit field when the
1073 default initializer is applied to expr3.
1074 * trans-stmt.cc (gfc_trans_allocate): If expr3_not_explicit is
1075 set, do not deallocate expr3.
1077 2023-04-13 Harald Anlauf <anlauf@gmx.de>
1080 * trans-expr.cc (gfc_conv_power_op): Use absu_hwi and
1081 unsigned HOST_WIDE_INT for portability.
1083 2023-04-12 Harald Anlauf <anlauf@gmx.de>
1086 * resolve.cc (resolve_entries): Handle functions with ENTRY and
1087 ALLOCATABLE results.
1088 * trans-expr.cc (gfc_conv_procedure_call): Functions with a result
1089 with the POINTER or ALLOCATABLE attribute shall not get any special
1090 treatment with -ff2c, as they cannot be written in Fortran 77.
1091 * trans-types.cc (gfc_return_by_reference): Likewise.
1092 (gfc_get_function_type): Likewise.
1094 2023-04-12 Harald Anlauf <anlauf@gmx.de>
1098 * interface.cc (compare_parameter): Enable type and rank checks for
1099 arguments of derived type from the intrinsic module ISO_C_BINDING.
1101 2023-04-08 Paul Thomas <pault@gcc.gnu.org>
1104 * iresolve.cc (gfc_resolve_adjustl, gfc_resolve_adjustr): if
1105 string length is deferred use the string typespec for result.
1106 * resolve.cc (resolve_assoc_var): Handle parentheses around the
1108 (resolve_block_construct): Remove unnecessary static decls.
1109 * trans-array.cc (gfc_conv_expr_descriptor): Guard string len
1110 expression in condition. Improve handling of string length and
1111 span, especially for substrings of the descriptor.
1112 (duplicate_allocatable): Make element type more explicit with
1114 * trans-decl.cc (gfc_get_symbol_decl): Emit a fatal error with
1115 appropriate message instead of ICE if symbol type is unknown.
1116 (gfc_generate_function_code): Set current locus to proc_sym
1118 * trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in
1119 'previous' and use if end expression in substring reference is
1121 (gfc_conv_string_length): Use gfc_conv_expr_descriptor if
1122 'expr_flat' is an array. Add post block to catch deallocation
1124 (gfc_conv_procedure_call): Assign the parmse string length to
1125 the expression string length, if it is deferred.
1126 (gfc_trans_alloc_subarray_assign): If this is a deferred string
1127 length component, store the string length in the hidden comp.
1128 Update the typespec length accordingly. Generate a new type
1129 spec for the call to gfc_duplicate-allocatable in this case.
1130 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
1131 deferred character array components.
1133 2023-04-04 Harald Anlauf <anlauf@gmx.de>
1136 * expr.cc (check_restricted): Adjust check for valid variables in
1137 restricted expressions: make no exception for module variables.
1139 2023-04-01 Thomas Koenig <tkoenig@gcc.gnu.org>
1141 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
1142 type name to be "long long".
1144 2023-03-30 Andrew Pinski <apinski@marvell.com>
1146 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
1147 type name to be "long long". Add a comment on why adding
1150 2023-03-28 Jakub Jelinek <jakub@redhat.com>
1153 * openmp.cc (gfc_omp_absent_contains_clause): Fix typo in diagnostics
1154 - composit -> composite.
1156 2023-03-25 Harald Anlauf <anlauf@gmx.de>
1159 * trans-decl.cc (gfc_conv_cfi_to_gfc): Remove dead code.
1161 2023-03-24 Harald Anlauf <anlauf@gmx.de>
1163 * expr.cc (free_expr0): Free also BOZ strings as part of an expression.
1165 2023-03-24 Haochen Gui <guihaoc@gcc.gnu.org>
1166 Tobias Burnus <tobias@codesourcery.com>
1169 * target-memory.cc (gfc_interpret_float): Return FAIL when
1170 native_interpret_expr gets a NULL tree.
1171 * arith.cc (gfc_hollerith2real): Return NULL when
1172 gfc_interpret_float fails.
1173 * error.cc (gfc_buffered_p): Define.
1174 * gfortran.h (gfc_buffered_p): Declare.
1175 * intrinsic.cc: Add diagnostic.h to include list.
1176 (do_simplify): Save errorcount and check it at finish. Report a
1177 "Cannot simplify expression" error on a bad result if error count
1178 doesn't change and no other errors buffered.
1180 2023-03-22 Harald Anlauf <anlauf@gmx.de>
1181 Steven G. Kargl <kargl@gcc.gnu.org>
1184 * resolve.cc (gfc_resolve_finalizers): Argument of a FINAL subroutine
1185 cannot be an alternate return.
1187 2023-03-21 Harald Anlauf <anlauf@gmx.de>
1190 * decl.cc (gfc_match_modproc): Reject MODULE PROCEDURE if not in a
1191 generic module interface.
1193 2023-03-21 Arsen Arsenović <arsen@aarsen.me>
1195 * invoke.texi: Remove usages of @gol.
1196 * intrinsic.texi: Ditto.
1198 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
1201 * trans-array.cc (gfc_trans_array_constructor_value): Correct
1202 incorrect setting of typespec.
1204 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
1207 * resolve.cc (generate_component_assignments): Restore the
1208 exclusion of allocatable components from the loop.
1210 2023-03-20 Harald Anlauf <anlauf@gmx.de>
1213 * invoke.texi: Correct documentation of how underscores are appended
1216 2023-03-20 Harald Anlauf <anlauf@gmx.de>
1219 * simplify.cc (gfc_simplify_nearest): Fix off-by-one error in setting
1220 up real kind-specific maximum exponent for mpfr.
1222 2023-03-20 Paul Thomas <pault@gcc.gnu.org>
1225 * resolve.cc (check_host_association): If an external function
1226 is typed but not declared explicitly to be external, change the
1227 old symbol from a variable to an external function.
1229 2023-03-19 Harald Anlauf <anlauf@gmx.de>
1232 * resolve.cc (resolve_fl_procedure): Check for an explicit interface
1233 of procedures with the BIND(C) attribute (F2018:15.4.2.2).
1235 2023-03-19 Thomas Koenig <tkoenig@gcc.gnu.org>
1237 * gfortran.texi: Mention behavior on overflow.
1239 2023-03-18 Paul Thomas <pault@gcc.gnu.org>
1244 * class.cc (finalize_component): Include the missing arguments
1245 in the call to the component's finalizer wrapper.
1246 (has_finalizer_component): Do not return true for procedure
1248 (finalizer_insert_packed_call): Remove the redundant argument
1249 in the call to the final subroutine.
1250 (generate_finalization_wrapper): Add support for assumed rank
1252 (gfc_may_be_finalized): New helper function.
1253 * dump-parse-tree.cc (write_proc): Whitespace.
1254 * gfortran.h : Add prototype for gfc_may_be_finalized.
1255 * resolve.cc (resolve_function): Correct derived types that
1256 have an incomplete namespace.
1257 (resolve_where, gfc_resolve_where_code_in_forall,
1258 gfc_resolve_forall_body, gfc_resolve_code): Check that the op
1259 code is still EXEC_ASSIGN. If it is set lhs to must finalize.
1260 (is_finalizable_type): New function.
1261 (generate_component_assignments): Set must_finalize if needed.
1262 (gfc_resolve_finalizers): Error if assumed rank finalizer is
1263 not the only one. Warning on lack of scalar finalizer modified
1264 to account for assumed rank finalizers.
1265 (generate_final_call): New function.
1266 (generate_component_assignments): Enclose the outermost call in
1267 a block to capture automatic deallocation and final calls.
1268 Set must_finalize as required to satisfy the standards. Use an
1269 explicit pointer assignment for pointer components to capture
1270 finalization of the target. Likewise use explicit assignment
1271 for allocatable components. Do not use the temporary copy of
1272 the lhs in defined assignment if the component is allocatable.
1273 Put the temporary in the same namespace as the lhs symbol if
1274 the component may be finalized. Remove the leading assignment
1275 from the expansion of assignment of components that have their
1276 own defined assignment components. Suppress finalization of
1277 assignment of temporary components to the lhs. Make an explicit
1278 final call for the rhs function temporary if it exists.
1279 (gfc_resolve_code): Set must_finalize for assignments with an
1280 array constructor on the rhs.
1281 (gfc_resolve_finalizers): Ensure that an assumed rank finalizer
1282 is the only finalizer for that type and correct the surprising
1283 warning for the lack of a scalar finalizer.
1284 (check_defined_assignments): Handle allocatable components.
1285 (resolve_fl_derived): Set referenced the vtab for use
1287 (resolve_symbol): Set referenced an unreferenced symbol that
1289 * trans-array.cc (gfc_trans_array_constructor_value): Add code
1290 to finalize the constructor result. Warn that this feature was
1291 removed in F2018 and that it is suppressed by -std=2018.
1292 (trans_array_constructor): Add finalblock, pass to previous
1293 and apply to loop->post if filled.
1294 (gfc_add_loop_ss_code): Add se finalblock to outer loop post.
1295 (gfc_trans_array_cobounds, gfc_trans_array_bounds): Add any
1296 generated finalization code to the main block.
1297 (structure_alloc_comps): Add boolean argument to suppress
1298 finalization and use it for calls from
1299 gfc_deallocate_alloc_comp_no_caf. Otherwise it defaults to
1301 (gfc_copy_alloc_comp_no_fini): New wrapper for
1302 structure_alloc_comps.
1303 (gfc_alloc_allocatable_for_assignment): Suppress finalization
1304 by setting new arg in call to gfc_deallocate_alloc_comp_no_caf.
1305 (gfc_trans_deferred_array): Use gfc_may_be_finalized and do not
1306 deallocate the components of entities with a leading '_' in the
1307 name that are also marked as artificial.
1308 * trans-array.h : Add the new boolean argument to the prototype
1309 of gfc_deallocate_alloc_comp_no_caf with a default of false.
1310 Add prototype for gfc_copy_alloc_comp_no_fini.
1311 * trans-decl.cc(init_intent_out_dt): Tidy up the code.
1312 * trans-expr.cc (gfc_init_se): Initialize finalblock.
1313 (gfc_conv_procedure_call): Use gfc_finalize_tree_expr to
1314 finalize function results. Replace in-line block for class
1315 results with call to new function.
1316 (gfc_conv_expr): Finalize structure constructors for F2003 and
1317 F2008. Warn that this feature was deleted in F2018 and, unlike
1318 array constructors, is not default. Add array constructor
1319 finalblock to the post block.
1320 (gfc_trans_scalar_assign): Suppress finalization by setting new
1321 argument in call to gfc_deallocate_alloc_comp_no_caf. Add the
1322 finalization blocks to the main block.
1323 (gfc_trans_arrayfunc_assign): Use gfc_assignment_finalizer_call
1324 and ensure that finalization occurs after the evaluation of the
1325 rhs but using the initial value for the lhs. Finalize rhs
1326 function results using gfc_finalize_tree_expr.
1327 (trans_class_assignment, gfc_trans_assignment_1): As previous
1328 function, taking care to order evaluation, assignment and
1329 finalization correctly.
1330 * trans-io.cc (gfc_trans_transfer): Add the final block.
1331 * trans-stmt.cc (gfc_trans_call, gfc_trans_allocate): likewise.
1332 (trans_associate_var): Nullify derived allocatable components
1333 and finalize function targets with defined assignment
1334 components on leaving the block scope.
1335 (trans_allocate): Finalize source expressions, if required,
1336 and set init_expr artificial temporarily to suppress the
1337 finalization in gfc_trans_assignment.
1338 * trans.cc (gfc_add_finalizer_call): Do not finalize the
1339 temporaries generated in type assignment with defined
1340 assignment components.
1341 (gfc_assignment_finalizer_call): New function.
1342 (gfc_finalize_tree_expr): New function.
1343 * trans.h: Add finalblock to gfc_se. Add the prototypes for
1344 gfc_finalize_tree_expr and gfc_assignment_finalizer_call.
1346 2023-03-15 Harald Anlauf <anlauf@gmx.de>
1347 Tobias Burnus <tobias@codesourcery.com>
1350 * interface.cc (compare_parameter): Adjust check of array dummy
1351 arguments to handle the case of CLASS variables.
1353 2023-03-11 Harald Anlauf <anlauf@gmx.de>
1356 * trans-expr.cc (gfc_copy_class_to_class): Convert element counts in
1357 bounds check to common type for comparison.
1359 2023-03-10 Harald Anlauf <anlauf@gmx.de>
1362 * resolve.cc (resolve_symbol): Avoid NULL pointer dereference while
1363 checking a symbol with the BIND(C) attribute.
1365 2023-03-05 Harald Anlauf <anlauf@gmx.de>
1366 Tobias Burnus <tobias@codesourcery.com>
1369 * class.cc (gfc_build_class_symbol): Handle update of attributes of
1370 existing class container.
1371 (gfc_find_derived_vtab): Fix several memory leaks.
1372 (find_intrinsic_vtab): Ditto.
1373 * decl.cc (attr_decl1): Manage update of symbol attributes from
1375 * primary.cc (gfc_variable_attr): OPTIONAL shall not be taken or
1376 updated from the class container.
1377 * symbol.cc (free_old_symbol): Adjust management of symbol versions
1378 to not prematurely free array specs while working on the declation
1381 2023-03-01 Tobias Burnus <tobias@codesourcery.com>
1383 PR middle-end/108546
1384 * trans-openmp.cc (gfc_trans_omp_clauses): Fix mapping of
1385 type(C_ptr) variables.
1387 2023-02-27 Harald Anlauf <anlauf@gmx.de>
1390 * trans-intrinsic.cc (gfc_conv_intrinsic_ibits): Handle corner case
1391 LEN argument of IBITS equal to BITSIZE(I).
1393 2023-02-25 Mikael Morin <mikael@gcc.gnu.org>
1396 * intrinsic.cc (get_intrinsic_dummy_arg,
1397 set_intrinsic_dummy_arg): Rename the former to the latter.
1398 Remove the return value, add a reference to the lhs as argument,
1399 and do the pointer assignment inside the function. Don't do
1400 it if the pointer is already non-NULL.
1401 (sort_actual): Update caller.
1403 2023-02-25 Harald Anlauf <anlauf@gmx.de>
1405 * arith.cc (gfc_real2int): Clear mpfr variable after use.
1407 2023-02-25 Tobias Burnus <tobias@codesourcery.com>
1410 * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Skip setting of
1411 bounds of CFI desc for 'pointer,intent(out)'.
1413 2023-02-24 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
1415 * trans-decl.cc (gfc_finish_var_decl): Apply attribute.
1416 (generate_local_decl): Add diagnostic for dummy and local variables.
1418 2023-02-24 Mikael Morin <mikael@gcc.gnu.org>
1421 * expr.cc (gfc_free_actual_arglist): Free associated_dummy
1423 (gfc_copy_actual_arglist): Make a copy of the associated_dummy
1424 field if it is set in the original element.
1426 2023-02-24 Harald Anlauf <anlauf@gmx.de>
1429 * frontend-passes.cc (do_subscript): Clear used gmp variable.
1431 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
1433 * invoke.texi: Reorder index entries around @items.
1435 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
1437 * invoke.texi: Reorder @opindex commands to precede @items they
1440 2023-02-22 Harald Anlauf <anlauf@gmx.de>
1443 * resolve.cc (resolve_component): The type of a CHARACTER length
1444 expression must be INTEGER.
1446 2023-02-21 Harald Anlauf <anlauf@gmx.de>
1449 * parse.cc (check_function_result_typed): Improve type check of
1450 specification expression for character length and return status.
1451 (parse_spec): Use status from above.
1452 * resolve.cc (resolve_fntype): Prevent use of invalid specification
1453 expression for character length.
1455 2023-02-16 Patrick Palka <ppalka@redhat.com>
1457 * gfortran.h: Mechanically drop static from static inline
1458 functions via s/^static inline/inline/g.
1460 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
1463 * frontend-passes.cc (do_intent): Catch NULL pointer dereference on
1464 reference to invalid formal argument.
1466 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
1469 * resolve.cc (check_assumed_size_reference): Avoid NULL pointer
1472 2023-02-15 Tobias Burnus <tobias@codesourcery.com>
1475 * openmp.cc (gfc_resolve_omp_parallel_blocks): Handle combined 'loop'
1477 (gfc_resolve_do_iterator): Set a source location for added
1478 'private'-clause arguments.
1479 * resolve.cc (gfc_resolve_code): Call gfc_resolve_omp_do_blocks
1480 also for EXEC_OMP_LOOP and gfc_resolve_omp_parallel_blocks for
1481 combined directives with loop + '{masked,master} taskloop (simd)'.
1483 2023-02-13 Harald Anlauf <anlauf@gmx.de>
1486 * primary.cc (gfc_expr_attr): Avoid NULL pointer dereference for
1487 invalid use of CLASS variable.
1489 2023-02-13 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
1491 * decl.cc: Add EXT_ATTR_NOINLINE, EXT_ATTR_NORETURN, EXT_ATTR_WEAK.
1492 * gfortran.h (ext_attr_id_t): Ditto.
1493 * gfortran.texi (GCC$ ATTRIBUTES): Document them.
1494 * trans-decl.cc (build_function_decl): Apply them.
1496 2023-02-09 Harald Anlauf <anlauf@gmx.de>
1497 Steven G. Kargl <kargl@gcc.gnu.org>
1501 * intrinsic.cc (gfc_convert_chartype): Recover on invalid character
1502 kind in conversion instead of generating an internal error.
1504 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
1507 * trans-openmp.cc (struct dovar_init_d): Add 'sym' and
1508 'non_unit_incr' members.
1509 (gfc_nonrect_loop_expr): New.
1510 (gfc_trans_omp_do): Call it; use normal loop bounds
1511 for unit stride - and only create local loop var.
1513 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
1515 * parse.cc (decode_omp_directive): Really ignore 'assumes' with
1518 2023-02-08 Steve Kargl <kargl@gcc.gnu.org>
1521 * resolve.cc (resolve_common_vars): Avoid NULL pointer dereference
1522 when a symbol's location is not set.
1524 2023-02-07 Harald Anlauf <anlauf@gmx.de>
1527 * trans-decl.cc (gfc_finish_var_decl): With -fno-automatic, do not
1528 make ASSOCIATE variables TREE_STATIC.
1530 2023-02-05 Harald Anlauf <anlauf@gmx.de>
1533 * arith.cc (gfc_arith_divide): Emit integer division truncation
1534 warnings using gfc_warning instead of gfc_warning_now to prevent
1537 2023-02-03 Jakub Jelinek <jakub@redhat.com>
1540 * trans-decl.cc (gfc_trans_use_stmts): Call clear_slot before
1543 2023-02-01 Harald Anlauf <anlauf@gmx.de>
1546 * expr.cc (find_array_section): Add check to prevent interpreting an
1547 mpz non-integer constant as an integer.
1549 2023-02-01 Tobias Burnus <tobias@codesourcery.com>
1551 * openmp.cc (resolve_omp_clauses): Check also for
1554 2023-01-29 Mikael Morin <mikael@gcc.gnu.org>
1557 * check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
1558 (gfc_check_findloc): Ditto.
1560 2023-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1563 * parse.cc (parse_module): Remove use of a bool error value
1564 that prevented proper setting of the namespace pointer.
1566 2023-01-28 Harald Anlauf <anlauf@gmx.de>
1567 Steven G. Kargl <kargl@gcc.gnu.org>
1570 * resolve.cc (compare_bound_int): Expression to compare must be of
1572 (compare_bound_mpz_t): Likewise.
1573 (check_dimension): Fix comment on checks applied to array section
1574 and clean up associated logic.
1576 2023-01-28 Harald Anlauf <anlauf@gmx.de>
1579 * match.cc (gfc_match_common): A USE associated name shall not appear
1580 in a COMMON block (F2018:C8121).
1582 2023-01-27 Tobias Burnus <tobias@codesourcery.com>
1585 * trans-openmp.cc (gfc_split_omp_clauses): Handle has_device_addr.
1587 2023-01-26 Harald Anlauf <anlauf@gmx.de>
1590 * resolve.cc (check_host_association): Extend host association check
1591 so that it is not restricted to functions. Also prevent NULL pointer
1594 2023-01-25 Steve Kargl <kargl@gcc.gnu.org>
1597 * array.cc (compare_bounds): Return false instead of generating an
1598 internal error on an invalid argument type.
1600 2023-01-24 Harald Anlauf <anlauf@gmx.de>
1603 * simplify.cc (simplify_transformation): Do not try to simplify
1604 transformational intrinsic when the ARRAY argument has a NULL shape.
1606 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1609 * dependency.cc (gfc_check_dependency): Prevent NULL pointer
1610 dereference while recursively checking expressions.
1612 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1615 * interface.cc (get_expr_storage_size): Check array subscript triplets
1616 that we actually have integer values before trying to extract with
1619 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1622 * iresolve.cc (check_charlen_present): Preserve character length if
1623 there is no array constructor.
1625 2023-01-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1628 * data.cc (gfc_assign_data_value): Remove check for PARAMETER in DATA.
1629 * primary.cc (match_variable): Add check for PARAMETER in DATA.
1631 2023-01-19 Harald Anlauf <anlauf@gmx.de>
1634 * expr.cc (class_allocatable): Prevent NULL pointer dereference
1636 (class_pointer): Likewise.
1638 2023-01-17 Harald Anlauf <anlauf@gmx.de>
1641 * interface.cc (get_expr_storage_size): Check that we actually have
1642 an integer value before trying to extract it with mpz_get_si.
1644 2023-01-12 Tobias Burnus <tobias@codesourcery.com>
1647 * openmp.cc (gfc_resolve_omp_assumptions): Reject nonscalars.
1649 2023-01-11 Jakub Jelinek <jakub@redhat.com>
1652 * f95-lang.cc (gfc_init_builtin_function): Fix up function types
1653 for BUILT_IN_REALLOC and BUILT_IN_SINCOS{F,,L}. Formatting fixes.
1655 2023-01-10 Harald Anlauf <anlauf@gmx.de>
1658 * frontend-passes.cc (do_subscript): Clear used gmp variables.
1660 2023-01-02 Jakub Jelinek <jakub@redhat.com>
1662 * gfortranspec.cc (lang_specific_driver): Update copyright notice
1664 * gfc-internals.texi: Bump @copying's copyright year.
1665 * gfortran.texi: Ditto.
1666 * intrinsic.texi: Ditto.
1667 * invoke.texi: Ditto.
1670 Copyright (C) 2023 Free Software Foundation, Inc.
1672 Copying and distribution of this file, with or without modification,
1673 are permitted in any medium without royalty provided the copyright
1674 notice and this notice are preserved.