]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/fortran/ChangeLog
Daily bump.
[thirdparty/gcc.git] / gcc / fortran / ChangeLog
1 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
2
3 PR fortran/103716
4 * resolve.cc (gfc_resolve_ref): Conversion of array_ref into an
5 element should be done for all characters without a len expr,
6 not just deferred lens, and for integer expressions.
7 * trans-expr.cc (conv_inquiry): For len and kind inquiry refs,
8 set the se string_length to NULL_TREE.
9
10 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
11 Steven G. Kargl <kargl@gcc.gnu.org>
12
13 PR fortran/97122
14 * decl.cc (variable_decl): Clean up white space issues.
15 (gfc_match_final_decl): Declaration of finalizable derived type
16 is allowed in a submodule.
17
18 2023-05-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
19
20 * expr.cc (gfc_get_corank): Use CLASS_DATA from gfortran.h.
21 * resolve.cc (resolve_component): Same.
22 (resolve_fl_derived0): Same.
23 * simplify.cc (gfc_simplify_extends_type_of): Same.
24 (simplify_cobound): Same.
25
26 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
27
28 * trans-array.cc (is_pointer_array): Use _P() defines from tree.h.
29 (gfc_conv_scalarized_array_ref): Ditto.
30 (gfc_conv_array_ref): Ditto.
31 * trans-decl.cc (gfc_finish_decl): Ditto.
32 (gfc_get_symbol_decl): Ditto.
33 * trans-expr.cc (gfc_trans_pointer_assignment): Ditto.
34 (gfc_trans_arrayfunc_assign): Ditto.
35 (gfc_trans_assignment_1): Ditto.
36 * trans-intrinsic.cc (gfc_conv_intrinsic_minmax): Ditto.
37 (conv_intrinsic_ieee_value): Ditto.
38 * trans-io.cc (gfc_convert_array_to_string): Ditto.
39 * trans-openmp.cc (gfc_omp_is_optional_argument): Ditto.
40 (gfc_trans_omp_clauses): Ditto.
41 * trans-stmt.cc (gfc_conv_label_variable): Ditto.
42 * trans.cc (gfc_build_addr_expr): Ditto.
43 (get_array_span): Ditto.
44
45 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
46
47 PR fortran/78798
48 * array.cc (compare_bounds): Use narrower return type.
49 (gfc_compare_array_spec): Likewise.
50 (is_constant_element): Likewise.
51 (gfc_constant_ac): Likewise.
52 * check.cc (dim_rank_check): Likewise.
53 * cpp.cc (gfc_cpp_init_options): Likewise.
54 (dump_macro): Likewise.
55 * cpp.h (gfc_cpp_handle_option): Likewise.
56 * dependency.cc (gfc_ref_needs_temporary_p): Likewise.
57 (gfc_check_argument_dependency): Likewise.
58 (gfc_check_fncall_dependency): Likewise.
59 (ref_same_as_full_array): Likewise.
60 * dependency.h (gfc_check_fncall_dependency): Likewise.
61 (gfc_dep_resolver): Likewise.
62 (gfc_are_equivalenced_arrays): Likewise.
63 * expr.cc (gfc_copy_ref): Likewise.
64 (gfc_kind_max): Likewise.
65 (numeric_type): Likewise.
66 * gfortran.h (gfc_at_end): Likewise.
67 (gfc_at_eof): Likewise.
68 (gfc_at_bol): Likewise.
69 (gfc_at_eol): Likewise.
70 (gfc_define_undef_line): Likewise.
71 (gfc_wide_is_printable): Likewise.
72 (gfc_wide_is_digit): Likewise.
73 (gfc_wide_fits_in_byte): Likewise.
74 (gfc_find_sym_tree): Likewise.
75 (gfc_generic_intrinsic): Likewise.
76 (gfc_specific_intrinsic): Likewise.
77 (gfc_intrinsic_actual_ok): Likewise.
78 (gfc_has_vector_index): Likewise.
79 (gfc_numeric_ts): Likewise.
80 (gfc_impure_variable): Likewise.
81 (gfc_pure): Likewise.
82 (gfc_implicit_pure): Likewise.
83 (gfc_elemental): Likewise.
84 (gfc_pure_function): Likewise.
85 (gfc_implicit_pure_function): Likewise.
86 (gfc_compare_array_spec): Likewise.
87 (gfc_constant_ac): Likewise.
88 (gfc_expanded_ac): Likewise.
89 (gfc_check_digit): Likewise.
90 * intrinsic.cc (gfc_find_subroutine): Likewise.
91 (gfc_generic_intrinsic): Likewise.
92 (gfc_specific_intrinsic): Likewise.
93 * io.cc (compare_to_allowed_values): Likewise. And remove
94 unneeded forward declaration.
95 * parse.cc: Likewise.
96 * parse.h (gfc_check_do_variable): Likewise.
97 * primary.cc (gfc_check_digit): Likewise.
98 * resolve.cc (resolve_structure_cons): Likewise.
99 (pure_stmt_function): Likewise.
100 (gfc_pure_function): Likewise.
101 (impure_stmt_fcn): Likewise.
102 (resolve_forall_iterators): Likewise.
103 (resolve_data): Likewise.
104 (gfc_impure_variable): Likewise.
105 (gfc_pure): Likewise.
106 (gfc_unset_implicit_pure): Likewise.
107 * scanner.cc (wide_is_ascii): Likewise.
108 (gfc_wide_toupper): Likewise.
109 (gfc_open_included_file): Likewise.
110 (gfc_at_end): Likewise.
111 (gfc_at_eof): Likewise.
112 (gfc_at_bol): Likewise.
113 (skip_comment_line): Likewise.
114 (gfc_gobble_whitespace): Likewise.
115 * symbol.cc (gfc_find_symtree_in_proc): Likewise.
116 * trans-array.cc: Likewise.
117 * trans-decl.cc (gfc_set_decl_assembler_name): Likewise.
118 * trans-types.cc (gfc_get_element_type): Likewise.
119 (gfc_add_field_to_struct): Likewise.
120 * trans-types.h (gfc_copy_dt_decls_ifequal): Likewise.
121 (gfc_return_by_reference): Likewise.
122 (gfc_is_nodesc_array): Likewise.
123 * trans.h (gfc_can_put_var_on_stack): Likewise.
124
125 2023-05-17 Harald Anlauf <anlauf@gmx.de>
126
127 PR fortran/95374
128 PR fortran/104352
129 * decl.cc (add_init_expr_to_sym): Set shape of initializer also for
130 zero-sized arrays, so that bounds violations can be detected later.
131
132 2023-05-17 Tobias Burnus <tobias@codesourcery.com>
133
134 * trans-decl.cc (gfc_get_symbol_decl): Add attributes
135 such as 'declare target' also to hidden artificial
136 variable for deferred-length character variables.
137 * trans-openmp.cc (gfc_trans_omp_array_section,
138 gfc_trans_omp_clauses, gfc_trans_omp_target_exit_data):
139 Improve mapping of array descriptors and deferred-length
140 string variables.
141
142 2023-05-16 Paul Thomas <pault@gcc.gnu.org>
143
144 PR fortran/105152
145 PR fortran/100193
146 PR fortran/87496
147 PR fortran/103389
148 PR fortran/104429
149 PR fortran/82774
150 * interface.cc (gfc_compare_actual_formal): Emit an error if an
151 unlimited polymorphic actual is not matched either to an
152 unlimited or assumed type formal argument.
153 * resolve.cc (resolve_ordinary_assign): Emit an error if the
154 var expression of an ordinary assignment is a proc pointer
155 component.
156 * trans-array.cc (gfc_walk_array_ref): Provide assumed shape
157 arrays coming from interface mapping with a viable arrayspec.
158 * trans-expr.cc (gfc_conv_intrinsic_to_class): Tidy up flagging
159 of unlimited polymorphic 'class_ts'.
160 (gfc_conv_gfc_desc_to_cfi_desc): Assumed type is unlimited
161 polymorphic and should accept any actual type.
162 (gfc_conv_procedure_call): Replace dreadful kludge with a call
163 to gfc_finalize_tree_expr. Avoid dereferencing a void pointer
164 by giving it the pointer type of the actual argument.
165 (alloc_scalar_allocatable_subcomponent): Shorten the function
166 name and replace the symbol argument with the se string length.
167 If a deferred length character length is either not present or
168 is not a variable, give the typespec a variable and assign the
169 string length to that. Use gfc_deferred_strlen to find the
170 hidden string length component.
171 (gfc_trans_subcomponent_assign): Convert the expression before
172 the call to alloc_scalar_allocatable_subcomponent so that a
173 good string length is provided.
174 (gfc_trans_structure_assign): Remove the unneeded derived type
175 symbol from calls to gfc_trans_subcomponent_assign.
176
177 2023-05-15 Harald Anlauf <anlauf@gmx.de>
178
179 PR fortran/109846
180 * expr.cc (gfc_check_vardef_context): Check appropriate pointer
181 attribute for CLASS vs. non-CLASS function result in variable
182 definition context.
183
184 2023-05-11 Xi Ruoyao <xry111@xry111.site>
185
186 * Make-lang.in: Use grep instead of fgrep.
187
188 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
189
190 * dump-parse-tree.cc (gfc_debug_expr): Remove forward declaration.
191 (debug): Add DEBUG_FUNCTION.
192 (show_code_node): Remove erroneous whitespace.
193
194 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
195
196 PR fortran/109624
197 * dump-parse-tree.cc (debug): New function for gfc_namespace.
198 (gfc_debug_code): Delete forward declaration.
199 (show_attr): Make sure to print balanced braces.
200
201 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
202
203 * resolve.cc (resolve_select_type): Fix coding style.
204
205 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
206
207 * resolve.cc (resolve_select_type): Call free() unconditionally.
208
209 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
210
211 PR fortran/68800
212 * expr.cc (find_array_section): Fix mpz memory leak.
213 * simplify.cc (gfc_simplify_reshape): Fix mpz memory leaks in
214 error paths.
215
216 2023-05-05 Harald Anlauf <anlauf@gmx.de>
217
218 PR fortran/109641
219 * arith.cc (eval_intrinsic): Check conformability of ranks of operands
220 for intrinsic binary operators before performing type conversions.
221 * gfortran.h (gfc_op_rank_conformable): Add prototype.
222 * resolve.cc (resolve_operator): Check conformability of ranks of
223 operands for intrinsic binary operators before performing type
224 conversions.
225 (gfc_op_rank_conformable): New helper function to compare ranks of
226 operands of binary operator.
227
228 2023-05-04 Julian Brown <julian@codesourcery.com>
229
230 PR fortran/109622
231 * openmp.cc (resolve_omp_clauses): Add diagnostic for
232 non-pointer/non-allocatable attach/detach.
233 * trans-openmp.cc (gfc_trans_omp_clauses): Remove dereference for
234 pointer-to-scalar derived type component attach/detach. Fix
235 attach/detach handling for descriptors.
236
237 2023-04-28 Julian Brown <julian@codesourcery.com>
238
239 PR fortran/109622
240 * trans-openmp.cc (gfc_trans_omp_clauses): Attach/detach clause fixes.
241
242 2023-04-28 Tobias Burnus <tobias@codesourcery.com>
243
244 * gfortran.texi: Fix typos.
245 * decl.cc: Fix typos in comments and in a variable name.
246 * arith.cc: Fix comment typos.
247 * check.cc: Likewise.
248 * class.cc: Likewise.
249 * dependency.cc: Likewise.
250 * expr.cc: Likewise.
251 * frontend-passes.cc: Likewise.
252 * gfortran.h: Likewise.
253 * intrinsic.cc: Likewise.
254 * iresolve.cc: Likewise.
255 * match.cc: Likewise.
256 * module.cc: Likewise.
257 * primary.cc: Likewise.
258 * resolve.cc: Likewise.
259 * simplify.cc: Likewise.
260 * trans-array.cc: Likewise.
261 * trans-decl.cc: Likewise.
262 * trans-expr.cc: Likewise.
263 * trans-intrinsic.cc: Likewise.
264 * trans-openmp.cc: Likewise.
265 * trans-stmt.cc: Likewise.
266
267 2023-04-25 Tobias Burnus <tobias@codesourcery.com>
268
269 * openmp.cc (gfc_resolve_omp_do_blocks): Handle zero
270 or more than one exec statements before/after 'omp scan'.
271 * trans-openmp.cc (gfc_trans_omp_do): Likewise.
272
273 2023-04-22 Harald Anlauf <anlauf@gmx.de>
274 Steven G. Kargl <kargl@gcc.gnu.org>
275
276 PR fortran/109500
277 * interface.cc (gfc_compare_actual_formal): Reject allocatable
278 functions being used as actual argument for allocable dummy.
279
280 2023-04-14 Harald Anlauf <anlauf@gmx.de>
281
282 PR fortran/109511
283 * simplify.cc (gfc_simplify_set_exponent): Fix implementation of
284 compile-time simplification of intrinsic SET_EXPONENT for argument
285 X < 1 and for I < 0.
286
287 2023-04-14 Paul Thomas <pault@gcc.gnu.org>
288
289 PR fortran/104272
290 * gfortran.h : Add expr3_not_explicit bit field to gfc_code.
291 * resolve.cc (resolve_allocate_expr): Set bit field when the
292 default initializer is applied to expr3.
293 * trans-stmt.cc (gfc_trans_allocate): If expr3_not_explicit is
294 set, do not deallocate expr3.
295
296 2023-04-13 Harald Anlauf <anlauf@gmx.de>
297
298 PR fortran/109492
299 * trans-expr.cc (gfc_conv_power_op): Use absu_hwi and
300 unsigned HOST_WIDE_INT for portability.
301
302 2023-04-12 Harald Anlauf <anlauf@gmx.de>
303
304 PR fortran/104312
305 * resolve.cc (resolve_entries): Handle functions with ENTRY and
306 ALLOCATABLE results.
307 * trans-expr.cc (gfc_conv_procedure_call): Functions with a result
308 with the POINTER or ALLOCATABLE attribute shall not get any special
309 treatment with -ff2c, as they cannot be written in Fortran 77.
310 * trans-types.cc (gfc_return_by_reference): Likewise.
311 (gfc_get_function_type): Likewise.
312
313 2023-04-12 Harald Anlauf <anlauf@gmx.de>
314
315 PR fortran/61615
316 PR fortran/99982
317 * interface.cc (compare_parameter): Enable type and rank checks for
318 arguments of derived type from the intrinsic module ISO_C_BINDING.
319
320 2023-04-08 Paul Thomas <pault@gcc.gnu.org>
321
322 PR fortran/87477
323 * iresolve.cc (gfc_resolve_adjustl, gfc_resolve_adjustr): if
324 string length is deferred use the string typespec for result.
325 * resolve.cc (resolve_assoc_var): Handle parentheses around the
326 target expression.
327 (resolve_block_construct): Remove unnecessary static decls.
328 * trans-array.cc (gfc_conv_expr_descriptor): Guard string len
329 expression in condition. Improve handling of string length and
330 span, especially for substrings of the descriptor.
331 (duplicate_allocatable): Make element type more explicit with
332 'eltype'.
333 * trans-decl.cc (gfc_get_symbol_decl): Emit a fatal error with
334 appropriate message instead of ICE if symbol type is unknown.
335 (gfc_generate_function_code): Set current locus to proc_sym
336 declared_at.
337 * trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in
338 'previous' and use if end expression in substring reference is
339 null.
340 (gfc_conv_string_length): Use gfc_conv_expr_descriptor if
341 'expr_flat' is an array. Add post block to catch deallocation
342 of temporaries.
343 (gfc_conv_procedure_call): Assign the parmse string length to
344 the expression string length, if it is deferred.
345 (gfc_trans_alloc_subarray_assign): If this is a deferred string
346 length component, store the string length in the hidden comp.
347 Update the typespec length accordingly. Generate a new type
348 spec for the call to gfc_duplicate-allocatable in this case.
349 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
350 deferred character array components.
351
352 2023-04-04 Harald Anlauf <anlauf@gmx.de>
353
354 PR fortran/104349
355 * expr.cc (check_restricted): Adjust check for valid variables in
356 restricted expressions: make no exception for module variables.
357
358 2023-04-01 Thomas Koenig <tkoenig@gcc.gnu.org>
359
360 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
361 type name to be "long long".
362
363 2023-03-30 Andrew Pinski <apinski@marvell.com>
364
365 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
366 type name to be "long long". Add a comment on why adding
367 2 to the name too.
368
369 2023-03-28 Jakub Jelinek <jakub@redhat.com>
370
371 PR fortran/109314
372 * openmp.cc (gfc_omp_absent_contains_clause): Fix typo in diagnostics
373 - composit -> composite.
374
375 2023-03-25 Harald Anlauf <anlauf@gmx.de>
376
377 PR fortran/104321
378 * trans-decl.cc (gfc_conv_cfi_to_gfc): Remove dead code.
379
380 2023-03-24 Harald Anlauf <anlauf@gmx.de>
381
382 * expr.cc (free_expr0): Free also BOZ strings as part of an expression.
383
384 2023-03-24 Haochen Gui <guihaoc@gcc.gnu.org>
385 Tobias Burnus <tobias@codesourcery.com>
386
387 PR target/103628
388 * target-memory.cc (gfc_interpret_float): Return FAIL when
389 native_interpret_expr gets a NULL tree.
390 * arith.cc (gfc_hollerith2real): Return NULL when
391 gfc_interpret_float fails.
392 * error.cc (gfc_buffered_p): Define.
393 * gfortran.h (gfc_buffered_p): Declare.
394 * intrinsic.cc: Add diagnostic.h to include list.
395 (do_simplify): Save errorcount and check it at finish. Report a
396 "Cannot simplify expression" error on a bad result if error count
397 doesn't change and no other errors buffered.
398
399 2023-03-22 Harald Anlauf <anlauf@gmx.de>
400 Steven G. Kargl <kargl@gcc.gnu.org>
401
402 PR fortran/104572
403 * resolve.cc (gfc_resolve_finalizers): Argument of a FINAL subroutine
404 cannot be an alternate return.
405
406 2023-03-21 Harald Anlauf <anlauf@gmx.de>
407
408 PR fortran/99036
409 * decl.cc (gfc_match_modproc): Reject MODULE PROCEDURE if not in a
410 generic module interface.
411
412 2023-03-21 Arsen Arsenović <arsen@aarsen.me>
413
414 * invoke.texi: Remove usages of @gol.
415 * intrinsic.texi: Ditto.
416
417 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
418
419 PR fortran/109206
420 * trans-array.cc (gfc_trans_array_constructor_value): Correct
421 incorrect setting of typespec.
422
423 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
424
425 PR fortran/109209
426 * resolve.cc (generate_component_assignments): Restore the
427 exclusion of allocatable components from the loop.
428
429 2023-03-20 Harald Anlauf <anlauf@gmx.de>
430
431 PR fortran/109216
432 * invoke.texi: Correct documentation of how underscores are appended
433 to external names.
434
435 2023-03-20 Harald Anlauf <anlauf@gmx.de>
436
437 PR fortran/109186
438 * simplify.cc (gfc_simplify_nearest): Fix off-by-one error in setting
439 up real kind-specific maximum exponent for mpfr.
440
441 2023-03-20 Paul Thomas <pault@gcc.gnu.org>
442
443 PR fortran/87127
444 * resolve.cc (check_host_association): If an external function
445 is typed but not declared explicitly to be external, change the
446 old symbol from a variable to an external function.
447
448 2023-03-19 Harald Anlauf <anlauf@gmx.de>
449
450 PR fortran/85877
451 * resolve.cc (resolve_fl_procedure): Check for an explicit interface
452 of procedures with the BIND(C) attribute (F2018:15.4.2.2).
453
454 2023-03-19 Thomas Koenig <tkoenig@gcc.gnu.org>
455
456 * gfortran.texi: Mention behavior on overflow.
457
458 2023-03-18 Paul Thomas <pault@gcc.gnu.org>
459
460 PR fortran/103854
461 PR fortran/96122
462 PR fortran/37336
463 * class.cc (finalize_component): Include the missing arguments
464 in the call to the component's finalizer wrapper.
465 (has_finalizer_component): Do not return true for procedure
466 pointer components.
467 (finalizer_insert_packed_call): Remove the redundant argument
468 in the call to the final subroutine.
469 (generate_finalization_wrapper): Add support for assumed rank
470 finalizers.
471 (gfc_may_be_finalized): New helper function.
472 * dump-parse-tree.cc (write_proc): Whitespace.
473 * gfortran.h : Add prototype for gfc_may_be_finalized.
474 * resolve.cc (resolve_function): Correct derived types that
475 have an incomplete namespace.
476 (resolve_where, gfc_resolve_where_code_in_forall,
477 gfc_resolve_forall_body, gfc_resolve_code): Check that the op
478 code is still EXEC_ASSIGN. If it is set lhs to must finalize.
479 (is_finalizable_type): New function.
480 (generate_component_assignments): Set must_finalize if needed.
481 (gfc_resolve_finalizers): Error if assumed rank finalizer is
482 not the only one. Warning on lack of scalar finalizer modified
483 to account for assumed rank finalizers.
484 (generate_final_call): New function.
485 (generate_component_assignments): Enclose the outermost call in
486 a block to capture automatic deallocation and final calls.
487 Set must_finalize as required to satisfy the standards. Use an
488 explicit pointer assignment for pointer components to capture
489 finalization of the target. Likewise use explicit assignment
490 for allocatable components. Do not use the temporary copy of
491 the lhs in defined assignment if the component is allocatable.
492 Put the temporary in the same namespace as the lhs symbol if
493 the component may be finalized. Remove the leading assignment
494 from the expansion of assignment of components that have their
495 own defined assignment components. Suppress finalization of
496 assignment of temporary components to the lhs. Make an explicit
497 final call for the rhs function temporary if it exists.
498 (gfc_resolve_code): Set must_finalize for assignments with an
499 array constructor on the rhs.
500 (gfc_resolve_finalizers): Ensure that an assumed rank finalizer
501 is the only finalizer for that type and correct the surprising
502 warning for the lack of a scalar finalizer.
503 (check_defined_assignments): Handle allocatable components.
504 (resolve_fl_derived): Set referenced the vtab for use
505 associated symbols.
506 (resolve_symbol): Set referenced an unreferenced symbol that
507 will be finalized.
508 * trans-array.cc (gfc_trans_array_constructor_value): Add code
509 to finalize the constructor result. Warn that this feature was
510 removed in F2018 and that it is suppressed by -std=2018.
511 (trans_array_constructor): Add finalblock, pass to previous
512 and apply to loop->post if filled.
513 (gfc_add_loop_ss_code): Add se finalblock to outer loop post.
514 (gfc_trans_array_cobounds, gfc_trans_array_bounds): Add any
515 generated finalization code to the main block.
516 (structure_alloc_comps): Add boolean argument to suppress
517 finalization and use it for calls from
518 gfc_deallocate_alloc_comp_no_caf. Otherwise it defaults to
519 false.
520 (gfc_copy_alloc_comp_no_fini): New wrapper for
521 structure_alloc_comps.
522 (gfc_alloc_allocatable_for_assignment): Suppress finalization
523 by setting new arg in call to gfc_deallocate_alloc_comp_no_caf.
524 (gfc_trans_deferred_array): Use gfc_may_be_finalized and do not
525 deallocate the components of entities with a leading '_' in the
526 name that are also marked as artificial.
527 * trans-array.h : Add the new boolean argument to the prototype
528 of gfc_deallocate_alloc_comp_no_caf with a default of false.
529 Add prototype for gfc_copy_alloc_comp_no_fini.
530 * trans-decl.cc(init_intent_out_dt): Tidy up the code.
531 * trans-expr.cc (gfc_init_se): Initialize finalblock.
532 (gfc_conv_procedure_call): Use gfc_finalize_tree_expr to
533 finalize function results. Replace in-line block for class
534 results with call to new function.
535 (gfc_conv_expr): Finalize structure constructors for F2003 and
536 F2008. Warn that this feature was deleted in F2018 and, unlike
537 array constructors, is not default. Add array constructor
538 finalblock to the post block.
539 (gfc_trans_scalar_assign): Suppress finalization by setting new
540 argument in call to gfc_deallocate_alloc_comp_no_caf. Add the
541 finalization blocks to the main block.
542 (gfc_trans_arrayfunc_assign): Use gfc_assignment_finalizer_call
543 and ensure that finalization occurs after the evaluation of the
544 rhs but using the initial value for the lhs. Finalize rhs
545 function results using gfc_finalize_tree_expr.
546 (trans_class_assignment, gfc_trans_assignment_1): As previous
547 function, taking care to order evaluation, assignment and
548 finalization correctly.
549 * trans-io.cc (gfc_trans_transfer): Add the final block.
550 * trans-stmt.cc (gfc_trans_call, gfc_trans_allocate): likewise.
551 (trans_associate_var): Nullify derived allocatable components
552 and finalize function targets with defined assignment
553 components on leaving the block scope.
554 (trans_allocate): Finalize source expressions, if required,
555 and set init_expr artificial temporarily to suppress the
556 finalization in gfc_trans_assignment.
557 * trans.cc (gfc_add_finalizer_call): Do not finalize the
558 temporaries generated in type assignment with defined
559 assignment components.
560 (gfc_assignment_finalizer_call): New function.
561 (gfc_finalize_tree_expr): New function.
562 * trans.h: Add finalblock to gfc_se. Add the prototypes for
563 gfc_finalize_tree_expr and gfc_assignment_finalizer_call.
564
565 2023-03-15 Harald Anlauf <anlauf@gmx.de>
566 Tobias Burnus <tobias@codesourcery.com>
567
568 PR fortran/58331
569 * interface.cc (compare_parameter): Adjust check of array dummy
570 arguments to handle the case of CLASS variables.
571
572 2023-03-11 Harald Anlauf <anlauf@gmx.de>
573
574 PR fortran/106945
575 * trans-expr.cc (gfc_copy_class_to_class): Convert element counts in
576 bounds check to common type for comparison.
577
578 2023-03-10 Harald Anlauf <anlauf@gmx.de>
579
580 PR fortran/104332
581 * resolve.cc (resolve_symbol): Avoid NULL pointer dereference while
582 checking a symbol with the BIND(C) attribute.
583
584 2023-03-05 Harald Anlauf <anlauf@gmx.de>
585 Tobias Burnus <tobias@codesourcery.com>
586
587 PR fortran/106856
588 * class.cc (gfc_build_class_symbol): Handle update of attributes of
589 existing class container.
590 (gfc_find_derived_vtab): Fix several memory leaks.
591 (find_intrinsic_vtab): Ditto.
592 * decl.cc (attr_decl1): Manage update of symbol attributes from
593 CLASS attributes.
594 * primary.cc (gfc_variable_attr): OPTIONAL shall not be taken or
595 updated from the class container.
596 * symbol.cc (free_old_symbol): Adjust management of symbol versions
597 to not prematurely free array specs while working on the declation
598 of CLASS variables.
599
600 2023-03-01 Tobias Burnus <tobias@codesourcery.com>
601
602 PR middle-end/108546
603 * trans-openmp.cc (gfc_trans_omp_clauses): Fix mapping of
604 type(C_ptr) variables.
605
606 2023-02-27 Harald Anlauf <anlauf@gmx.de>
607
608 PR fortran/108937
609 * trans-intrinsic.cc (gfc_conv_intrinsic_ibits): Handle corner case
610 LEN argument of IBITS equal to BITSIZE(I).
611
612 2023-02-25 Mikael Morin <mikael@gcc.gnu.org>
613
614 PR fortran/108923
615 * intrinsic.cc (get_intrinsic_dummy_arg,
616 set_intrinsic_dummy_arg): Rename the former to the latter.
617 Remove the return value, add a reference to the lhs as argument,
618 and do the pointer assignment inside the function. Don't do
619 it if the pointer is already non-NULL.
620 (sort_actual): Update caller.
621
622 2023-02-25 Harald Anlauf <anlauf@gmx.de>
623
624 * arith.cc (gfc_real2int): Clear mpfr variable after use.
625
626 2023-02-25 Tobias Burnus <tobias@codesourcery.com>
627
628 PR fortran/108621
629 * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Skip setting of
630 bounds of CFI desc for 'pointer,intent(out)'.
631
632 2023-02-24 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
633
634 * trans-decl.cc (gfc_finish_var_decl): Apply attribute.
635 (generate_local_decl): Add diagnostic for dummy and local variables.
636
637 2023-02-24 Mikael Morin <mikael@gcc.gnu.org>
638
639 PR fortran/108923
640 * expr.cc (gfc_free_actual_arglist): Free associated_dummy
641 memory.
642 (gfc_copy_actual_arglist): Make a copy of the associated_dummy
643 field if it is set in the original element.
644
645 2023-02-24 Harald Anlauf <anlauf@gmx.de>
646
647 PR fortran/108924
648 * frontend-passes.cc (do_subscript): Clear used gmp variable.
649
650 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
651
652 * invoke.texi: Reorder index entries around @items.
653
654 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
655
656 * invoke.texi: Reorder @opindex commands to precede @items they
657 relate to.
658
659 2023-02-22 Harald Anlauf <anlauf@gmx.de>
660
661 PR fortran/96024
662 * resolve.cc (resolve_component): The type of a CHARACTER length
663 expression must be INTEGER.
664
665 2023-02-21 Harald Anlauf <anlauf@gmx.de>
666
667 PR fortran/96025
668 * parse.cc (check_function_result_typed): Improve type check of
669 specification expression for character length and return status.
670 (parse_spec): Use status from above.
671 * resolve.cc (resolve_fntype): Prevent use of invalid specification
672 expression for character length.
673
674 2023-02-16 Patrick Palka <ppalka@redhat.com>
675
676 * gfortran.h: Mechanically drop static from static inline
677 functions via s/^static inline/inline/g.
678
679 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
680
681 PR fortran/103608
682 * frontend-passes.cc (do_intent): Catch NULL pointer dereference on
683 reference to invalid formal argument.
684
685 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
686
687 PR fortran/104554
688 * resolve.cc (check_assumed_size_reference): Avoid NULL pointer
689 dereference.
690
691 2023-02-15 Tobias Burnus <tobias@codesourcery.com>
692
693 PR fortran/108512
694 * openmp.cc (gfc_resolve_omp_parallel_blocks): Handle combined 'loop'
695 directives.
696 (gfc_resolve_do_iterator): Set a source location for added
697 'private'-clause arguments.
698 * resolve.cc (gfc_resolve_code): Call gfc_resolve_omp_do_blocks
699 also for EXEC_OMP_LOOP and gfc_resolve_omp_parallel_blocks for
700 combined directives with loop + '{masked,master} taskloop (simd)'.
701
702 2023-02-13 Harald Anlauf <anlauf@gmx.de>
703
704 PR fortran/103475
705 * primary.cc (gfc_expr_attr): Avoid NULL pointer dereference for
706 invalid use of CLASS variable.
707
708 2023-02-13 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
709
710 * decl.cc: Add EXT_ATTR_NOINLINE, EXT_ATTR_NORETURN, EXT_ATTR_WEAK.
711 * gfortran.h (ext_attr_id_t): Ditto.
712 * gfortran.texi (GCC$ ATTRIBUTES): Document them.
713 * trans-decl.cc (build_function_decl): Apply them.
714
715 2023-02-09 Harald Anlauf <anlauf@gmx.de>
716 Steven G. Kargl <kargl@gcc.gnu.org>
717
718 PR fortran/69636
719 PR fortran/103779
720 * intrinsic.cc (gfc_convert_chartype): Recover on invalid character
721 kind in conversion instead of generating an internal error.
722
723 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
724
725 PR fortran/107424
726 * trans-openmp.cc (struct dovar_init_d): Add 'sym' and
727 'non_unit_incr' members.
728 (gfc_nonrect_loop_expr): New.
729 (gfc_trans_omp_do): Call it; use normal loop bounds
730 for unit stride - and only create local loop var.
731
732 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
733
734 * parse.cc (decode_omp_directive): Really ignore 'assumes' with
735 -fopenmp-simd.
736
737 2023-02-08 Steve Kargl <kargl@gcc.gnu.org>
738
739 PR fortran/103259
740 * resolve.cc (resolve_common_vars): Avoid NULL pointer dereference
741 when a symbol's location is not set.
742
743 2023-02-07 Harald Anlauf <anlauf@gmx.de>
744
745 PR fortran/95107
746 * trans-decl.cc (gfc_finish_var_decl): With -fno-automatic, do not
747 make ASSOCIATE variables TREE_STATIC.
748
749 2023-02-05 Harald Anlauf <anlauf@gmx.de>
750
751 PR fortran/108592
752 * arith.cc (gfc_arith_divide): Emit integer division truncation
753 warnings using gfc_warning instead of gfc_warning_now to prevent
754 redundant messages.
755
756 2023-02-03 Jakub Jelinek <jakub@redhat.com>
757
758 PR fortran/108451
759 * trans-decl.cc (gfc_trans_use_stmts): Call clear_slot before
760 doing continue.
761
762 2023-02-01 Harald Anlauf <anlauf@gmx.de>
763
764 PR fortran/108609
765 * expr.cc (find_array_section): Add check to prevent interpreting an
766 mpz non-integer constant as an integer.
767
768 2023-02-01 Tobias Burnus <tobias@codesourcery.com>
769
770 * openmp.cc (resolve_omp_clauses): Check also for
771 power of two.
772
773 2023-01-29 Mikael Morin <mikael@gcc.gnu.org>
774
775 PR fortran/108450
776 * check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
777 (gfc_check_findloc): Ditto.
778
779 2023-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
780
781 PR fortran/103506
782 * parse.cc (parse_module): Remove use of a bool error value
783 that prevented proper setting of the namespace pointer.
784
785 2023-01-28 Harald Anlauf <anlauf@gmx.de>
786 Steven G. Kargl <kargl@gcc.gnu.org>
787
788 PR fortran/108527
789 * resolve.cc (compare_bound_int): Expression to compare must be of
790 type INTEGER.
791 (compare_bound_mpz_t): Likewise.
792 (check_dimension): Fix comment on checks applied to array section
793 and clean up associated logic.
794
795 2023-01-28 Harald Anlauf <anlauf@gmx.de>
796
797 PR fortran/108453
798 * match.cc (gfc_match_common): A USE associated name shall not appear
799 in a COMMON block (F2018:C8121).
800
801 2023-01-27 Tobias Burnus <tobias@codesourcery.com>
802
803 PR fortran/108558
804 * trans-openmp.cc (gfc_split_omp_clauses): Handle has_device_addr.
805
806 2023-01-26 Harald Anlauf <anlauf@gmx.de>
807
808 PR fortran/108544
809 * resolve.cc (check_host_association): Extend host association check
810 so that it is not restricted to functions. Also prevent NULL pointer
811 dereference.
812
813 2023-01-25 Steve Kargl <kargl@gcc.gnu.org>
814
815 PR fortran/108528
816 * array.cc (compare_bounds): Return false instead of generating an
817 internal error on an invalid argument type.
818
819 2023-01-24 Harald Anlauf <anlauf@gmx.de>
820
821 PR fortran/108529
822 * simplify.cc (simplify_transformation): Do not try to simplify
823 transformational intrinsic when the ARRAY argument has a NULL shape.
824
825 2023-01-23 Harald Anlauf <anlauf@gmx.de>
826
827 PR fortran/108502
828 * dependency.cc (gfc_check_dependency): Prevent NULL pointer
829 dereference while recursively checking expressions.
830
831 2023-01-23 Harald Anlauf <anlauf@gmx.de>
832
833 PR fortran/108501
834 * interface.cc (get_expr_storage_size): Check array subscript triplets
835 that we actually have integer values before trying to extract with
836 mpz_get_si.
837
838 2023-01-23 Harald Anlauf <anlauf@gmx.de>
839
840 PR fortran/108420
841 * iresolve.cc (check_charlen_present): Preserve character length if
842 there is no array constructor.
843
844 2023-01-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
845
846 PR fortran/102595
847 * data.cc (gfc_assign_data_value): Remove check for PARAMETER in DATA.
848 * primary.cc (match_variable): Add check for PARAMETER in DATA.
849
850 2023-01-19 Harald Anlauf <anlauf@gmx.de>
851
852 PR fortran/108434
853 * expr.cc (class_allocatable): Prevent NULL pointer dereference
854 or invalid read.
855 (class_pointer): Likewise.
856
857 2023-01-17 Harald Anlauf <anlauf@gmx.de>
858
859 PR fortran/108421
860 * interface.cc (get_expr_storage_size): Check that we actually have
861 an integer value before trying to extract it with mpz_get_si.
862
863 2023-01-12 Tobias Burnus <tobias@codesourcery.com>
864
865 PR fortran/107706
866 * openmp.cc (gfc_resolve_omp_assumptions): Reject nonscalars.
867
868 2023-01-11 Jakub Jelinek <jakub@redhat.com>
869
870 PR fortran/108349
871 * f95-lang.cc (gfc_init_builtin_function): Fix up function types
872 for BUILT_IN_REALLOC and BUILT_IN_SINCOS{F,,L}. Formatting fixes.
873
874 2023-01-10 Harald Anlauf <anlauf@gmx.de>
875
876 PR fortran/97345
877 * frontend-passes.cc (do_subscript): Clear used gmp variables.
878
879 2023-01-02 Jakub Jelinek <jakub@redhat.com>
880
881 * gfortranspec.cc (lang_specific_driver): Update copyright notice
882 dates.
883 * gfc-internals.texi: Bump @copying's copyright year.
884 * gfortran.texi: Ditto.
885 * intrinsic.texi: Ditto.
886 * invoke.texi: Ditto.
887
888 \f
889 Copyright (C) 2023 Free Software Foundation, Inc.
890
891 Copying and distribution of this file, with or without modification,
892 are permitted in any medium without royalty provided the copyright
893 notice and this notice are preserved.