1 2023-10-04 Paul Thomas <pault@gcc.gnu.org>
5 * trans-expr.cc (gfc_trans_scalar_assign): Finalize components
6 on deallocation if derived type is not finalizable.
8 2023-10-03 David Malcolm <dmalcolm@redhat.com>
10 * error.cc (gfc_format_decoder): Update for "m_" prefixes to
13 2023-10-02 David Malcolm <dmalcolm@redhat.com>
15 * error.cc (gfc_diagnostics_init): Update for change to start_span.
17 2023-10-02 David Malcolm <dmalcolm@redhat.com>
19 * error.cc (gfc_diagnostic_starter): Update for reorganization of
20 source-printing fields of diagnostic_context.
21 (gfc_diagnostics_init): Likewise.
22 (gfc_diagnostics_finish): Likewise.
24 2023-09-29 Andre Vehreschild <vehre@gcc.gnu.org>
27 * trans-array.cc (structure_alloc_comps): Deref coarray.
28 (gfc_trans_deferred_array): Add freeing of components after
29 check for allocated coarray.
31 2023-09-24 Paul Thomas <pault@gcc.gnu.org>
35 * decl.cc (fix_initializer_charlen): New function broken out of
37 (add_init_expr_to_sym, build_struct): Call the new function.
38 * trans-expr.cc (gfc_conv_intrinsic_to_class): Remove repeated
41 2023-09-23 Harald Anlauf <anlauf@gmx.de>
44 * class.cc (gfc_build_class_symbol): Do not try to build class
45 container for invalid typespec.
46 * resolve.cc (resolve_fl_var_and_proc): Prevent NULL pointer
48 (resolve_symbol): Likewise.
50 2023-09-19 Harald Anlauf <anlauf@gmx.de>
53 * trans-array.cc (trans_array_constructor): In absence of a typespec,
54 use string length determined by get_array_ctor_strlen() to reasonably
55 initialize auxiliary variable for bounds-checking.
57 2023-09-15 Harald Anlauf <anlauf@gmx.de>
60 * trans-array.cc (trans_array_bound_check): Add optional argument
61 COMPNAME for explicit specification of array component name.
62 (array_bound_check_elemental): Helper function for generating
63 bounds-checking code for elemental dimensions.
64 (gfc_conv_expr_descriptor): Use bounds-checking also for elemental
65 dimensions, i.e. those not handled by the scalarizer.
67 2023-09-15 Mikael Morin <mikael@gcc.gnu.org>
70 * gfortran.h (gfc_symbol): Add comment documenting reference counting.
71 * parse.cc (parse_interface): Remove reference count incrementation.
73 2023-09-12 Mikael Morin <mikael@gcc.gnu.org>
76 * gfortran.h (gfc_release_symbol): Set return type to bool.
77 * symbol.cc (gfc_release_symbol): Ditto. Return whether symbol was
79 (delete_symbol_from_ns): New, outline code from...
80 (gfc_restore_last_undo_checkpoint): ... here. Delete new symbols
81 from two more namespaces.
83 2023-09-09 Mikael Morin <mikael@gcc.gnu.org>
85 * bbt.cc (delete_treap): Add argument REMOVED, set it to the removed
86 element from the tree. Change NULL to nullptr.
87 (gfc_delete_bbt): Return the removed element from the tree.
88 * gfortran.h (gfc_delete_symtree): Remove prototype.
89 (gfc_delete_bbt): Set return type to pointer.
90 * symbol.cc (gfc_delete_symtree): Make static. Get the element to be
91 freed from the result of gfc_delete_bbt. Remove the preliminary walk to
94 2023-09-01 Harald Anlauf <anlauf@gmx.de>
97 * trans-array.cc (gfc_conv_ss_startstride): For array bounds checking,
98 consider also array constructors in expressions, and use their shape.
100 2023-08-31 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
102 * gfortran.texi: Likewise.
104 2023-08-30 Mikael Morin <mikael@gcc.gnu.org>
107 * gfortran.h (gfc_drop_interface_elements_before): New prototype.
108 (gfc_current_interface_head): Return a reference to the pointer.
109 * interface.cc (gfc_current_interface_head): Ditto.
110 (free_interface_elements_until): New function, generalizing
112 (gfc_free_interface): Use free_interface_elements_until.
113 (gfc_drop_interface_elements_before): New function.
115 (current_interface_ptr, previous_interface_head): New static variables.
116 (current_interface_valid_p, get_current_interface_ptr): New functions.
117 (decode_statement): Initialize previous_interface_head.
118 (reject_statement): Restore current interface pointer to point to
119 previous_interface_head.
121 2023-08-26 Paul Thomas <pault@gcc.gnu.org>
124 * trans-expr.cc (gfc_trans_arrayfunc_assign): Supply a missing
125 dereference for the call to gfc_deallocate_alloc_comp_no_caf.
127 2023-08-25 Sandra Loosemore <sandra@codesourcery.com>
129 * gfortran.h (struct gfc_namespace): Add omp_structured_block bit.
130 * openmp.cc: Include omp-api.h.
131 (resolve_omp_clauses): Consolidate inscan reduction clause conflict
133 (find_nested_loop_in_chain): New.
134 (find_nested_loop_in_block): New.
135 (gfc_resolve_omp_do_blocks): Set omp_current_do_collapse properly.
136 Handle imperfectly-nested loops when looking for nested omp scan.
137 Refactor to move inscan reduction clause conflict checking to
139 (gfc_resolve_do_iterator): Handle imperfectly-nested loops.
140 (struct icode_error_state): New.
141 (icode_code_error_callback): New.
142 (icode_expr_error_callback): New.
143 (diagnose_intervening_code_errors_1): New.
144 (diagnose_intervening_code_errors): New.
145 (make_structured_block): New.
146 (restructure_intervening_code): New.
147 (is_outer_iteration_variable): Do not assume loops are perfectly
149 (check_nested_loop_in_chain): New.
150 (check_nested_loop_in_block_state): New.
151 (check_nested_loop_in_block_symbol): New.
152 (check_nested_loop_in_block): New.
153 (expr_uses_intervening_var): New.
154 (is_intervening_var): New.
155 (expr_is_invariant): Do not assume loops are perfectly nested.
156 (resolve_omp_do): Handle imperfectly-nested loops.
157 * trans-stmt.cc (gfc_trans_block_construct): Generate
158 OMP_STRUCTURED_BLOCK if magic bit is set on block namespace.
160 2023-08-25 Harald Anlauf <anlauf@gmx.de>
163 * data.cc (get_array_index): Add bounds-checking code and return error
164 status. Overindexing will be allowed as an extension for -std=legacy
165 and generate an error in standard-conforming mode.
166 (gfc_assign_data_value): Use error status from get_array_index for
167 graceful error recovery.
169 2023-08-25 Uros Bizjak <ubizjak@gmail.com>
171 * match.cc (gfc_match_equivalence): Rename TRUE/FALSE to true/false.
172 * module.cc (check_access): Ditto.
173 * primary.cc (match_real_constant): Ditto.
174 * trans-array.cc (gfc_trans_allocate_array_storage): Ditto.
175 (get_array_ctor_strlen): Ditto.
176 * trans-common.cc (find_equivalence): Ditto.
177 (add_equivalences): Ditto.
179 2023-08-23 Harald Anlauf <anlauf@gmx.de>
182 * resolve.cc (is_non_constant_shape_array): Add forward declaration.
183 (resolve_common_vars): Diagnose automatic array object in COMMON.
184 (resolve_symbol): Prevent confusing follow-on error.
186 2023-08-22 Tobias Burnus <tobias@codesourcery.com>
188 * gfortran.h (enum gfc_omp_defaultmap_category):
189 Add OMP_DEFAULTMAP_CAT_ALL.
190 * openmp.cc (gfc_match_omp_clauses): Parse
192 * trans-openmp.cc (gfc_trans_omp_clauses): Handle it.
194 2023-08-22 Harald Anlauf <anlauf@gmx.de>
197 * data.cc (gfc_advance_section): Derive next index set and next offset
198 into DATA variable also for array references using vector sections.
199 Use auxiliary array to keep track of offsets into indexing vectors.
200 (gfc_get_section_index): Set up initial indices also for DATA variables
201 with array references using vector sections.
202 * data.h (gfc_get_section_index): Adjust prototype.
203 (gfc_advance_section): Likewise.
204 * resolve.cc (check_data_variable): Pass vector offsets.
206 2023-08-16 Harald Anlauf <anlauf@gmx.de>
209 * trans-expr.cc (conv_scalar_char_value): Use gfc_replace_expr to
210 avoid leaking replaced gfc_expr.
212 2023-08-15 Martin Jambor <mjambor@suse.cz>
213 Harald Anlauf <anlauf@gmx.de>
216 * resolve.cc (resolve_structure_cons): Check comp->ts is character
217 type before accessing stuff through comp->ts.u.cl.
219 2023-08-15 Chung-Lin Tang <cltang@codesourcery.com>
220 Thomas Schwinge <thomas@codesourcery.com>
222 * openmp.cc (OACC_DATA_CLAUSES): Add OMP_CLAUSE_DEFAULT.
224 2023-08-14 Mikael Morin <mikael@gcc.gnu.org>
228 * trans-types.cc (gfc_sym_type): Use a bare character type for length
229 one value character dummy arguments.
230 * trans-expr.cc (gfc_conv_string_parameter): Handle single character
232 (gfc_conv_procedure_call): Don't exclude interoperable kinds
233 from single character handling. For single character dummy arguments,
234 extend the existing handling of non-constant expressions to constant
237 2023-08-14 Mikael Morin <mikael@gcc.gnu.org>
239 * gfortran.h (gfc_length_one_character_type_p): New inline
241 * check.cc (is_c_interoperable): Use
242 gfc_length_one_character_type_p.
243 * decl.cc (verify_bind_c_sym): Same.
244 * trans-expr.cc (gfc_conv_procedure_call): Same.
246 2023-08-09 Steve Kargl <sgk@troutmask.apl.washington.edu>
249 * resolve.cc (resolve_types): Exclude contained procedures with
250 the artificial attribute from test for pureness.
252 2023-07-31 Chung-Lin Tang <cltang@codesourcery.com>
254 * openmp.cc (resolve_omp_clauses): Add checking requiring
255 OpenACC host_data construct to have an use_device clause.
257 2023-07-28 Harald Anlauf <anlauf@gmx.de>
260 * gfortran.texi: Clarify argument passing convention.
261 * trans-expr.cc (gfc_conv_procedure_call): Do not pass the character
262 length as hidden argument when the declared dummy argument is
265 2023-07-27 Tobias Burnus <tobias@codesourcery.com>
267 * openmp.cc (resolve_omp_target): Minor cleanup.
268 * parse.cc (decode_omp_directive): Find TARGET statement
269 also higher in the stack.
271 2023-07-26 Harald Anlauf <anlauf@gmx.de>
274 * resolve.cc (check_data_variable): Do not accept strings with
275 deferred length or non-constant length in a DATA statement.
276 Reject also substrings of string variables of non-constant length.
278 2023-07-25 Tobias Burnus <tobias@codesourcery.com>
282 * gfortran.h (gfc_omp_clauses): Add target_first_st_is_teams.
283 * parse.cc (parse_omp_structured_block): Set it if the first
284 statement in the structured block of a TARGET is TEAMS or
285 a combined/composite starting with TEAMS.
286 * openmp.cc (resolve_omp_target): Also show an error for
287 contains_teams_construct without target_first_st_is_teams.
289 2023-07-24 Tobias Burnus <tobias@codesourcery.com>
293 * gfortran.h (gfc_omp_clauses): Add contains_teams_construct.
294 * openmp.cc (resolve_omp_target): New; check for teams nesting.
295 (gfc_resolve_omp_directive): Call it.
296 * parse.cc (decode_omp_directive): Set contains_teams_construct
297 on enclosing ST_OMP_TARGET.
299 2023-07-20 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
301 * trans-intrinsic.cc (conv_intrinsic_ieee_comparison): Only
304 2023-07-20 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
306 * f95-lang.cc (gfc_init_builtin_functions): Add __builtin_iseqsig.
307 * trans-intrinsic.cc (conv_intrinsic_ieee_comparison): New
309 (gfc_conv_ieee_arithmetic_function): Handle IEEE comparisons.
311 2023-07-19 Tobias Burnus <tobias@codesourcery.com>
314 * trans-openmp.cc (gfc_nonrect_loop_expr): Accept all
316 (gfc_trans_omp_do): Likewise; use sign to determine
319 2023-07-17 Harald Anlauf <anlauf@gmx.de>
323 * trans-expr.cc (gfc_conv_procedure_call): For intrinsic procedures
324 whose result characteristics depends on the first argument and which
325 can be of type character, the character length will not be deferred.
327 2023-07-17 Tobias Burnus <tobias@codesoucery.com>
328 Chung-Lin Tang <cltang@codesourcery.com>
330 * dump-parse-tree.cc (show_omp_namelist, show_omp_clauses): Dump
331 uses_allocators clause.
332 * gfortran.h (gfc_free_omp_namelist): Add memspace_sym to u union
333 and traits_sym to u2 union.
334 (OMP_LIST_USES_ALLOCATORS): New enum value.
335 (gfc_free_omp_namelist): Add 'bool free_mem_traits_space' arg.
336 * match.cc (gfc_free_omp_namelist): Likewise.
337 * openmp.cc (gfc_free_omp_clauses, gfc_match_omp_variable_list,
338 gfc_match_omp_to_link, gfc_match_omp_doacross_sink,
339 gfc_match_omp_clause_reduction, gfc_match_omp_allocate,
340 gfc_match_omp_flush): Update call.
341 (gfc_match_omp_clauses): Likewise. Parse uses_allocators clause.
342 (gfc_match_omp_clause_uses_allocators): New.
343 (enum omp_mask2): Add new OMP_CLAUSE_USES_ALLOCATORS.
344 (OMP_TARGET_CLAUSES): Accept it.
345 (resolve_omp_clauses): Resolve uses_allocators clause
346 * st.cc (gfc_free_statement): Update gfc_free_omp_namelist call.
347 * trans-openmp.cc (gfc_trans_omp_clauses): Handle
348 OMP_LIST_USES_ALLOCATORS; fail with sorry unless predefined allocator.
349 (gfc_split_omp_clauses): Handle uses_allocators.
351 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
354 * trans.h (gfc_deallocate_with_status): Add class container
356 (gfc_deallocate_scalar_with_status): Ditto.
357 * trans.cc (gfc_deallocate_with_status): Add class container
358 argument and pass it down to gfc_add_finalize_call.
359 (gfc_deallocate_scalar_with_status): Same.
360 * trans-array.cc (structure_alloc_comps): Update caller.
361 * trans-stmt.cc (gfc_trans_deallocate): Ditto.
362 * trans-expr.cc (gfc_conv_procedure_call): Ditto. Pass
363 pre-evaluated class container argument if it's available.
365 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
368 * trans.h (gfc_add_finalizer_call): Add class container argument.
369 * trans.cc (gfc_add_finalizer_call): Ditto. Pass down new
370 argument to get_final_proc_ref, get_elem_size, get_var_desc,
372 (get_elem_size): Add class container argument.
373 Use provided class container if it's available.
374 (get_var_descr): Same.
376 (get_final_proc_ref): Same. Add boolean telling the class
377 container argument is used. Set it. Don't try to use
378 final_wrapper if class container argument was used.
380 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
382 * trans.cc (get_var_descr): Factor scalar descriptor generation.
384 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
386 * trans.cc (get_vptr): New function.
387 (gfc_add_finalizer_call): Move virtual table pointer evaluation
390 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
392 * trans.cc (get_var_descr): Remove argument ts. Use var->ts
394 (gfc_add_finalizer_call): Update caller.
396 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
398 * trans.cc (gfc_add_finalizer_call): Inline definition of
399 variable has_finalizer. Merge nested conditions.
401 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
403 * trans.cc (gfc_add_finalizer_call): Remove local variable
404 final_expr. Pass down expr to get_final_proc_ref and move
405 final procedure expression generation down to its one usage
406 in get_final_proc_ref.
407 (get_final_proc_ref): Add argument expr. Remove argument
408 final_wrapper. Recreate final_wrapper from expr.
410 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
412 * trans.cc (gfc_add_finalizer_call): Remove local variable
413 elem_size. Pass expression to get_elem_size and move the
414 element size expression generation close to its usage there.
415 (get_elem_size): Add argument expr, remove class_size argument
416 and rebuild it from expr. Remove ts argument and use the
417 type of expr instead.
419 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
421 * trans.cc (gfc_add_finalizer_call): Move pre and post code for
422 the final procedure pointer expression to the outer block.
423 Reuse the previously evaluated final procedure pointer
426 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
428 * trans.cc (gfc_add_finalizer_call): Add post code for desc_se
429 after the finalizer call. Add post code for final_se and
432 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
434 * trans.cc (gfc_build_final_call): Inline...
435 (gfc_add_finalizer_call): ... to its one caller.
437 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
439 * trans.cc (get_var_descr): New function.
440 (gfc_build_final_call): Outline the data reference descriptor
441 evaluation code to get_var_descr.
443 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
445 * trans.cc (get_elem_size): New function.
446 (gfc_build_final_call): Outline the element size evaluation
449 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
451 * trans.cc (get_final_proc_ref): New function.
452 (gfc_build_final_call): Outline the pointer evaluation code
453 to get_final_proc_ref.
455 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
457 * trans.cc (gfc_build_final_call): Remove commented assertion.
459 2023-07-14 Mikael Morin <mikael@gcc.gnu.org>
462 * trans.h (gfc_reset_vptr): Add class_container argument.
463 * trans-expr.cc (gfc_reset_vptr): Ditto. If a valid vptr can
464 be obtained through class_container argument, bypass evaluation
466 (gfc_conv_procedure_call): Wrap the argument evaluation code
467 in a conditional if the associated dummy is optional. Evaluate
468 the data reference to a pointer now, and replace later
469 references with usage of the pointer.
471 2023-07-14 Mikael Morin <mikael@gcc.gnu.org>
474 * trans.h (struct gfc_se): New field class_container.
475 (struct gfc_ss_info): Ditto.
476 (gfc_evaluate_data_ref_now): New prototype.
477 * trans.cc (gfc_evaluate_data_ref_now): Implement it.
478 * trans-array.cc (gfc_conv_ss_descriptor): Copy class_container
479 field from gfc_se struct to gfc_ss_info struct.
480 (gfc_conv_expr_descriptor): Copy class_container field from
481 gfc_ss_info struct to gfc_se struct.
482 * trans-expr.cc (gfc_conv_class_to_class): Use class container
483 set in class_container field if available.
484 (gfc_conv_variable): Set class_container field on encountering
485 class variables or components, clear it on encountering
486 non-class components.
487 (gfc_conv_procedure_call): Evaluate data ref to a pointer now,
488 and replace later references by usage of the pointer.
490 2023-07-14 Mikael Morin <mikael@gcc.gnu.org>
493 * trans-expr.cc (gfc_conv_procedure_call): Use a separate gfc_se
494 struct, initalized from parmse, to generate the class wrapper.
495 After the class wrapper code has been generated, copy it back
496 depending on whether parameter deallocation code has been
499 2023-07-13 Mikael Morin <mikael@gcc.gnu.org>
502 * symbol.cc (gfc_restore_last_undo_checkpoint): Release symbols
505 2023-07-12 Andre Vehreschild <vehre@gcc.gnu.org>
508 * expr.cc (find_inquiry_ref): Replace len of pdt_string by
510 (simplify_ref_chain): Ensure input to find_inquiry_ref is
512 (gfc_match_init_expr): Prevent PDT analysis for function calls.
513 (gfc_pdt_find_component_copy_initializer): Get the initializer
514 value for given component.
515 * gfortran.h (gfc_pdt_find_component_copy_initializer): New
517 * simplify.cc (gfc_simplify_len): Replace len() of PDT with pdt
518 component ref or constant.
520 2023-07-11 Harald Anlauf <anlauf@gmx.de>
523 * symbol.cc (gfc_copy_formal_args_intr): When deriving the formal
524 argument attributes from the actual ones for intrinsic procedure
525 calls, take special care of CHARACTER arguments that we do not
526 wrongly treat them formally as deferred-length.
528 2023-07-08 Steve Kargl <sgk@troutmask.apl.washington.edu>
532 * match.cc (gfc_match_namelist): Check for host associated or
533 defined types before applying default type.
534 (gfc_match_select_rank): Apply default type to selector of
535 unknown type if possible.
536 * resolve.cc (resolve_fl_variable): Do not apply local default
537 initialization to assumed rank entities.
539 2023-07-08 Harald Anlauf <anlauf@gmx.de>
540 Steven G. Kargl <kargl@gcc.gnu.org>
543 * trans-expr.cc (gfc_conv_procedure_call): Check procedures for
544 allocatable dummy arguments with INTENT(OUT) and move deallocation
545 of actual arguments after evaluation of argument expressions before
546 the procedure is executed.
548 2023-07-08 Harald Anlauf <anlauf@gmx.de>
551 * arith.cc (gfc_compare_expr): Handle equality comparison of constant
552 complex gfc_expr arguments.
554 2023-07-05 Robin Dapp <rdapp@ventanamicro.com>
555 Juzhe-Zhong <juzhe.zhong@rivai.ai>
557 * trans-types.cc (gfc_type_for_mode): Ditto.
559 2023-06-28 Harald Anlauf <anlauf@gmx.de>
562 * trans-expr.cc (gfc_conv_procedure_call): For non-constant string
563 argument passed to CHARACTER(LEN=1),VALUE dummy, ensure proper
564 dereferencing and truncation of string to length 1.
566 2023-06-28 Paul Thomas <pault@gcc.gnu.org>
569 * expr.cc (gfc_is_ptr_fcn): Remove reference to class_pointer.
570 * resolve.cc (resolve_assoc_var): Call gfc_is_ptr_fcn to allow
571 associate names with pointer function targets to be used in
572 variable definition context.
573 * trans-decl.cc (get_symbol_decl): Remove extraneous line.
574 * trans-expr.cc (alloc_scalar_allocatable_subcomponent): Obtain
575 size of intrinsic and character expressions.
576 (gfc_trans_subcomponent_assign): Expand assignment to class
577 components to include intrinsic and character expressions.
579 2023-06-24 Harald Anlauf <anlauf@gmx.de>
582 * trans-expr.cc (gfc_conv_procedure_call): Truncate constant string
583 argument of length > 1 passed to scalar CHARACTER(1),VALUE dummy.
585 2023-06-23 Harald Anlauf <anlauf@gmx.de>
588 * trans-expr.cc (gfc_conv_procedure_call): Pass actual argument
589 to scalar CHARACTER(1),VALUE dummy argument by value.
591 2023-06-21 Paul Thomas <pault@gcc.gnu.org>
598 * decl.cc (char_len_param_value): Fix memory leak.
599 (resolve_block_construct): Remove unnecessary static decls.
600 * expr.cc (gfc_is_ptr_fcn): New function.
601 (gfc_check_vardef_context): Use it to permit pointer function
602 result selectors to be used for associate names in variable
604 * gfortran.h: Prototype for gfc_is_ptr_fcn.
605 * match.cc (build_associate_name): New function.
606 (gfc_match_select_type): Use the new function to replace inline
607 version and to build a new associate name for the case where
608 the supplied associate name is already used for that purpose.
609 * resolve.cc (resolve_assoc_var): Call gfc_is_ptr_fcn to allow
610 associate names with pointer function targets to be used in
611 variable definition context.
612 * trans-decl.cc (gfc_get_symbol_decl): Unlimited polymorphic
613 variables need deferred initialisation of the vptr.
614 (gfc_trans_deferred_vars): Do the vptr initialisation.
615 * trans-stmt.cc (trans_associate_var): Ensure that a pointer
616 associate name points to the target of the selector and not
619 2023-06-21 Paul Thomas <pault@gcc.gnu.org>
622 * trans-expr.cc (gfc_conv_procedure_call): The hidden string
623 length must not be passed to a formal arg of type(cptr).
625 2023-06-20 Tobias Burnus <tobias@codesourcery.com>
627 * dump-parse-tree.cc (show_omp_namelist): Fix dump of the allocator
628 modifier of OMP_LIST_ALLOCATE.
630 2023-06-20 Tobias Burnus <tobias@codesourcery.com>
632 * match.cc (gfc_match_char): Match with '%S' a symbol
635 2023-06-19 Tobias Burnus <tobias@codesourcery.com>
637 * intrinsic.texi (OpenMP Modules OMP_LIB and OMP_LIB_KINDS): Also
638 add references to the OpenMP 5.1 and 5.2 spec; add omp_initial_device
639 and omp_invalid_device named constants.
641 2023-06-13 Harald Anlauf <anlauf@gmx.de>
642 Mikael Morin <mikael@gcc.gnu.org>
645 * trans-array.cc (gfc_trans_allocate_array_storage): When passing a
646 zero-sized array with fixed (= non-dynamic) size, allocate temporary
647 by the caller, not by the callee.
649 2023-06-10 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
651 * f95-lang.cc (gfc_init_builtin_functions): Add fmax() and
652 fmin() built-ins, and their variants.
653 * mathbuiltins.def: Add FMAX and FMIN built-ins.
654 * trans-intrinsic.cc (conv_intrinsic_ieee_minmax): New function.
655 (gfc_conv_ieee_arithmetic_function): Handle IEEE_MIN_NUM and
656 IEEE_MAX_NUM functions.
658 2023-06-09 Jakub Jelinek <jakub@redhat.com>
661 * primary.cc (gfc_convert_to_structure_constructor): Only do
662 constant string ctor length verification and truncation/padding
663 if constant length has INTEGER type.
665 2023-06-08 Paul Thomas <pault@gcc.gnu.org>
671 * decl.cc (char_len_param_value): Simplify a copy of the expr
672 and replace the original if there is no error.
673 * gfortran.h : Remove the redundant field 'rankguessed' from
674 'gfc_association_list'.
675 * resolve.cc (resolve_assoc_var): Remove refs to 'rankguessed'.
676 (resolve_variable): Associate names with constant or structure
677 constructor targets cannot have array refs.
678 * trans-array.cc (gfc_conv_expr_descriptor): Guard expression
679 character length backend decl before using it. Suppress the
680 assignment if lhs equals rhs.
681 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
682 associate variables pointing to a variable. Add comment.
683 * trans-stmt.cc (trans_associate_var): Remove requirement that
684 the character length be deferred before assigning the value
685 returned by gfc_conv_expr_descriptor. Also, guard the backend
686 decl before testing with VAR_P.
688 2023-06-06 Kwok Cheung Yeung <kcy@codesourcery.com>
689 Tobias Burnus <tobias@codesourcery.com>
691 * dump-parse-tree.cc (show_omp_namelist): Display 'present' map
693 (show_omp_clauses): Display 'present' motion modifier for 'to'
695 * gfortran.h (enum gfc_omp_map_op): Add entries with 'present'
697 (struct gfc_omp_namelist): Add 'present_modifer'.
698 * openmp.cc (gfc_match_motion_var_list): New, handles optional
699 'present' modifier for to/from clauses.
700 (gfc_match_omp_clauses): Call it for to/from clauses; parse 'present'
701 in defaultmap and map clauses.
702 (resolve_omp_clauses): Allow 'present' modifiers on 'target',
703 'target data', 'target enter' and 'target exit' directives.
704 * trans-openmp.cc (gfc_trans_omp_clauses): Apply 'present' modifiers
705 to tree node for 'map', 'to' and 'from' clauses. Apply 'present' for
708 2023-06-02 Steve Kargl <kargl@gcc.gnu.org>
711 * resolve.cc (resolve_select_rank): Remove duplicate error.
712 (resolve_fl_var_and_proc): Prevent NULL pointer dereference and
713 suppress error message for temporary.
715 2023-06-02 Paul Thomas <pault@gcc.gnu.org>
718 * parse.cc (parse_associate): Replace the existing evaluation
719 of the target rank with calls to gfc_resolve_ref and
720 gfc_expression_rank. Identify untyped target function results
721 with structure constructors by finding the appropriate derived
723 * resolve.cc (resolve_symbol): Allow associate variables to be
726 2023-06-01 Harald Anlauf <anlauf@gmx.de>
729 * decl.cc (gfc_match_kind_spec): Use error path on missing right
731 (gfc_match_decl_type_spec): Use error return when an error occurred
732 during matching a KIND specifier.
734 2023-06-01 Tobias Burnus <tobias@codesourcery.com>
736 * parse.cc (decode_omp_directive): Accept all pure directives
737 inside a PURE procedures; handle 'error at(execution).
739 2023-05-26 Tobias Burnus <tobias@codesourcery.com>
741 * dump-parse-tree.cc (show_omp_namelist): Update allocator, fix
743 (show_omp_node, show_code_node): Handle EXEC_OMP_ALLOCATE.
744 * gfortran.h (enum gfc_statement): Add ST_OMP_ALLOCATE and ..._EXEC.
745 (enum gfc_exec_op): Add EXEC_OMP_ALLOCATE.
746 (struct gfc_omp_namelist): Add 'allocator' to 'u2' union.
747 (struct gfc_namespace): Add omp_allocate.
748 (gfc_resolve_omp_allocate): New.
749 * match.cc (gfc_free_omp_namelist): Free 'u2.allocator'.
750 * match.h (gfc_match_omp_allocate, gfc_match_omp_allocators): New.
751 * openmp.cc (gfc_omp_directives): Uncomment allocate/allocators.
752 (gfc_match_omp_variable_list): Add bool arg for
753 rejecting listening common-block vars separately.
754 (gfc_match_omp_clauses): Update for u2.allocators.
755 (OMP_ALLOCATORS_CLAUSES, gfc_match_omp_allocate,
756 gfc_match_omp_allocators, is_predefined_allocator,
757 gfc_resolve_omp_allocate): New.
758 (resolve_omp_clauses): Update 'allocate' clause checks.
759 (omp_code_to_statement, gfc_resolve_omp_directive): Handle
760 OMP ALLOCATE/ALLOCATORS.
761 * parse.cc (in_exec_part): New global var.
762 (check_omp_allocate_stmt, parse_openmp_allocate_block): New.
763 (decode_omp_directive, case_exec_markers, case_omp_decl,
764 gfc_ascii_statement, parse_omp_structured_block): Handle
765 OMP allocate/allocators.
766 (verify_st_order, parse_executable): Set in_exec_part.
767 * resolve.cc (gfc_resolve_blocks, resolve_codes): Handle
769 * st.cc (gfc_free_statement): Likewise.
770 * trans.cc (trans_code): Likewise.
771 * trans-openmp.cc (gfc_trans_omp_directive): Likewise.
772 (gfc_trans_omp_clauses, gfc_split_omp_clauses): Update for
773 u2.allocator, fix for u.align.
775 2023-05-24 Harald Anlauf <anlauf@gmx.de>
778 * simplify.cc (simplify_size): Reject DIM argument of intrinsic SIZE
779 with error when out of valid range.
781 2023-05-24 Harald Anlauf <anlauf@gmx.de>
784 * check.cc (gfc_check_reshape): Expand constant arguments SHAPE and
785 ORDER before checking.
786 * gfortran.h (gfc_is_constant_array_expr): Add prototype.
787 * iresolve.cc (gfc_resolve_reshape): Expand constant argument SHAPE.
788 * simplify.cc (is_constant_array_expr): If array is determined to be
789 constant, expand small array constructors if needed.
790 (gfc_is_constant_array_expr): Wrapper for is_constant_array_expr.
791 (gfc_simplify_reshape): Fix check for insufficient elements in SOURCE
792 when no padding specified.
794 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
797 * resolve.cc (gfc_resolve_ref): Conversion of array_ref into an
798 element should be done for all characters without a len expr,
799 not just deferred lens, and for integer expressions.
800 * trans-expr.cc (conv_inquiry): For len and kind inquiry refs,
801 set the se string_length to NULL_TREE.
803 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
804 Steven G. Kargl <kargl@gcc.gnu.org>
807 * decl.cc (variable_decl): Clean up white space issues.
808 (gfc_match_final_decl): Declaration of finalizable derived type
809 is allowed in a submodule.
811 2023-05-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
813 * expr.cc (gfc_get_corank): Use CLASS_DATA from gfortran.h.
814 * resolve.cc (resolve_component): Same.
815 (resolve_fl_derived0): Same.
816 * simplify.cc (gfc_simplify_extends_type_of): Same.
817 (simplify_cobound): Same.
819 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
821 * trans-array.cc (is_pointer_array): Use _P() defines from tree.h.
822 (gfc_conv_scalarized_array_ref): Ditto.
823 (gfc_conv_array_ref): Ditto.
824 * trans-decl.cc (gfc_finish_decl): Ditto.
825 (gfc_get_symbol_decl): Ditto.
826 * trans-expr.cc (gfc_trans_pointer_assignment): Ditto.
827 (gfc_trans_arrayfunc_assign): Ditto.
828 (gfc_trans_assignment_1): Ditto.
829 * trans-intrinsic.cc (gfc_conv_intrinsic_minmax): Ditto.
830 (conv_intrinsic_ieee_value): Ditto.
831 * trans-io.cc (gfc_convert_array_to_string): Ditto.
832 * trans-openmp.cc (gfc_omp_is_optional_argument): Ditto.
833 (gfc_trans_omp_clauses): Ditto.
834 * trans-stmt.cc (gfc_conv_label_variable): Ditto.
835 * trans.cc (gfc_build_addr_expr): Ditto.
836 (get_array_span): Ditto.
838 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
841 * array.cc (compare_bounds): Use narrower return type.
842 (gfc_compare_array_spec): Likewise.
843 (is_constant_element): Likewise.
844 (gfc_constant_ac): Likewise.
845 * check.cc (dim_rank_check): Likewise.
846 * cpp.cc (gfc_cpp_init_options): Likewise.
847 (dump_macro): Likewise.
848 * cpp.h (gfc_cpp_handle_option): Likewise.
849 * dependency.cc (gfc_ref_needs_temporary_p): Likewise.
850 (gfc_check_argument_dependency): Likewise.
851 (gfc_check_fncall_dependency): Likewise.
852 (ref_same_as_full_array): Likewise.
853 * dependency.h (gfc_check_fncall_dependency): Likewise.
854 (gfc_dep_resolver): Likewise.
855 (gfc_are_equivalenced_arrays): Likewise.
856 * expr.cc (gfc_copy_ref): Likewise.
857 (gfc_kind_max): Likewise.
858 (numeric_type): Likewise.
859 * gfortran.h (gfc_at_end): Likewise.
860 (gfc_at_eof): Likewise.
861 (gfc_at_bol): Likewise.
862 (gfc_at_eol): Likewise.
863 (gfc_define_undef_line): Likewise.
864 (gfc_wide_is_printable): Likewise.
865 (gfc_wide_is_digit): Likewise.
866 (gfc_wide_fits_in_byte): Likewise.
867 (gfc_find_sym_tree): Likewise.
868 (gfc_generic_intrinsic): Likewise.
869 (gfc_specific_intrinsic): Likewise.
870 (gfc_intrinsic_actual_ok): Likewise.
871 (gfc_has_vector_index): Likewise.
872 (gfc_numeric_ts): Likewise.
873 (gfc_impure_variable): Likewise.
874 (gfc_pure): Likewise.
875 (gfc_implicit_pure): Likewise.
876 (gfc_elemental): Likewise.
877 (gfc_pure_function): Likewise.
878 (gfc_implicit_pure_function): Likewise.
879 (gfc_compare_array_spec): Likewise.
880 (gfc_constant_ac): Likewise.
881 (gfc_expanded_ac): Likewise.
882 (gfc_check_digit): Likewise.
883 * intrinsic.cc (gfc_find_subroutine): Likewise.
884 (gfc_generic_intrinsic): Likewise.
885 (gfc_specific_intrinsic): Likewise.
886 * io.cc (compare_to_allowed_values): Likewise. And remove
887 unneeded forward declaration.
888 * parse.cc: Likewise.
889 * parse.h (gfc_check_do_variable): Likewise.
890 * primary.cc (gfc_check_digit): Likewise.
891 * resolve.cc (resolve_structure_cons): Likewise.
892 (pure_stmt_function): Likewise.
893 (gfc_pure_function): Likewise.
894 (impure_stmt_fcn): Likewise.
895 (resolve_forall_iterators): Likewise.
896 (resolve_data): Likewise.
897 (gfc_impure_variable): Likewise.
898 (gfc_pure): Likewise.
899 (gfc_unset_implicit_pure): Likewise.
900 * scanner.cc (wide_is_ascii): Likewise.
901 (gfc_wide_toupper): Likewise.
902 (gfc_open_included_file): Likewise.
903 (gfc_at_end): Likewise.
904 (gfc_at_eof): Likewise.
905 (gfc_at_bol): Likewise.
906 (skip_comment_line): Likewise.
907 (gfc_gobble_whitespace): Likewise.
908 * symbol.cc (gfc_find_symtree_in_proc): Likewise.
909 * trans-array.cc: Likewise.
910 * trans-decl.cc (gfc_set_decl_assembler_name): Likewise.
911 * trans-types.cc (gfc_get_element_type): Likewise.
912 (gfc_add_field_to_struct): Likewise.
913 * trans-types.h (gfc_copy_dt_decls_ifequal): Likewise.
914 (gfc_return_by_reference): Likewise.
915 (gfc_is_nodesc_array): Likewise.
916 * trans.h (gfc_can_put_var_on_stack): Likewise.
918 2023-05-17 Harald Anlauf <anlauf@gmx.de>
922 * decl.cc (add_init_expr_to_sym): Set shape of initializer also for
923 zero-sized arrays, so that bounds violations can be detected later.
925 2023-05-17 Tobias Burnus <tobias@codesourcery.com>
927 * trans-decl.cc (gfc_get_symbol_decl): Add attributes
928 such as 'declare target' also to hidden artificial
929 variable for deferred-length character variables.
930 * trans-openmp.cc (gfc_trans_omp_array_section,
931 gfc_trans_omp_clauses, gfc_trans_omp_target_exit_data):
932 Improve mapping of array descriptors and deferred-length
935 2023-05-16 Paul Thomas <pault@gcc.gnu.org>
943 * interface.cc (gfc_compare_actual_formal): Emit an error if an
944 unlimited polymorphic actual is not matched either to an
945 unlimited or assumed type formal argument.
946 * resolve.cc (resolve_ordinary_assign): Emit an error if the
947 var expression of an ordinary assignment is a proc pointer
949 * trans-array.cc (gfc_walk_array_ref): Provide assumed shape
950 arrays coming from interface mapping with a viable arrayspec.
951 * trans-expr.cc (gfc_conv_intrinsic_to_class): Tidy up flagging
952 of unlimited polymorphic 'class_ts'.
953 (gfc_conv_gfc_desc_to_cfi_desc): Assumed type is unlimited
954 polymorphic and should accept any actual type.
955 (gfc_conv_procedure_call): Replace dreadful kludge with a call
956 to gfc_finalize_tree_expr. Avoid dereferencing a void pointer
957 by giving it the pointer type of the actual argument.
958 (alloc_scalar_allocatable_subcomponent): Shorten the function
959 name and replace the symbol argument with the se string length.
960 If a deferred length character length is either not present or
961 is not a variable, give the typespec a variable and assign the
962 string length to that. Use gfc_deferred_strlen to find the
963 hidden string length component.
964 (gfc_trans_subcomponent_assign): Convert the expression before
965 the call to alloc_scalar_allocatable_subcomponent so that a
966 good string length is provided.
967 (gfc_trans_structure_assign): Remove the unneeded derived type
968 symbol from calls to gfc_trans_subcomponent_assign.
970 2023-05-15 Harald Anlauf <anlauf@gmx.de>
973 * expr.cc (gfc_check_vardef_context): Check appropriate pointer
974 attribute for CLASS vs. non-CLASS function result in variable
977 2023-05-11 Xi Ruoyao <xry111@xry111.site>
979 * Make-lang.in: Use grep instead of fgrep.
981 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
983 * dump-parse-tree.cc (gfc_debug_expr): Remove forward declaration.
984 (debug): Add DEBUG_FUNCTION.
985 (show_code_node): Remove erroneous whitespace.
987 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
990 * dump-parse-tree.cc (debug): New function for gfc_namespace.
991 (gfc_debug_code): Delete forward declaration.
992 (show_attr): Make sure to print balanced braces.
994 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
996 * resolve.cc (resolve_select_type): Fix coding style.
998 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1000 * resolve.cc (resolve_select_type): Call free() unconditionally.
1002 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1005 * expr.cc (find_array_section): Fix mpz memory leak.
1006 * simplify.cc (gfc_simplify_reshape): Fix mpz memory leaks in
1009 2023-05-05 Harald Anlauf <anlauf@gmx.de>
1012 * arith.cc (eval_intrinsic): Check conformability of ranks of operands
1013 for intrinsic binary operators before performing type conversions.
1014 * gfortran.h (gfc_op_rank_conformable): Add prototype.
1015 * resolve.cc (resolve_operator): Check conformability of ranks of
1016 operands for intrinsic binary operators before performing type
1018 (gfc_op_rank_conformable): New helper function to compare ranks of
1019 operands of binary operator.
1021 2023-05-04 Julian Brown <julian@codesourcery.com>
1024 * openmp.cc (resolve_omp_clauses): Add diagnostic for
1025 non-pointer/non-allocatable attach/detach.
1026 * trans-openmp.cc (gfc_trans_omp_clauses): Remove dereference for
1027 pointer-to-scalar derived type component attach/detach. Fix
1028 attach/detach handling for descriptors.
1030 2023-04-28 Julian Brown <julian@codesourcery.com>
1033 * trans-openmp.cc (gfc_trans_omp_clauses): Attach/detach clause fixes.
1035 2023-04-28 Tobias Burnus <tobias@codesourcery.com>
1037 * gfortran.texi: Fix typos.
1038 * decl.cc: Fix typos in comments and in a variable name.
1039 * arith.cc: Fix comment typos.
1040 * check.cc: Likewise.
1041 * class.cc: Likewise.
1042 * dependency.cc: Likewise.
1043 * expr.cc: Likewise.
1044 * frontend-passes.cc: Likewise.
1045 * gfortran.h: Likewise.
1046 * intrinsic.cc: Likewise.
1047 * iresolve.cc: Likewise.
1048 * match.cc: Likewise.
1049 * module.cc: Likewise.
1050 * primary.cc: Likewise.
1051 * resolve.cc: Likewise.
1052 * simplify.cc: Likewise.
1053 * trans-array.cc: Likewise.
1054 * trans-decl.cc: Likewise.
1055 * trans-expr.cc: Likewise.
1056 * trans-intrinsic.cc: Likewise.
1057 * trans-openmp.cc: Likewise.
1058 * trans-stmt.cc: Likewise.
1060 2023-04-25 Tobias Burnus <tobias@codesourcery.com>
1062 * openmp.cc (gfc_resolve_omp_do_blocks): Handle zero
1063 or more than one exec statements before/after 'omp scan'.
1064 * trans-openmp.cc (gfc_trans_omp_do): Likewise.
1066 2023-04-22 Harald Anlauf <anlauf@gmx.de>
1067 Steven G. Kargl <kargl@gcc.gnu.org>
1070 * interface.cc (gfc_compare_actual_formal): Reject allocatable
1071 functions being used as actual argument for allocable dummy.
1073 2023-04-14 Harald Anlauf <anlauf@gmx.de>
1076 * simplify.cc (gfc_simplify_set_exponent): Fix implementation of
1077 compile-time simplification of intrinsic SET_EXPONENT for argument
1078 X < 1 and for I < 0.
1080 2023-04-14 Paul Thomas <pault@gcc.gnu.org>
1083 * gfortran.h : Add expr3_not_explicit bit field to gfc_code.
1084 * resolve.cc (resolve_allocate_expr): Set bit field when the
1085 default initializer is applied to expr3.
1086 * trans-stmt.cc (gfc_trans_allocate): If expr3_not_explicit is
1087 set, do not deallocate expr3.
1089 2023-04-13 Harald Anlauf <anlauf@gmx.de>
1092 * trans-expr.cc (gfc_conv_power_op): Use absu_hwi and
1093 unsigned HOST_WIDE_INT for portability.
1095 2023-04-12 Harald Anlauf <anlauf@gmx.de>
1098 * resolve.cc (resolve_entries): Handle functions with ENTRY and
1099 ALLOCATABLE results.
1100 * trans-expr.cc (gfc_conv_procedure_call): Functions with a result
1101 with the POINTER or ALLOCATABLE attribute shall not get any special
1102 treatment with -ff2c, as they cannot be written in Fortran 77.
1103 * trans-types.cc (gfc_return_by_reference): Likewise.
1104 (gfc_get_function_type): Likewise.
1106 2023-04-12 Harald Anlauf <anlauf@gmx.de>
1110 * interface.cc (compare_parameter): Enable type and rank checks for
1111 arguments of derived type from the intrinsic module ISO_C_BINDING.
1113 2023-04-08 Paul Thomas <pault@gcc.gnu.org>
1116 * iresolve.cc (gfc_resolve_adjustl, gfc_resolve_adjustr): if
1117 string length is deferred use the string typespec for result.
1118 * resolve.cc (resolve_assoc_var): Handle parentheses around the
1120 (resolve_block_construct): Remove unnecessary static decls.
1121 * trans-array.cc (gfc_conv_expr_descriptor): Guard string len
1122 expression in condition. Improve handling of string length and
1123 span, especially for substrings of the descriptor.
1124 (duplicate_allocatable): Make element type more explicit with
1126 * trans-decl.cc (gfc_get_symbol_decl): Emit a fatal error with
1127 appropriate message instead of ICE if symbol type is unknown.
1128 (gfc_generate_function_code): Set current locus to proc_sym
1130 * trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in
1131 'previous' and use if end expression in substring reference is
1133 (gfc_conv_string_length): Use gfc_conv_expr_descriptor if
1134 'expr_flat' is an array. Add post block to catch deallocation
1136 (gfc_conv_procedure_call): Assign the parmse string length to
1137 the expression string length, if it is deferred.
1138 (gfc_trans_alloc_subarray_assign): If this is a deferred string
1139 length component, store the string length in the hidden comp.
1140 Update the typespec length accordingly. Generate a new type
1141 spec for the call to gfc_duplicate-allocatable in this case.
1142 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
1143 deferred character array components.
1145 2023-04-04 Harald Anlauf <anlauf@gmx.de>
1148 * expr.cc (check_restricted): Adjust check for valid variables in
1149 restricted expressions: make no exception for module variables.
1151 2023-04-01 Thomas Koenig <tkoenig@gcc.gnu.org>
1153 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
1154 type name to be "long long".
1156 2023-03-30 Andrew Pinski <apinski@marvell.com>
1158 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
1159 type name to be "long long". Add a comment on why adding
1162 2023-03-28 Jakub Jelinek <jakub@redhat.com>
1165 * openmp.cc (gfc_omp_absent_contains_clause): Fix typo in diagnostics
1166 - composit -> composite.
1168 2023-03-25 Harald Anlauf <anlauf@gmx.de>
1171 * trans-decl.cc (gfc_conv_cfi_to_gfc): Remove dead code.
1173 2023-03-24 Harald Anlauf <anlauf@gmx.de>
1175 * expr.cc (free_expr0): Free also BOZ strings as part of an expression.
1177 2023-03-24 Haochen Gui <guihaoc@gcc.gnu.org>
1178 Tobias Burnus <tobias@codesourcery.com>
1181 * target-memory.cc (gfc_interpret_float): Return FAIL when
1182 native_interpret_expr gets a NULL tree.
1183 * arith.cc (gfc_hollerith2real): Return NULL when
1184 gfc_interpret_float fails.
1185 * error.cc (gfc_buffered_p): Define.
1186 * gfortran.h (gfc_buffered_p): Declare.
1187 * intrinsic.cc: Add diagnostic.h to include list.
1188 (do_simplify): Save errorcount and check it at finish. Report a
1189 "Cannot simplify expression" error on a bad result if error count
1190 doesn't change and no other errors buffered.
1192 2023-03-22 Harald Anlauf <anlauf@gmx.de>
1193 Steven G. Kargl <kargl@gcc.gnu.org>
1196 * resolve.cc (gfc_resolve_finalizers): Argument of a FINAL subroutine
1197 cannot be an alternate return.
1199 2023-03-21 Harald Anlauf <anlauf@gmx.de>
1202 * decl.cc (gfc_match_modproc): Reject MODULE PROCEDURE if not in a
1203 generic module interface.
1205 2023-03-21 Arsen Arsenović <arsen@aarsen.me>
1207 * invoke.texi: Remove usages of @gol.
1208 * intrinsic.texi: Ditto.
1210 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
1213 * trans-array.cc (gfc_trans_array_constructor_value): Correct
1214 incorrect setting of typespec.
1216 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
1219 * resolve.cc (generate_component_assignments): Restore the
1220 exclusion of allocatable components from the loop.
1222 2023-03-20 Harald Anlauf <anlauf@gmx.de>
1225 * invoke.texi: Correct documentation of how underscores are appended
1228 2023-03-20 Harald Anlauf <anlauf@gmx.de>
1231 * simplify.cc (gfc_simplify_nearest): Fix off-by-one error in setting
1232 up real kind-specific maximum exponent for mpfr.
1234 2023-03-20 Paul Thomas <pault@gcc.gnu.org>
1237 * resolve.cc (check_host_association): If an external function
1238 is typed but not declared explicitly to be external, change the
1239 old symbol from a variable to an external function.
1241 2023-03-19 Harald Anlauf <anlauf@gmx.de>
1244 * resolve.cc (resolve_fl_procedure): Check for an explicit interface
1245 of procedures with the BIND(C) attribute (F2018:15.4.2.2).
1247 2023-03-19 Thomas Koenig <tkoenig@gcc.gnu.org>
1249 * gfortran.texi: Mention behavior on overflow.
1251 2023-03-18 Paul Thomas <pault@gcc.gnu.org>
1256 * class.cc (finalize_component): Include the missing arguments
1257 in the call to the component's finalizer wrapper.
1258 (has_finalizer_component): Do not return true for procedure
1260 (finalizer_insert_packed_call): Remove the redundant argument
1261 in the call to the final subroutine.
1262 (generate_finalization_wrapper): Add support for assumed rank
1264 (gfc_may_be_finalized): New helper function.
1265 * dump-parse-tree.cc (write_proc): Whitespace.
1266 * gfortran.h : Add prototype for gfc_may_be_finalized.
1267 * resolve.cc (resolve_function): Correct derived types that
1268 have an incomplete namespace.
1269 (resolve_where, gfc_resolve_where_code_in_forall,
1270 gfc_resolve_forall_body, gfc_resolve_code): Check that the op
1271 code is still EXEC_ASSIGN. If it is set lhs to must finalize.
1272 (is_finalizable_type): New function.
1273 (generate_component_assignments): Set must_finalize if needed.
1274 (gfc_resolve_finalizers): Error if assumed rank finalizer is
1275 not the only one. Warning on lack of scalar finalizer modified
1276 to account for assumed rank finalizers.
1277 (generate_final_call): New function.
1278 (generate_component_assignments): Enclose the outermost call in
1279 a block to capture automatic deallocation and final calls.
1280 Set must_finalize as required to satisfy the standards. Use an
1281 explicit pointer assignment for pointer components to capture
1282 finalization of the target. Likewise use explicit assignment
1283 for allocatable components. Do not use the temporary copy of
1284 the lhs in defined assignment if the component is allocatable.
1285 Put the temporary in the same namespace as the lhs symbol if
1286 the component may be finalized. Remove the leading assignment
1287 from the expansion of assignment of components that have their
1288 own defined assignment components. Suppress finalization of
1289 assignment of temporary components to the lhs. Make an explicit
1290 final call for the rhs function temporary if it exists.
1291 (gfc_resolve_code): Set must_finalize for assignments with an
1292 array constructor on the rhs.
1293 (gfc_resolve_finalizers): Ensure that an assumed rank finalizer
1294 is the only finalizer for that type and correct the surprising
1295 warning for the lack of a scalar finalizer.
1296 (check_defined_assignments): Handle allocatable components.
1297 (resolve_fl_derived): Set referenced the vtab for use
1299 (resolve_symbol): Set referenced an unreferenced symbol that
1301 * trans-array.cc (gfc_trans_array_constructor_value): Add code
1302 to finalize the constructor result. Warn that this feature was
1303 removed in F2018 and that it is suppressed by -std=2018.
1304 (trans_array_constructor): Add finalblock, pass to previous
1305 and apply to loop->post if filled.
1306 (gfc_add_loop_ss_code): Add se finalblock to outer loop post.
1307 (gfc_trans_array_cobounds, gfc_trans_array_bounds): Add any
1308 generated finalization code to the main block.
1309 (structure_alloc_comps): Add boolean argument to suppress
1310 finalization and use it for calls from
1311 gfc_deallocate_alloc_comp_no_caf. Otherwise it defaults to
1313 (gfc_copy_alloc_comp_no_fini): New wrapper for
1314 structure_alloc_comps.
1315 (gfc_alloc_allocatable_for_assignment): Suppress finalization
1316 by setting new arg in call to gfc_deallocate_alloc_comp_no_caf.
1317 (gfc_trans_deferred_array): Use gfc_may_be_finalized and do not
1318 deallocate the components of entities with a leading '_' in the
1319 name that are also marked as artificial.
1320 * trans-array.h : Add the new boolean argument to the prototype
1321 of gfc_deallocate_alloc_comp_no_caf with a default of false.
1322 Add prototype for gfc_copy_alloc_comp_no_fini.
1323 * trans-decl.cc(init_intent_out_dt): Tidy up the code.
1324 * trans-expr.cc (gfc_init_se): Initialize finalblock.
1325 (gfc_conv_procedure_call): Use gfc_finalize_tree_expr to
1326 finalize function results. Replace in-line block for class
1327 results with call to new function.
1328 (gfc_conv_expr): Finalize structure constructors for F2003 and
1329 F2008. Warn that this feature was deleted in F2018 and, unlike
1330 array constructors, is not default. Add array constructor
1331 finalblock to the post block.
1332 (gfc_trans_scalar_assign): Suppress finalization by setting new
1333 argument in call to gfc_deallocate_alloc_comp_no_caf. Add the
1334 finalization blocks to the main block.
1335 (gfc_trans_arrayfunc_assign): Use gfc_assignment_finalizer_call
1336 and ensure that finalization occurs after the evaluation of the
1337 rhs but using the initial value for the lhs. Finalize rhs
1338 function results using gfc_finalize_tree_expr.
1339 (trans_class_assignment, gfc_trans_assignment_1): As previous
1340 function, taking care to order evaluation, assignment and
1341 finalization correctly.
1342 * trans-io.cc (gfc_trans_transfer): Add the final block.
1343 * trans-stmt.cc (gfc_trans_call, gfc_trans_allocate): likewise.
1344 (trans_associate_var): Nullify derived allocatable components
1345 and finalize function targets with defined assignment
1346 components on leaving the block scope.
1347 (trans_allocate): Finalize source expressions, if required,
1348 and set init_expr artificial temporarily to suppress the
1349 finalization in gfc_trans_assignment.
1350 * trans.cc (gfc_add_finalizer_call): Do not finalize the
1351 temporaries generated in type assignment with defined
1352 assignment components.
1353 (gfc_assignment_finalizer_call): New function.
1354 (gfc_finalize_tree_expr): New function.
1355 * trans.h: Add finalblock to gfc_se. Add the prototypes for
1356 gfc_finalize_tree_expr and gfc_assignment_finalizer_call.
1358 2023-03-15 Harald Anlauf <anlauf@gmx.de>
1359 Tobias Burnus <tobias@codesourcery.com>
1362 * interface.cc (compare_parameter): Adjust check of array dummy
1363 arguments to handle the case of CLASS variables.
1365 2023-03-11 Harald Anlauf <anlauf@gmx.de>
1368 * trans-expr.cc (gfc_copy_class_to_class): Convert element counts in
1369 bounds check to common type for comparison.
1371 2023-03-10 Harald Anlauf <anlauf@gmx.de>
1374 * resolve.cc (resolve_symbol): Avoid NULL pointer dereference while
1375 checking a symbol with the BIND(C) attribute.
1377 2023-03-05 Harald Anlauf <anlauf@gmx.de>
1378 Tobias Burnus <tobias@codesourcery.com>
1381 * class.cc (gfc_build_class_symbol): Handle update of attributes of
1382 existing class container.
1383 (gfc_find_derived_vtab): Fix several memory leaks.
1384 (find_intrinsic_vtab): Ditto.
1385 * decl.cc (attr_decl1): Manage update of symbol attributes from
1387 * primary.cc (gfc_variable_attr): OPTIONAL shall not be taken or
1388 updated from the class container.
1389 * symbol.cc (free_old_symbol): Adjust management of symbol versions
1390 to not prematurely free array specs while working on the declation
1393 2023-03-01 Tobias Burnus <tobias@codesourcery.com>
1395 PR middle-end/108546
1396 * trans-openmp.cc (gfc_trans_omp_clauses): Fix mapping of
1397 type(C_ptr) variables.
1399 2023-02-27 Harald Anlauf <anlauf@gmx.de>
1402 * trans-intrinsic.cc (gfc_conv_intrinsic_ibits): Handle corner case
1403 LEN argument of IBITS equal to BITSIZE(I).
1405 2023-02-25 Mikael Morin <mikael@gcc.gnu.org>
1408 * intrinsic.cc (get_intrinsic_dummy_arg,
1409 set_intrinsic_dummy_arg): Rename the former to the latter.
1410 Remove the return value, add a reference to the lhs as argument,
1411 and do the pointer assignment inside the function. Don't do
1412 it if the pointer is already non-NULL.
1413 (sort_actual): Update caller.
1415 2023-02-25 Harald Anlauf <anlauf@gmx.de>
1417 * arith.cc (gfc_real2int): Clear mpfr variable after use.
1419 2023-02-25 Tobias Burnus <tobias@codesourcery.com>
1422 * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Skip setting of
1423 bounds of CFI desc for 'pointer,intent(out)'.
1425 2023-02-24 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
1427 * trans-decl.cc (gfc_finish_var_decl): Apply attribute.
1428 (generate_local_decl): Add diagnostic for dummy and local variables.
1430 2023-02-24 Mikael Morin <mikael@gcc.gnu.org>
1433 * expr.cc (gfc_free_actual_arglist): Free associated_dummy
1435 (gfc_copy_actual_arglist): Make a copy of the associated_dummy
1436 field if it is set in the original element.
1438 2023-02-24 Harald Anlauf <anlauf@gmx.de>
1441 * frontend-passes.cc (do_subscript): Clear used gmp variable.
1443 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
1445 * invoke.texi: Reorder index entries around @items.
1447 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
1449 * invoke.texi: Reorder @opindex commands to precede @items they
1452 2023-02-22 Harald Anlauf <anlauf@gmx.de>
1455 * resolve.cc (resolve_component): The type of a CHARACTER length
1456 expression must be INTEGER.
1458 2023-02-21 Harald Anlauf <anlauf@gmx.de>
1461 * parse.cc (check_function_result_typed): Improve type check of
1462 specification expression for character length and return status.
1463 (parse_spec): Use status from above.
1464 * resolve.cc (resolve_fntype): Prevent use of invalid specification
1465 expression for character length.
1467 2023-02-16 Patrick Palka <ppalka@redhat.com>
1469 * gfortran.h: Mechanically drop static from static inline
1470 functions via s/^static inline/inline/g.
1472 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
1475 * frontend-passes.cc (do_intent): Catch NULL pointer dereference on
1476 reference to invalid formal argument.
1478 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
1481 * resolve.cc (check_assumed_size_reference): Avoid NULL pointer
1484 2023-02-15 Tobias Burnus <tobias@codesourcery.com>
1487 * openmp.cc (gfc_resolve_omp_parallel_blocks): Handle combined 'loop'
1489 (gfc_resolve_do_iterator): Set a source location for added
1490 'private'-clause arguments.
1491 * resolve.cc (gfc_resolve_code): Call gfc_resolve_omp_do_blocks
1492 also for EXEC_OMP_LOOP and gfc_resolve_omp_parallel_blocks for
1493 combined directives with loop + '{masked,master} taskloop (simd)'.
1495 2023-02-13 Harald Anlauf <anlauf@gmx.de>
1498 * primary.cc (gfc_expr_attr): Avoid NULL pointer dereference for
1499 invalid use of CLASS variable.
1501 2023-02-13 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
1503 * decl.cc: Add EXT_ATTR_NOINLINE, EXT_ATTR_NORETURN, EXT_ATTR_WEAK.
1504 * gfortran.h (ext_attr_id_t): Ditto.
1505 * gfortran.texi (GCC$ ATTRIBUTES): Document them.
1506 * trans-decl.cc (build_function_decl): Apply them.
1508 2023-02-09 Harald Anlauf <anlauf@gmx.de>
1509 Steven G. Kargl <kargl@gcc.gnu.org>
1513 * intrinsic.cc (gfc_convert_chartype): Recover on invalid character
1514 kind in conversion instead of generating an internal error.
1516 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
1519 * trans-openmp.cc (struct dovar_init_d): Add 'sym' and
1520 'non_unit_incr' members.
1521 (gfc_nonrect_loop_expr): New.
1522 (gfc_trans_omp_do): Call it; use normal loop bounds
1523 for unit stride - and only create local loop var.
1525 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
1527 * parse.cc (decode_omp_directive): Really ignore 'assumes' with
1530 2023-02-08 Steve Kargl <kargl@gcc.gnu.org>
1533 * resolve.cc (resolve_common_vars): Avoid NULL pointer dereference
1534 when a symbol's location is not set.
1536 2023-02-07 Harald Anlauf <anlauf@gmx.de>
1539 * trans-decl.cc (gfc_finish_var_decl): With -fno-automatic, do not
1540 make ASSOCIATE variables TREE_STATIC.
1542 2023-02-05 Harald Anlauf <anlauf@gmx.de>
1545 * arith.cc (gfc_arith_divide): Emit integer division truncation
1546 warnings using gfc_warning instead of gfc_warning_now to prevent
1549 2023-02-03 Jakub Jelinek <jakub@redhat.com>
1552 * trans-decl.cc (gfc_trans_use_stmts): Call clear_slot before
1555 2023-02-01 Harald Anlauf <anlauf@gmx.de>
1558 * expr.cc (find_array_section): Add check to prevent interpreting an
1559 mpz non-integer constant as an integer.
1561 2023-02-01 Tobias Burnus <tobias@codesourcery.com>
1563 * openmp.cc (resolve_omp_clauses): Check also for
1566 2023-01-29 Mikael Morin <mikael@gcc.gnu.org>
1569 * check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
1570 (gfc_check_findloc): Ditto.
1572 2023-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1575 * parse.cc (parse_module): Remove use of a bool error value
1576 that prevented proper setting of the namespace pointer.
1578 2023-01-28 Harald Anlauf <anlauf@gmx.de>
1579 Steven G. Kargl <kargl@gcc.gnu.org>
1582 * resolve.cc (compare_bound_int): Expression to compare must be of
1584 (compare_bound_mpz_t): Likewise.
1585 (check_dimension): Fix comment on checks applied to array section
1586 and clean up associated logic.
1588 2023-01-28 Harald Anlauf <anlauf@gmx.de>
1591 * match.cc (gfc_match_common): A USE associated name shall not appear
1592 in a COMMON block (F2018:C8121).
1594 2023-01-27 Tobias Burnus <tobias@codesourcery.com>
1597 * trans-openmp.cc (gfc_split_omp_clauses): Handle has_device_addr.
1599 2023-01-26 Harald Anlauf <anlauf@gmx.de>
1602 * resolve.cc (check_host_association): Extend host association check
1603 so that it is not restricted to functions. Also prevent NULL pointer
1606 2023-01-25 Steve Kargl <kargl@gcc.gnu.org>
1609 * array.cc (compare_bounds): Return false instead of generating an
1610 internal error on an invalid argument type.
1612 2023-01-24 Harald Anlauf <anlauf@gmx.de>
1615 * simplify.cc (simplify_transformation): Do not try to simplify
1616 transformational intrinsic when the ARRAY argument has a NULL shape.
1618 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1621 * dependency.cc (gfc_check_dependency): Prevent NULL pointer
1622 dereference while recursively checking expressions.
1624 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1627 * interface.cc (get_expr_storage_size): Check array subscript triplets
1628 that we actually have integer values before trying to extract with
1631 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1634 * iresolve.cc (check_charlen_present): Preserve character length if
1635 there is no array constructor.
1637 2023-01-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1640 * data.cc (gfc_assign_data_value): Remove check for PARAMETER in DATA.
1641 * primary.cc (match_variable): Add check for PARAMETER in DATA.
1643 2023-01-19 Harald Anlauf <anlauf@gmx.de>
1646 * expr.cc (class_allocatable): Prevent NULL pointer dereference
1648 (class_pointer): Likewise.
1650 2023-01-17 Harald Anlauf <anlauf@gmx.de>
1653 * interface.cc (get_expr_storage_size): Check that we actually have
1654 an integer value before trying to extract it with mpz_get_si.
1656 2023-01-12 Tobias Burnus <tobias@codesourcery.com>
1659 * openmp.cc (gfc_resolve_omp_assumptions): Reject nonscalars.
1661 2023-01-11 Jakub Jelinek <jakub@redhat.com>
1664 * f95-lang.cc (gfc_init_builtin_function): Fix up function types
1665 for BUILT_IN_REALLOC and BUILT_IN_SINCOS{F,,L}. Formatting fixes.
1667 2023-01-10 Harald Anlauf <anlauf@gmx.de>
1670 * frontend-passes.cc (do_subscript): Clear used gmp variables.
1672 2023-01-02 Jakub Jelinek <jakub@redhat.com>
1674 * gfortranspec.cc (lang_specific_driver): Update copyright notice
1676 * gfc-internals.texi: Bump @copying's copyright year.
1677 * gfortran.texi: Ditto.
1678 * intrinsic.texi: Ditto.
1679 * invoke.texi: Ditto.
1682 Copyright (C) 2023 Free Software Foundation, Inc.
1684 Copying and distribution of this file, with or without modification,
1685 are permitted in any medium without royalty provided the copyright
1686 notice and this notice are preserved.