1 2023-04-22 Harald Anlauf <anlauf@gmx.de>
2 Steven G. Kargl <kargl@gcc.gnu.org>
5 * interface.cc (gfc_compare_actual_formal): Reject allocatable
6 functions being used as actual argument for allocable dummy.
8 2023-04-14 Harald Anlauf <anlauf@gmx.de>
11 * simplify.cc (gfc_simplify_set_exponent): Fix implementation of
12 compile-time simplification of intrinsic SET_EXPONENT for argument
15 2023-04-14 Paul Thomas <pault@gcc.gnu.org>
18 * gfortran.h : Add expr3_not_explicit bit field to gfc_code.
19 * resolve.cc (resolve_allocate_expr): Set bit field when the
20 default initializer is applied to expr3.
21 * trans-stmt.cc (gfc_trans_allocate): If expr3_not_explicit is
22 set, do not deallocate expr3.
24 2023-04-13 Harald Anlauf <anlauf@gmx.de>
27 * trans-expr.cc (gfc_conv_power_op): Use absu_hwi and
28 unsigned HOST_WIDE_INT for portability.
30 2023-04-12 Harald Anlauf <anlauf@gmx.de>
33 * resolve.cc (resolve_entries): Handle functions with ENTRY and
35 * trans-expr.cc (gfc_conv_procedure_call): Functions with a result
36 with the POINTER or ALLOCATABLE attribute shall not get any special
37 treatment with -ff2c, as they cannot be written in Fortran 77.
38 * trans-types.cc (gfc_return_by_reference): Likewise.
39 (gfc_get_function_type): Likewise.
41 2023-04-12 Harald Anlauf <anlauf@gmx.de>
45 * interface.cc (compare_parameter): Enable type and rank checks for
46 arguments of derived type from the intrinsic module ISO_C_BINDING.
48 2023-04-08 Paul Thomas <pault@gcc.gnu.org>
51 * iresolve.cc (gfc_resolve_adjustl, gfc_resolve_adjustr): if
52 string length is deferred use the string typespec for result.
53 * resolve.cc (resolve_assoc_var): Handle parentheses around the
55 (resolve_block_construct): Remove unnecessary static decls.
56 * trans-array.cc (gfc_conv_expr_descriptor): Guard string len
57 expression in condition. Improve handling of string length and
58 span, especially for substrings of the descriptor.
59 (duplicate_allocatable): Make element type more explicit with
61 * trans-decl.cc (gfc_get_symbol_decl): Emit a fatal error with
62 appropriate message instead of ICE if symbol type is unknown.
63 (gfc_generate_function_code): Set current locus to proc_sym
65 * trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in
66 'previous' and use if end expression in substring reference is
68 (gfc_conv_string_length): Use gfc_conv_expr_descriptor if
69 'expr_flat' is an array. Add post block to catch deallocation
71 (gfc_conv_procedure_call): Assign the parmse string length to
72 the expression string length, if it is deferred.
73 (gfc_trans_alloc_subarray_assign): If this is a deferred string
74 length component, store the string length in the hidden comp.
75 Update the typespec length accordingly. Generate a new type
76 spec for the call to gfc_duplicate-allocatable in this case.
77 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
78 deferred character array components.
80 2023-04-04 Harald Anlauf <anlauf@gmx.de>
83 * expr.cc (check_restricted): Adjust check for valid variables in
84 restricted expressions: make no exception for module variables.
86 2023-04-01 Thomas Koenig <tkoenig@gcc.gnu.org>
88 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
89 type name to be "long long".
91 2023-03-30 Andrew Pinski <apinski@marvell.com>
93 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
94 type name to be "long long". Add a comment on why adding
97 2023-03-28 Jakub Jelinek <jakub@redhat.com>
100 * openmp.cc (gfc_omp_absent_contains_clause): Fix typo in diagnostics
101 - composit -> composite.
103 2023-03-25 Harald Anlauf <anlauf@gmx.de>
106 * trans-decl.cc (gfc_conv_cfi_to_gfc): Remove dead code.
108 2023-03-24 Harald Anlauf <anlauf@gmx.de>
110 * expr.cc (free_expr0): Free also BOZ strings as part of an expression.
112 2023-03-24 Haochen Gui <guihaoc@gcc.gnu.org>
113 Tobias Burnus <tobias@codesourcery.com>
116 * target-memory.cc (gfc_interpret_float): Return FAIL when
117 native_interpret_expr gets a NULL tree.
118 * arith.cc (gfc_hollerith2real): Return NULL when
119 gfc_interpret_float fails.
120 * error.cc (gfc_buffered_p): Define.
121 * gfortran.h (gfc_buffered_p): Declare.
122 * intrinsic.cc: Add diagnostic.h to include list.
123 (do_simplify): Save errorcount and check it at finish. Report a
124 "Cannot simplify expression" error on a bad result if error count
125 doesn't change and no other errors buffered.
127 2023-03-22 Harald Anlauf <anlauf@gmx.de>
128 Steven G. Kargl <kargl@gcc.gnu.org>
131 * resolve.cc (gfc_resolve_finalizers): Argument of a FINAL subroutine
132 cannot be an alternate return.
134 2023-03-21 Harald Anlauf <anlauf@gmx.de>
137 * decl.cc (gfc_match_modproc): Reject MODULE PROCEDURE if not in a
138 generic module interface.
140 2023-03-21 Arsen Arsenović <arsen@aarsen.me>
142 * invoke.texi: Remove usages of @gol.
143 * intrinsic.texi: Ditto.
145 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
148 * trans-array.cc (gfc_trans_array_constructor_value): Correct
149 incorrect setting of typespec.
151 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
154 * resolve.cc (generate_component_assignments): Restore the
155 exclusion of allocatable components from the loop.
157 2023-03-20 Harald Anlauf <anlauf@gmx.de>
160 * invoke.texi: Correct documentation of how underscores are appended
163 2023-03-20 Harald Anlauf <anlauf@gmx.de>
166 * simplify.cc (gfc_simplify_nearest): Fix off-by-one error in setting
167 up real kind-specific maximum exponent for mpfr.
169 2023-03-20 Paul Thomas <pault@gcc.gnu.org>
172 * resolve.cc (check_host_association): If an external function
173 is typed but not declared explicitly to be external, change the
174 old symbol from a variable to an external function.
176 2023-03-19 Harald Anlauf <anlauf@gmx.de>
179 * resolve.cc (resolve_fl_procedure): Check for an explicit interface
180 of procedures with the BIND(C) attribute (F2018:15.4.2.2).
182 2023-03-19 Thomas Koenig <tkoenig@gcc.gnu.org>
184 * gfortran.texi: Mention behavior on overflow.
186 2023-03-18 Paul Thomas <pault@gcc.gnu.org>
191 * class.cc (finalize_component): Include the missing arguments
192 in the call to the component's finalizer wrapper.
193 (has_finalizer_component): Do not return true for procedure
195 (finalizer_insert_packed_call): Remove the redundant argument
196 in the call to the final subroutine.
197 (generate_finalization_wrapper): Add support for assumed rank
199 (gfc_may_be_finalized): New helper function.
200 * dump-parse-tree.cc (write_proc): Whitespace.
201 * gfortran.h : Add prototype for gfc_may_be_finalized.
202 * resolve.cc (resolve_function): Correct derived types that
203 have an incomplete namespace.
204 (resolve_where, gfc_resolve_where_code_in_forall,
205 gfc_resolve_forall_body, gfc_resolve_code): Check that the op
206 code is still EXEC_ASSIGN. If it is set lhs to must finalize.
207 (is_finalizable_type): New function.
208 (generate_component_assignments): Set must_finalize if needed.
209 (gfc_resolve_finalizers): Error if assumed rank finalizer is
210 not the only one. Warning on lack of scalar finalizer modified
211 to account for assumed rank finalizers.
212 (generate_final_call): New function.
213 (generate_component_assignments): Enclose the outermost call in
214 a block to capture automatic deallocation and final calls.
215 Set must_finalize as required to satisfy the standards. Use an
216 explicit pointer assignment for pointer components to capture
217 finalization of the target. Likewise use explicit assignment
218 for allocatable components. Do not use the temporary copy of
219 the lhs in defined assignment if the component is allocatable.
220 Put the temporary in the same namespace as the lhs symbol if
221 the component may be finalized. Remove the leading assignment
222 from the expansion of assignment of components that have their
223 own defined assignment components. Suppress finalization of
224 assignment of temporary components to the lhs. Make an explicit
225 final call for the rhs function temporary if it exists.
226 (gfc_resolve_code): Set must_finalize for assignments with an
227 array constructor on the rhs.
228 (gfc_resolve_finalizers): Ensure that an assumed rank finalizer
229 is the only finalizer for that type and correct the surprising
230 warning for the lack of a scalar finalizer.
231 (check_defined_assignments): Handle allocatable components.
232 (resolve_fl_derived): Set referenced the vtab for use
234 (resolve_symbol): Set referenced an unreferenced symbol that
236 * trans-array.cc (gfc_trans_array_constructor_value): Add code
237 to finalize the constructor result. Warn that this feature was
238 removed in F2018 and that it is suppressed by -std=2018.
239 (trans_array_constructor): Add finalblock, pass to previous
240 and apply to loop->post if filled.
241 (gfc_add_loop_ss_code): Add se finalblock to outer loop post.
242 (gfc_trans_array_cobounds, gfc_trans_array_bounds): Add any
243 generated finalization code to the main block.
244 (structure_alloc_comps): Add boolean argument to suppress
245 finalization and use it for calls from
246 gfc_deallocate_alloc_comp_no_caf. Otherwise it defaults to
248 (gfc_copy_alloc_comp_no_fini): New wrapper for
249 structure_alloc_comps.
250 (gfc_alloc_allocatable_for_assignment): Suppress finalization
251 by setting new arg in call to gfc_deallocate_alloc_comp_no_caf.
252 (gfc_trans_deferred_array): Use gfc_may_be_finalized and do not
253 deallocate the components of entities with a leading '_' in the
254 name that are also marked as artificial.
255 * trans-array.h : Add the new boolean argument to the prototype
256 of gfc_deallocate_alloc_comp_no_caf with a default of false.
257 Add prototype for gfc_copy_alloc_comp_no_fini.
258 * trans-decl.cc(init_intent_out_dt): Tidy up the code.
259 * trans-expr.cc (gfc_init_se): Initialize finalblock.
260 (gfc_conv_procedure_call): Use gfc_finalize_tree_expr to
261 finalize function results. Replace in-line block for class
262 results with call to new function.
263 (gfc_conv_expr): Finalize structure constructors for F2003 and
264 F2008. Warn that this feature was deleted in F2018 and, unlike
265 array constructors, is not default. Add array constructor
266 finalblock to the post block.
267 (gfc_trans_scalar_assign): Suppress finalization by setting new
268 argument in call to gfc_deallocate_alloc_comp_no_caf. Add the
269 finalization blocks to the main block.
270 (gfc_trans_arrayfunc_assign): Use gfc_assignment_finalizer_call
271 and ensure that finalization occurs after the evaluation of the
272 rhs but using the initial value for the lhs. Finalize rhs
273 function results using gfc_finalize_tree_expr.
274 (trans_class_assignment, gfc_trans_assignment_1): As previous
275 function, taking care to order evaluation, assignment and
276 finalization correctly.
277 * trans-io.cc (gfc_trans_transfer): Add the final block.
278 * trans-stmt.cc (gfc_trans_call, gfc_trans_allocate): likewise.
279 (trans_associate_var): Nullify derived allocatable components
280 and finalize function targets with defined assignment
281 components on leaving the block scope.
282 (trans_allocate): Finalize source expressions, if required,
283 and set init_expr artificial temporarily to suppress the
284 finalization in gfc_trans_assignment.
285 * trans.cc (gfc_add_finalizer_call): Do not finalize the
286 temporaries generated in type assignment with defined
287 assignment components.
288 (gfc_assignment_finalizer_call): New function.
289 (gfc_finalize_tree_expr): New function.
290 * trans.h: Add finalblock to gfc_se. Add the prototypes for
291 gfc_finalize_tree_expr and gfc_assignment_finalizer_call.
293 2023-03-15 Harald Anlauf <anlauf@gmx.de>
294 Tobias Burnus <tobias@codesourcery.com>
297 * interface.cc (compare_parameter): Adjust check of array dummy
298 arguments to handle the case of CLASS variables.
300 2023-03-11 Harald Anlauf <anlauf@gmx.de>
303 * trans-expr.cc (gfc_copy_class_to_class): Convert element counts in
304 bounds check to common type for comparison.
306 2023-03-10 Harald Anlauf <anlauf@gmx.de>
309 * resolve.cc (resolve_symbol): Avoid NULL pointer dereference while
310 checking a symbol with the BIND(C) attribute.
312 2023-03-05 Harald Anlauf <anlauf@gmx.de>
313 Tobias Burnus <tobias@codesourcery.com>
316 * class.cc (gfc_build_class_symbol): Handle update of attributes of
317 existing class container.
318 (gfc_find_derived_vtab): Fix several memory leaks.
319 (find_intrinsic_vtab): Ditto.
320 * decl.cc (attr_decl1): Manage update of symbol attributes from
322 * primary.cc (gfc_variable_attr): OPTIONAL shall not be taken or
323 updated from the class container.
324 * symbol.cc (free_old_symbol): Adjust management of symbol versions
325 to not prematurely free array specs while working on the declation
328 2023-03-01 Tobias Burnus <tobias@codesourcery.com>
331 * trans-openmp.cc (gfc_trans_omp_clauses): Fix mapping of
332 type(C_ptr) variables.
334 2023-02-27 Harald Anlauf <anlauf@gmx.de>
337 * trans-intrinsic.cc (gfc_conv_intrinsic_ibits): Handle corner case
338 LEN argument of IBITS equal to BITSIZE(I).
340 2023-02-25 Mikael Morin <mikael@gcc.gnu.org>
343 * intrinsic.cc (get_intrinsic_dummy_arg,
344 set_intrinsic_dummy_arg): Rename the former to the latter.
345 Remove the return value, add a reference to the lhs as argument,
346 and do the pointer assignment inside the function. Don't do
347 it if the pointer is already non-NULL.
348 (sort_actual): Update caller.
350 2023-02-25 Harald Anlauf <anlauf@gmx.de>
352 * arith.cc (gfc_real2int): Clear mpfr variable after use.
354 2023-02-25 Tobias Burnus <tobias@codesourcery.com>
357 * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Skip setting of
358 bounds of CFI desc for 'pointer,intent(out)'.
360 2023-02-24 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
362 * trans-decl.cc (gfc_finish_var_decl): Apply attribute.
363 (generate_local_decl): Add diagnostic for dummy and local variables.
365 2023-02-24 Mikael Morin <mikael@gcc.gnu.org>
368 * expr.cc (gfc_free_actual_arglist): Free associated_dummy
370 (gfc_copy_actual_arglist): Make a copy of the associated_dummy
371 field if it is set in the original element.
373 2023-02-24 Harald Anlauf <anlauf@gmx.de>
376 * frontend-passes.cc (do_subscript): Clear used gmp variable.
378 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
380 * invoke.texi: Reorder index entries around @items.
382 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
384 * invoke.texi: Reorder @opindex commands to precede @items they
387 2023-02-22 Harald Anlauf <anlauf@gmx.de>
390 * resolve.cc (resolve_component): The type of a CHARACTER length
391 expression must be INTEGER.
393 2023-02-21 Harald Anlauf <anlauf@gmx.de>
396 * parse.cc (check_function_result_typed): Improve type check of
397 specification expression for character length and return status.
398 (parse_spec): Use status from above.
399 * resolve.cc (resolve_fntype): Prevent use of invalid specification
400 expression for character length.
402 2023-02-16 Patrick Palka <ppalka@redhat.com>
404 * gfortran.h: Mechanically drop static from static inline
405 functions via s/^static inline/inline/g.
407 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
410 * frontend-passes.cc (do_intent): Catch NULL pointer dereference on
411 reference to invalid formal argument.
413 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
416 * resolve.cc (check_assumed_size_reference): Avoid NULL pointer
419 2023-02-15 Tobias Burnus <tobias@codesourcery.com>
422 * openmp.cc (gfc_resolve_omp_parallel_blocks): Handle combined 'loop'
424 (gfc_resolve_do_iterator): Set a source location for added
425 'private'-clause arguments.
426 * resolve.cc (gfc_resolve_code): Call gfc_resolve_omp_do_blocks
427 also for EXEC_OMP_LOOP and gfc_resolve_omp_parallel_blocks for
428 combined directives with loop + '{masked,master} taskloop (simd)'.
430 2023-02-13 Harald Anlauf <anlauf@gmx.de>
433 * primary.cc (gfc_expr_attr): Avoid NULL pointer dereference for
434 invalid use of CLASS variable.
436 2023-02-13 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
438 * decl.cc: Add EXT_ATTR_NOINLINE, EXT_ATTR_NORETURN, EXT_ATTR_WEAK.
439 * gfortran.h (ext_attr_id_t): Ditto.
440 * gfortran.texi (GCC$ ATTRIBUTES): Document them.
441 * trans-decl.cc (build_function_decl): Apply them.
443 2023-02-09 Harald Anlauf <anlauf@gmx.de>
444 Steven G. Kargl <kargl@gcc.gnu.org>
448 * intrinsic.cc (gfc_convert_chartype): Recover on invalid character
449 kind in conversion instead of generating an internal error.
451 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
454 * trans-openmp.cc (struct dovar_init_d): Add 'sym' and
455 'non_unit_incr' members.
456 (gfc_nonrect_loop_expr): New.
457 (gfc_trans_omp_do): Call it; use normal loop bounds
458 for unit stride - and only create local loop var.
460 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
462 * parse.cc (decode_omp_directive): Really ignore 'assumes' with
465 2023-02-08 Steve Kargl <kargl@gcc.gnu.org>
468 * resolve.cc (resolve_common_vars): Avoid NULL pointer dereference
469 when a symbol's location is not set.
471 2023-02-07 Harald Anlauf <anlauf@gmx.de>
474 * trans-decl.cc (gfc_finish_var_decl): With -fno-automatic, do not
475 make ASSOCIATE variables TREE_STATIC.
477 2023-02-05 Harald Anlauf <anlauf@gmx.de>
480 * arith.cc (gfc_arith_divide): Emit integer division truncation
481 warnings using gfc_warning instead of gfc_warning_now to prevent
484 2023-02-03 Jakub Jelinek <jakub@redhat.com>
487 * trans-decl.cc (gfc_trans_use_stmts): Call clear_slot before
490 2023-02-01 Harald Anlauf <anlauf@gmx.de>
493 * expr.cc (find_array_section): Add check to prevent interpreting an
494 mpz non-integer constant as an integer.
496 2023-02-01 Tobias Burnus <tobias@codesourcery.com>
498 * openmp.cc (resolve_omp_clauses): Check also for
501 2023-01-29 Mikael Morin <mikael@gcc.gnu.org>
504 * check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
505 (gfc_check_findloc): Ditto.
507 2023-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
510 * parse.cc (parse_module): Remove use of a bool error value
511 that prevented proper setting of the namespace pointer.
513 2023-01-28 Harald Anlauf <anlauf@gmx.de>
514 Steven G. Kargl <kargl@gcc.gnu.org>
517 * resolve.cc (compare_bound_int): Expression to compare must be of
519 (compare_bound_mpz_t): Likewise.
520 (check_dimension): Fix comment on checks applied to array section
521 and clean up associated logic.
523 2023-01-28 Harald Anlauf <anlauf@gmx.de>
526 * match.cc (gfc_match_common): A USE associated name shall not appear
527 in a COMMON block (F2018:C8121).
529 2023-01-27 Tobias Burnus <tobias@codesourcery.com>
532 * trans-openmp.cc (gfc_split_omp_clauses): Handle has_device_addr.
534 2023-01-26 Harald Anlauf <anlauf@gmx.de>
537 * resolve.cc (check_host_association): Extend host association check
538 so that it is not restricted to functions. Also prevent NULL pointer
541 2023-01-25 Steve Kargl <kargl@gcc.gnu.org>
544 * array.cc (compare_bounds): Return false instead of generating an
545 internal error on an invalid argument type.
547 2023-01-24 Harald Anlauf <anlauf@gmx.de>
550 * simplify.cc (simplify_transformation): Do not try to simplify
551 transformational intrinsic when the ARRAY argument has a NULL shape.
553 2023-01-23 Harald Anlauf <anlauf@gmx.de>
556 * dependency.cc (gfc_check_dependency): Prevent NULL pointer
557 dereference while recursively checking expressions.
559 2023-01-23 Harald Anlauf <anlauf@gmx.de>
562 * interface.cc (get_expr_storage_size): Check array subscript triplets
563 that we actually have integer values before trying to extract with
566 2023-01-23 Harald Anlauf <anlauf@gmx.de>
569 * iresolve.cc (check_charlen_present): Preserve character length if
570 there is no array constructor.
572 2023-01-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
575 * data.cc (gfc_assign_data_value): Remove check for PARAMETER in DATA.
576 * primary.cc (match_variable): Add check for PARAMETER in DATA.
578 2023-01-19 Harald Anlauf <anlauf@gmx.de>
581 * expr.cc (class_allocatable): Prevent NULL pointer dereference
583 (class_pointer): Likewise.
585 2023-01-17 Harald Anlauf <anlauf@gmx.de>
588 * interface.cc (get_expr_storage_size): Check that we actually have
589 an integer value before trying to extract it with mpz_get_si.
591 2023-01-12 Tobias Burnus <tobias@codesourcery.com>
594 * openmp.cc (gfc_resolve_omp_assumptions): Reject nonscalars.
596 2023-01-11 Jakub Jelinek <jakub@redhat.com>
599 * f95-lang.cc (gfc_init_builtin_function): Fix up function types
600 for BUILT_IN_REALLOC and BUILT_IN_SINCOS{F,,L}. Formatting fixes.
602 2023-01-10 Harald Anlauf <anlauf@gmx.de>
605 * frontend-passes.cc (do_subscript): Clear used gmp variables.
607 2023-01-02 Jakub Jelinek <jakub@redhat.com>
609 * gfortranspec.cc (lang_specific_driver): Update copyright notice
611 * gfc-internals.texi: Bump @copying's copyright year.
612 * gfortran.texi: Ditto.
613 * intrinsic.texi: Ditto.
614 * invoke.texi: Ditto.
617 Copyright (C) 2023 Free Software Foundation, Inc.
619 Copying and distribution of this file, with or without modification,
620 are permitted in any medium without royalty provided the copyright
621 notice and this notice are preserved.