1 2023-03-22 Harald Anlauf <anlauf@gmx.de>
2 Steven G. Kargl <kargl@gcc.gnu.org>
5 * resolve.cc (gfc_resolve_finalizers): Argument of a FINAL subroutine
6 cannot be an alternate return.
8 2023-03-21 Harald Anlauf <anlauf@gmx.de>
11 * decl.cc (gfc_match_modproc): Reject MODULE PROCEDURE if not in a
12 generic module interface.
14 2023-03-21 Arsen Arsenović <arsen@aarsen.me>
16 * invoke.texi: Remove usages of @gol.
17 * intrinsic.texi: Ditto.
19 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
22 * trans-array.cc (gfc_trans_array_constructor_value): Correct
23 incorrect setting of typespec.
25 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
28 * resolve.cc (generate_component_assignments): Restore the
29 exclusion of allocatable components from the loop.
31 2023-03-20 Harald Anlauf <anlauf@gmx.de>
34 * invoke.texi: Correct documentation of how underscores are appended
37 2023-03-20 Harald Anlauf <anlauf@gmx.de>
40 * simplify.cc (gfc_simplify_nearest): Fix off-by-one error in setting
41 up real kind-specific maximum exponent for mpfr.
43 2023-03-20 Paul Thomas <pault@gcc.gnu.org>
46 * resolve.cc (check_host_association): If an external function
47 is typed but not declared explicitly to be external, change the
48 old symbol from a variable to an external function.
50 2023-03-19 Harald Anlauf <anlauf@gmx.de>
53 * resolve.cc (resolve_fl_procedure): Check for an explicit interface
54 of procedures with the BIND(C) attribute (F2018:15.4.2.2).
56 2023-03-19 Thomas Koenig <tkoenig@gcc.gnu.org>
58 * gfortran.texi: Mention behavior on overflow.
60 2023-03-18 Paul Thomas <pault@gcc.gnu.org>
65 * class.cc (finalize_component): Include the missing arguments
66 in the call to the component's finalizer wrapper.
67 (has_finalizer_component): Do not return true for procedure
69 (finalizer_insert_packed_call): Remove the redundant argument
70 in the call to the final subroutine.
71 (generate_finalization_wrapper): Add support for assumed rank
73 (gfc_may_be_finalized): New helper function.
74 * dump-parse-tree.cc (write_proc): Whitespace.
75 * gfortran.h : Add prototype for gfc_may_be_finalized.
76 * resolve.cc (resolve_function): Correct derived types that
77 have an incomplete namespace.
78 (resolve_where, gfc_resolve_where_code_in_forall,
79 gfc_resolve_forall_body, gfc_resolve_code): Check that the op
80 code is still EXEC_ASSIGN. If it is set lhs to must finalize.
81 (is_finalizable_type): New function.
82 (generate_component_assignments): Set must_finalize if needed.
83 (gfc_resolve_finalizers): Error if assumed rank finalizer is
84 not the only one. Warning on lack of scalar finalizer modified
85 to account for assumed rank finalizers.
86 (generate_final_call): New function.
87 (generate_component_assignments): Enclose the outermost call in
88 a block to capture automatic deallocation and final calls.
89 Set must_finalize as required to satisfy the standards. Use an
90 explicit pointer assignment for pointer components to capture
91 finalization of the target. Likewise use explicit assignment
92 for allocatable components. Do not use the temporary copy of
93 the lhs in defined assignment if the component is allocatable.
94 Put the temporary in the same namespace as the lhs symbol if
95 the component may be finalized. Remove the leading assignment
96 from the expansion of assignment of components that have their
97 own defined assignment components. Suppress finalization of
98 assignment of temporary components to the lhs. Make an explicit
99 final call for the rhs function temporary if it exists.
100 (gfc_resolve_code): Set must_finalize for assignments with an
101 array constructor on the rhs.
102 (gfc_resolve_finalizers): Ensure that an assumed rank finalizer
103 is the only finalizer for that type and correct the surprising
104 warning for the lack of a scalar finalizer.
105 (check_defined_assignments): Handle allocatable components.
106 (resolve_fl_derived): Set referenced the vtab for use
108 (resolve_symbol): Set referenced an unreferenced symbol that
110 * trans-array.cc (gfc_trans_array_constructor_value): Add code
111 to finalize the constructor result. Warn that this feature was
112 removed in F2018 and that it is suppressed by -std=2018.
113 (trans_array_constructor): Add finalblock, pass to previous
114 and apply to loop->post if filled.
115 (gfc_add_loop_ss_code): Add se finalblock to outer loop post.
116 (gfc_trans_array_cobounds, gfc_trans_array_bounds): Add any
117 generated finalization code to the main block.
118 (structure_alloc_comps): Add boolean argument to suppress
119 finalization and use it for calls from
120 gfc_deallocate_alloc_comp_no_caf. Otherwise it defaults to
122 (gfc_copy_alloc_comp_no_fini): New wrapper for
123 structure_alloc_comps.
124 (gfc_alloc_allocatable_for_assignment): Suppress finalization
125 by setting new arg in call to gfc_deallocate_alloc_comp_no_caf.
126 (gfc_trans_deferred_array): Use gfc_may_be_finalized and do not
127 deallocate the components of entities with a leading '_' in the
128 name that are also marked as artificial.
129 * trans-array.h : Add the new boolean argument to the prototype
130 of gfc_deallocate_alloc_comp_no_caf with a default of false.
131 Add prototype for gfc_copy_alloc_comp_no_fini.
132 * trans-decl.cc(init_intent_out_dt): Tidy up the code.
133 * trans-expr.cc (gfc_init_se): Initialize finalblock.
134 (gfc_conv_procedure_call): Use gfc_finalize_tree_expr to
135 finalize function results. Replace in-line block for class
136 results with call to new function.
137 (gfc_conv_expr): Finalize structure constructors for F2003 and
138 F2008. Warn that this feature was deleted in F2018 and, unlike
139 array constructors, is not default. Add array constructor
140 finalblock to the post block.
141 (gfc_trans_scalar_assign): Suppress finalization by setting new
142 argument in call to gfc_deallocate_alloc_comp_no_caf. Add the
143 finalization blocks to the main block.
144 (gfc_trans_arrayfunc_assign): Use gfc_assignment_finalizer_call
145 and ensure that finalization occurs after the evaluation of the
146 rhs but using the initial value for the lhs. Finalize rhs
147 function results using gfc_finalize_tree_expr.
148 (trans_class_assignment, gfc_trans_assignment_1): As previous
149 function, taking care to order evaluation, assignment and
150 finalization correctly.
151 * trans-io.cc (gfc_trans_transfer): Add the final block.
152 * trans-stmt.cc (gfc_trans_call, gfc_trans_allocate): likewise.
153 (trans_associate_var): Nullify derived allocatable components
154 and finalize function targets with defined assignment
155 components on leaving the block scope.
156 (trans_allocate): Finalize source expressions, if required,
157 and set init_expr artificial temporarily to suppress the
158 finalization in gfc_trans_assignment.
159 * trans.cc (gfc_add_finalizer_call): Do not finalize the
160 temporaries generated in type assignment with defined
161 assignment components.
162 (gfc_assignment_finalizer_call): New function.
163 (gfc_finalize_tree_expr): New function.
164 * trans.h: Add finalblock to gfc_se. Add the prototypes for
165 gfc_finalize_tree_expr and gfc_assignment_finalizer_call.
167 2023-03-15 Harald Anlauf <anlauf@gmx.de>
168 Tobias Burnus <tobias@codesourcery.com>
171 * interface.cc (compare_parameter): Adjust check of array dummy
172 arguments to handle the case of CLASS variables.
174 2023-03-11 Harald Anlauf <anlauf@gmx.de>
177 * trans-expr.cc (gfc_copy_class_to_class): Convert element counts in
178 bounds check to common type for comparison.
180 2023-03-10 Harald Anlauf <anlauf@gmx.de>
183 * resolve.cc (resolve_symbol): Avoid NULL pointer dereference while
184 checking a symbol with the BIND(C) attribute.
186 2023-03-05 Harald Anlauf <anlauf@gmx.de>
187 Tobias Burnus <tobias@codesourcery.com>
190 * class.cc (gfc_build_class_symbol): Handle update of attributes of
191 existing class container.
192 (gfc_find_derived_vtab): Fix several memory leaks.
193 (find_intrinsic_vtab): Ditto.
194 * decl.cc (attr_decl1): Manage update of symbol attributes from
196 * primary.cc (gfc_variable_attr): OPTIONAL shall not be taken or
197 updated from the class container.
198 * symbol.cc (free_old_symbol): Adjust management of symbol versions
199 to not prematurely free array specs while working on the declation
202 2023-03-01 Tobias Burnus <tobias@codesourcery.com>
205 * trans-openmp.cc (gfc_trans_omp_clauses): Fix mapping of
206 type(C_ptr) variables.
208 2023-02-27 Harald Anlauf <anlauf@gmx.de>
211 * trans-intrinsic.cc (gfc_conv_intrinsic_ibits): Handle corner case
212 LEN argument of IBITS equal to BITSIZE(I).
214 2023-02-25 Mikael Morin <mikael@gcc.gnu.org>
217 * intrinsic.cc (get_intrinsic_dummy_arg,
218 set_intrinsic_dummy_arg): Rename the former to the latter.
219 Remove the return value, add a reference to the lhs as argument,
220 and do the pointer assignment inside the function. Don't do
221 it if the pointer is already non-NULL.
222 (sort_actual): Update caller.
224 2023-02-25 Harald Anlauf <anlauf@gmx.de>
226 * arith.cc (gfc_real2int): Clear mpfr variable after use.
228 2023-02-25 Tobias Burnus <tobias@codesourcery.com>
231 * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Skip setting of
232 bounds of CFI desc for 'pointer,intent(out)'.
234 2023-02-24 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
236 * trans-decl.cc (gfc_finish_var_decl): Apply attribute.
237 (generate_local_decl): Add diagnostic for dummy and local variables.
239 2023-02-24 Mikael Morin <mikael@gcc.gnu.org>
242 * expr.cc (gfc_free_actual_arglist): Free associated_dummy
244 (gfc_copy_actual_arglist): Make a copy of the associated_dummy
245 field if it is set in the original element.
247 2023-02-24 Harald Anlauf <anlauf@gmx.de>
250 * frontend-passes.cc (do_subscript): Clear used gmp variable.
252 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
254 * invoke.texi: Reorder index entries around @items.
256 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
258 * invoke.texi: Reorder @opindex commands to precede @items they
261 2023-02-22 Harald Anlauf <anlauf@gmx.de>
264 * resolve.cc (resolve_component): The type of a CHARACTER length
265 expression must be INTEGER.
267 2023-02-21 Harald Anlauf <anlauf@gmx.de>
270 * parse.cc (check_function_result_typed): Improve type check of
271 specification expression for character length and return status.
272 (parse_spec): Use status from above.
273 * resolve.cc (resolve_fntype): Prevent use of invalid specification
274 expression for character length.
276 2023-02-16 Patrick Palka <ppalka@redhat.com>
278 * gfortran.h: Mechanically drop static from static inline
279 functions via s/^static inline/inline/g.
281 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
284 * frontend-passes.cc (do_intent): Catch NULL pointer dereference on
285 reference to invalid formal argument.
287 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
290 * resolve.cc (check_assumed_size_reference): Avoid NULL pointer
293 2023-02-15 Tobias Burnus <tobias@codesourcery.com>
296 * openmp.cc (gfc_resolve_omp_parallel_blocks): Handle combined 'loop'
298 (gfc_resolve_do_iterator): Set a source location for added
299 'private'-clause arguments.
300 * resolve.cc (gfc_resolve_code): Call gfc_resolve_omp_do_blocks
301 also for EXEC_OMP_LOOP and gfc_resolve_omp_parallel_blocks for
302 combined directives with loop + '{masked,master} taskloop (simd)'.
304 2023-02-13 Harald Anlauf <anlauf@gmx.de>
307 * primary.cc (gfc_expr_attr): Avoid NULL pointer dereference for
308 invalid use of CLASS variable.
310 2023-02-13 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
312 * decl.cc: Add EXT_ATTR_NOINLINE, EXT_ATTR_NORETURN, EXT_ATTR_WEAK.
313 * gfortran.h (ext_attr_id_t): Ditto.
314 * gfortran.texi (GCC$ ATTRIBUTES): Document them.
315 * trans-decl.cc (build_function_decl): Apply them.
317 2023-02-09 Harald Anlauf <anlauf@gmx.de>
318 Steven G. Kargl <kargl@gcc.gnu.org>
322 * intrinsic.cc (gfc_convert_chartype): Recover on invalid character
323 kind in conversion instead of generating an internal error.
325 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
328 * trans-openmp.cc (struct dovar_init_d): Add 'sym' and
329 'non_unit_incr' members.
330 (gfc_nonrect_loop_expr): New.
331 (gfc_trans_omp_do): Call it; use normal loop bounds
332 for unit stride - and only create local loop var.
334 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
336 * parse.cc (decode_omp_directive): Really ignore 'assumes' with
339 2023-02-08 Steve Kargl <kargl@gcc.gnu.org>
342 * resolve.cc (resolve_common_vars): Avoid NULL pointer dereference
343 when a symbol's location is not set.
345 2023-02-07 Harald Anlauf <anlauf@gmx.de>
348 * trans-decl.cc (gfc_finish_var_decl): With -fno-automatic, do not
349 make ASSOCIATE variables TREE_STATIC.
351 2023-02-05 Harald Anlauf <anlauf@gmx.de>
354 * arith.cc (gfc_arith_divide): Emit integer division truncation
355 warnings using gfc_warning instead of gfc_warning_now to prevent
358 2023-02-03 Jakub Jelinek <jakub@redhat.com>
361 * trans-decl.cc (gfc_trans_use_stmts): Call clear_slot before
364 2023-02-01 Harald Anlauf <anlauf@gmx.de>
367 * expr.cc (find_array_section): Add check to prevent interpreting an
368 mpz non-integer constant as an integer.
370 2023-02-01 Tobias Burnus <tobias@codesourcery.com>
372 * openmp.cc (resolve_omp_clauses): Check also for
375 2023-01-29 Mikael Morin <mikael@gcc.gnu.org>
378 * check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
379 (gfc_check_findloc): Ditto.
381 2023-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
384 * parse.cc (parse_module): Remove use of a bool error value
385 that prevented proper setting of the namespace pointer.
387 2023-01-28 Harald Anlauf <anlauf@gmx.de>
388 Steven G. Kargl <kargl@gcc.gnu.org>
391 * resolve.cc (compare_bound_int): Expression to compare must be of
393 (compare_bound_mpz_t): Likewise.
394 (check_dimension): Fix comment on checks applied to array section
395 and clean up associated logic.
397 2023-01-28 Harald Anlauf <anlauf@gmx.de>
400 * match.cc (gfc_match_common): A USE associated name shall not appear
401 in a COMMON block (F2018:C8121).
403 2023-01-27 Tobias Burnus <tobias@codesourcery.com>
406 * trans-openmp.cc (gfc_split_omp_clauses): Handle has_device_addr.
408 2023-01-26 Harald Anlauf <anlauf@gmx.de>
411 * resolve.cc (check_host_association): Extend host association check
412 so that it is not restricted to functions. Also prevent NULL pointer
415 2023-01-25 Steve Kargl <kargl@gcc.gnu.org>
418 * array.cc (compare_bounds): Return false instead of generating an
419 internal error on an invalid argument type.
421 2023-01-24 Harald Anlauf <anlauf@gmx.de>
424 * simplify.cc (simplify_transformation): Do not try to simplify
425 transformational intrinsic when the ARRAY argument has a NULL shape.
427 2023-01-23 Harald Anlauf <anlauf@gmx.de>
430 * dependency.cc (gfc_check_dependency): Prevent NULL pointer
431 dereference while recursively checking expressions.
433 2023-01-23 Harald Anlauf <anlauf@gmx.de>
436 * interface.cc (get_expr_storage_size): Check array subscript triplets
437 that we actually have integer values before trying to extract with
440 2023-01-23 Harald Anlauf <anlauf@gmx.de>
443 * iresolve.cc (check_charlen_present): Preserve character length if
444 there is no array constructor.
446 2023-01-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
449 * data.cc (gfc_assign_data_value): Remove check for PARAMETER in DATA.
450 * primary.cc (match_variable): Add check for PARAMETER in DATA.
452 2023-01-19 Harald Anlauf <anlauf@gmx.de>
455 * expr.cc (class_allocatable): Prevent NULL pointer dereference
457 (class_pointer): Likewise.
459 2023-01-17 Harald Anlauf <anlauf@gmx.de>
462 * interface.cc (get_expr_storage_size): Check that we actually have
463 an integer value before trying to extract it with mpz_get_si.
465 2023-01-12 Tobias Burnus <tobias@codesourcery.com>
468 * openmp.cc (gfc_resolve_omp_assumptions): Reject nonscalars.
470 2023-01-11 Jakub Jelinek <jakub@redhat.com>
473 * f95-lang.cc (gfc_init_builtin_function): Fix up function types
474 for BUILT_IN_REALLOC and BUILT_IN_SINCOS{F,,L}. Formatting fixes.
476 2023-01-10 Harald Anlauf <anlauf@gmx.de>
479 * frontend-passes.cc (do_subscript): Clear used gmp variables.
481 2023-01-02 Jakub Jelinek <jakub@redhat.com>
483 * gfortranspec.cc (lang_specific_driver): Update copyright notice
485 * gfc-internals.texi: Bump @copying's copyright year.
486 * gfortran.texi: Ditto.
487 * intrinsic.texi: Ditto.
488 * invoke.texi: Ditto.
491 Copyright (C) 2023 Free Software Foundation, Inc.
493 Copying and distribution of this file, with or without modification,
494 are permitted in any medium without royalty provided the copyright
495 notice and this notice are preserved.