]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/fortran/ChangeLog
Daily bump.
[thirdparty/gcc.git] / gcc / fortran / ChangeLog
1 2023-08-14 Mikael Morin <mikael@gcc.gnu.org>
2
3 PR fortran/110360
4 PR fortran/110419
5 * trans-types.cc (gfc_sym_type): Use a bare character type for length
6 one value character dummy arguments.
7 * trans-expr.cc (gfc_conv_string_parameter): Handle single character
8 case.
9 (gfc_conv_procedure_call): Don't exclude interoperable kinds
10 from single character handling. For single character dummy arguments,
11 extend the existing handling of non-constant expressions to constant
12 expressions.
13
14 2023-08-14 Mikael Morin <mikael@gcc.gnu.org>
15
16 * gfortran.h (gfc_length_one_character_type_p): New inline
17 function.
18 * check.cc (is_c_interoperable): Use
19 gfc_length_one_character_type_p.
20 * decl.cc (verify_bind_c_sym): Same.
21 * trans-expr.cc (gfc_conv_procedure_call): Same.
22
23 2023-08-09 Steve Kargl <sgk@troutmask.apl.washington.edu>
24
25 PR fortran/109684
26 * resolve.cc (resolve_types): Exclude contained procedures with
27 the artificial attribute from test for pureness.
28
29 2023-07-31 Chung-Lin Tang <cltang@codesourcery.com>
30
31 * openmp.cc (resolve_omp_clauses): Add checking requiring
32 OpenACC host_data construct to have an use_device clause.
33
34 2023-07-28 Harald Anlauf <anlauf@gmx.de>
35
36 PR fortran/110825
37 * gfortran.texi: Clarify argument passing convention.
38 * trans-expr.cc (gfc_conv_procedure_call): Do not pass the character
39 length as hidden argument when the declared dummy argument is
40 assumed-type.
41
42 2023-07-27 Tobias Burnus <tobias@codesourcery.com>
43
44 * openmp.cc (resolve_omp_target): Minor cleanup.
45 * parse.cc (decode_omp_directive): Find TARGET statement
46 also higher in the stack.
47
48 2023-07-26 Harald Anlauf <anlauf@gmx.de>
49
50 PR fortran/68569
51 * resolve.cc (check_data_variable): Do not accept strings with
52 deferred length or non-constant length in a DATA statement.
53 Reject also substrings of string variables of non-constant length.
54
55 2023-07-25 Tobias Burnus <tobias@codesourcery.com>
56
57 PR fortran/110725
58 PR middle-end/71065
59 * gfortran.h (gfc_omp_clauses): Add target_first_st_is_teams.
60 * parse.cc (parse_omp_structured_block): Set it if the first
61 statement in the structured block of a TARGET is TEAMS or
62 a combined/composite starting with TEAMS.
63 * openmp.cc (resolve_omp_target): Also show an error for
64 contains_teams_construct without target_first_st_is_teams.
65
66 2023-07-24 Tobias Burnus <tobias@codesourcery.com>
67
68 PR fortran/110725
69 PR middle-end/71065
70 * gfortran.h (gfc_omp_clauses): Add contains_teams_construct.
71 * openmp.cc (resolve_omp_target): New; check for teams nesting.
72 (gfc_resolve_omp_directive): Call it.
73 * parse.cc (decode_omp_directive): Set contains_teams_construct
74 on enclosing ST_OMP_TARGET.
75
76 2023-07-20 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
77
78 * trans-intrinsic.cc (conv_intrinsic_ieee_comparison): Only
79 define it once.
80
81 2023-07-20 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
82
83 * f95-lang.cc (gfc_init_builtin_functions): Add __builtin_iseqsig.
84 * trans-intrinsic.cc (conv_intrinsic_ieee_comparison): New
85 function.
86 (gfc_conv_ieee_arithmetic_function): Handle IEEE comparisons.
87
88 2023-07-19 Tobias Burnus <tobias@codesourcery.com>
89
90 PR fortran/107424
91 * trans-openmp.cc (gfc_nonrect_loop_expr): Accept all
92 constant loop steps.
93 (gfc_trans_omp_do): Likewise; use sign to determine
94 loop direction.
95
96 2023-07-17 Harald Anlauf <anlauf@gmx.de>
97
98 PR fortran/95947
99 PR fortran/110658
100 * trans-expr.cc (gfc_conv_procedure_call): For intrinsic procedures
101 whose result characteristics depends on the first argument and which
102 can be of type character, the character length will not be deferred.
103
104 2023-07-17 Tobias Burnus <tobias@codesoucery.com>
105 Chung-Lin Tang <cltang@codesourcery.com>
106
107 * dump-parse-tree.cc (show_omp_namelist, show_omp_clauses): Dump
108 uses_allocators clause.
109 * gfortran.h (gfc_free_omp_namelist): Add memspace_sym to u union
110 and traits_sym to u2 union.
111 (OMP_LIST_USES_ALLOCATORS): New enum value.
112 (gfc_free_omp_namelist): Add 'bool free_mem_traits_space' arg.
113 * match.cc (gfc_free_omp_namelist): Likewise.
114 * openmp.cc (gfc_free_omp_clauses, gfc_match_omp_variable_list,
115 gfc_match_omp_to_link, gfc_match_omp_doacross_sink,
116 gfc_match_omp_clause_reduction, gfc_match_omp_allocate,
117 gfc_match_omp_flush): Update call.
118 (gfc_match_omp_clauses): Likewise. Parse uses_allocators clause.
119 (gfc_match_omp_clause_uses_allocators): New.
120 (enum omp_mask2): Add new OMP_CLAUSE_USES_ALLOCATORS.
121 (OMP_TARGET_CLAUSES): Accept it.
122 (resolve_omp_clauses): Resolve uses_allocators clause
123 * st.cc (gfc_free_statement): Update gfc_free_omp_namelist call.
124 * trans-openmp.cc (gfc_trans_omp_clauses): Handle
125 OMP_LIST_USES_ALLOCATORS; fail with sorry unless predefined allocator.
126 (gfc_split_omp_clauses): Handle uses_allocators.
127
128 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
129
130 PR fortran/110618
131 * trans.h (gfc_deallocate_with_status): Add class container
132 argument.
133 (gfc_deallocate_scalar_with_status): Ditto.
134 * trans.cc (gfc_deallocate_with_status): Add class container
135 argument and pass it down to gfc_add_finalize_call.
136 (gfc_deallocate_scalar_with_status): Same.
137 * trans-array.cc (structure_alloc_comps): Update caller.
138 * trans-stmt.cc (gfc_trans_deallocate): Ditto.
139 * trans-expr.cc (gfc_conv_procedure_call): Ditto. Pass
140 pre-evaluated class container argument if it's available.
141
142 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
143
144 PR fortran/110618
145 * trans.h (gfc_add_finalizer_call): Add class container argument.
146 * trans.cc (gfc_add_finalizer_call): Ditto. Pass down new
147 argument to get_final_proc_ref, get_elem_size, get_var_desc,
148 and get_vptr.
149 (get_elem_size): Add class container argument.
150 Use provided class container if it's available.
151 (get_var_descr): Same.
152 (get_vptr): Same.
153 (get_final_proc_ref): Same. Add boolean telling the class
154 container argument is used. Set it. Don't try to use
155 final_wrapper if class container argument was used.
156
157 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
158
159 * trans.cc (get_var_descr): Factor scalar descriptor generation.
160
161 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
162
163 * trans.cc (get_vptr): New function.
164 (gfc_add_finalizer_call): Move virtual table pointer evaluation
165 to get_vptr.
166
167 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
168
169 * trans.cc (get_var_descr): Remove argument ts. Use var->ts
170 instead.
171 (gfc_add_finalizer_call): Update caller.
172
173 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
174
175 * trans.cc (gfc_add_finalizer_call): Inline definition of
176 variable has_finalizer. Merge nested conditions.
177
178 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
179
180 * trans.cc (gfc_add_finalizer_call): Remove local variable
181 final_expr. Pass down expr to get_final_proc_ref and move
182 final procedure expression generation down to its one usage
183 in get_final_proc_ref.
184 (get_final_proc_ref): Add argument expr. Remove argument
185 final_wrapper. Recreate final_wrapper from expr.
186
187 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
188
189 * trans.cc (gfc_add_finalizer_call): Remove local variable
190 elem_size. Pass expression to get_elem_size and move the
191 element size expression generation close to its usage there.
192 (get_elem_size): Add argument expr, remove class_size argument
193 and rebuild it from expr. Remove ts argument and use the
194 type of expr instead.
195
196 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
197
198 * trans.cc (gfc_add_finalizer_call): Move pre and post code for
199 the final procedure pointer expression to the outer block.
200 Reuse the previously evaluated final procedure pointer
201 expression.
202
203 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
204
205 * trans.cc (gfc_add_finalizer_call): Add post code for desc_se
206 after the finalizer call. Add post code for final_se and
207 size_se as well.
208
209 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
210
211 * trans.cc (gfc_build_final_call): Inline...
212 (gfc_add_finalizer_call): ... to its one caller.
213
214 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
215
216 * trans.cc (get_var_descr): New function.
217 (gfc_build_final_call): Outline the data reference descriptor
218 evaluation code to get_var_descr.
219
220 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
221
222 * trans.cc (get_elem_size): New function.
223 (gfc_build_final_call): Outline the element size evaluation
224 to get_elem_size.
225
226 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
227
228 * trans.cc (get_final_proc_ref): New function.
229 (gfc_build_final_call): Outline the pointer evaluation code
230 to get_final_proc_ref.
231
232 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
233
234 * trans.cc (gfc_build_final_call): Remove commented assertion.
235
236 2023-07-14 Mikael Morin <mikael@gcc.gnu.org>
237
238 PR fortran/92178
239 * trans.h (gfc_reset_vptr): Add class_container argument.
240 * trans-expr.cc (gfc_reset_vptr): Ditto. If a valid vptr can
241 be obtained through class_container argument, bypass evaluation
242 of e.
243 (gfc_conv_procedure_call): Wrap the argument evaluation code
244 in a conditional if the associated dummy is optional. Evaluate
245 the data reference to a pointer now, and replace later
246 references with usage of the pointer.
247
248 2023-07-14 Mikael Morin <mikael@gcc.gnu.org>
249
250 PR fortran/92178
251 * trans.h (struct gfc_se): New field class_container.
252 (struct gfc_ss_info): Ditto.
253 (gfc_evaluate_data_ref_now): New prototype.
254 * trans.cc (gfc_evaluate_data_ref_now): Implement it.
255 * trans-array.cc (gfc_conv_ss_descriptor): Copy class_container
256 field from gfc_se struct to gfc_ss_info struct.
257 (gfc_conv_expr_descriptor): Copy class_container field from
258 gfc_ss_info struct to gfc_se struct.
259 * trans-expr.cc (gfc_conv_class_to_class): Use class container
260 set in class_container field if available.
261 (gfc_conv_variable): Set class_container field on encountering
262 class variables or components, clear it on encountering
263 non-class components.
264 (gfc_conv_procedure_call): Evaluate data ref to a pointer now,
265 and replace later references by usage of the pointer.
266
267 2023-07-14 Mikael Morin <mikael@gcc.gnu.org>
268
269 PR fortran/92178
270 * trans-expr.cc (gfc_conv_procedure_call): Use a separate gfc_se
271 struct, initalized from parmse, to generate the class wrapper.
272 After the class wrapper code has been generated, copy it back
273 depending on whether parameter deallocation code has been
274 generated.
275
276 2023-07-13 Mikael Morin <mikael@gcc.gnu.org>
277
278 PR fortran/106050
279 * symbol.cc (gfc_restore_last_undo_checkpoint): Release symbols
280 in reverse order.
281
282 2023-07-12 Andre Vehreschild <vehre@gcc.gnu.org>
283
284 PR fortran/102003
285 * expr.cc (find_inquiry_ref): Replace len of pdt_string by
286 constant.
287 (simplify_ref_chain): Ensure input to find_inquiry_ref is
288 NULL.
289 (gfc_match_init_expr): Prevent PDT analysis for function calls.
290 (gfc_pdt_find_component_copy_initializer): Get the initializer
291 value for given component.
292 * gfortran.h (gfc_pdt_find_component_copy_initializer): New
293 function.
294 * simplify.cc (gfc_simplify_len): Replace len() of PDT with pdt
295 component ref or constant.
296
297 2023-07-11 Harald Anlauf <anlauf@gmx.de>
298
299 PR fortran/110288
300 * symbol.cc (gfc_copy_formal_args_intr): When deriving the formal
301 argument attributes from the actual ones for intrinsic procedure
302 calls, take special care of CHARACTER arguments that we do not
303 wrongly treat them formally as deferred-length.
304
305 2023-07-08 Steve Kargl <sgk@troutmask.apl.washington.edu>
306
307 PR fortran/99139
308 PR fortran/99368
309 * match.cc (gfc_match_namelist): Check for host associated or
310 defined types before applying default type.
311 (gfc_match_select_rank): Apply default type to selector of
312 unknown type if possible.
313 * resolve.cc (resolve_fl_variable): Do not apply local default
314 initialization to assumed rank entities.
315
316 2023-07-08 Harald Anlauf <anlauf@gmx.de>
317 Steven G. Kargl <kargl@gcc.gnu.org>
318
319 PR fortran/92178
320 * trans-expr.cc (gfc_conv_procedure_call): Check procedures for
321 allocatable dummy arguments with INTENT(OUT) and move deallocation
322 of actual arguments after evaluation of argument expressions before
323 the procedure is executed.
324
325 2023-07-08 Harald Anlauf <anlauf@gmx.de>
326
327 PR fortran/110585
328 * arith.cc (gfc_compare_expr): Handle equality comparison of constant
329 complex gfc_expr arguments.
330
331 2023-07-05 Robin Dapp <rdapp@ventanamicro.com>
332 Juzhe-Zhong <juzhe.zhong@rivai.ai>
333
334 * trans-types.cc (gfc_type_for_mode): Ditto.
335
336 2023-06-28 Harald Anlauf <anlauf@gmx.de>
337
338 PR fortran/110360
339 * trans-expr.cc (gfc_conv_procedure_call): For non-constant string
340 argument passed to CHARACTER(LEN=1),VALUE dummy, ensure proper
341 dereferencing and truncation of string to length 1.
342
343 2023-06-28 Paul Thomas <pault@gcc.gnu.org>
344
345 PR fortran/49213
346 * expr.cc (gfc_is_ptr_fcn): Remove reference to class_pointer.
347 * resolve.cc (resolve_assoc_var): Call gfc_is_ptr_fcn to allow
348 associate names with pointer function targets to be used in
349 variable definition context.
350 * trans-decl.cc (get_symbol_decl): Remove extraneous line.
351 * trans-expr.cc (alloc_scalar_allocatable_subcomponent): Obtain
352 size of intrinsic and character expressions.
353 (gfc_trans_subcomponent_assign): Expand assignment to class
354 components to include intrinsic and character expressions.
355
356 2023-06-24 Harald Anlauf <anlauf@gmx.de>
357
358 PR fortran/110360
359 * trans-expr.cc (gfc_conv_procedure_call): Truncate constant string
360 argument of length > 1 passed to scalar CHARACTER(1),VALUE dummy.
361
362 2023-06-23 Harald Anlauf <anlauf@gmx.de>
363
364 PR fortran/110360
365 * trans-expr.cc (gfc_conv_procedure_call): Pass actual argument
366 to scalar CHARACTER(1),VALUE dummy argument by value.
367
368 2023-06-21 Paul Thomas <pault@gcc.gnu.org>
369
370 PR fortran/87477
371 PR fortran/88688
372 PR fortran/94380
373 PR fortran/107900
374 PR fortran/110224
375 * decl.cc (char_len_param_value): Fix memory leak.
376 (resolve_block_construct): Remove unnecessary static decls.
377 * expr.cc (gfc_is_ptr_fcn): New function.
378 (gfc_check_vardef_context): Use it to permit pointer function
379 result selectors to be used for associate names in variable
380 definition context.
381 * gfortran.h: Prototype for gfc_is_ptr_fcn.
382 * match.cc (build_associate_name): New function.
383 (gfc_match_select_type): Use the new function to replace inline
384 version and to build a new associate name for the case where
385 the supplied associate name is already used for that purpose.
386 * resolve.cc (resolve_assoc_var): Call gfc_is_ptr_fcn to allow
387 associate names with pointer function targets to be used in
388 variable definition context.
389 * trans-decl.cc (gfc_get_symbol_decl): Unlimited polymorphic
390 variables need deferred initialisation of the vptr.
391 (gfc_trans_deferred_vars): Do the vptr initialisation.
392 * trans-stmt.cc (trans_associate_var): Ensure that a pointer
393 associate name points to the target of the selector and not
394 the selector itself.
395
396 2023-06-21 Paul Thomas <pault@gcc.gnu.org>
397
398 PR fortran/108961
399 * trans-expr.cc (gfc_conv_procedure_call): The hidden string
400 length must not be passed to a formal arg of type(cptr).
401
402 2023-06-20 Tobias Burnus <tobias@codesourcery.com>
403
404 * dump-parse-tree.cc (show_omp_namelist): Fix dump of the allocator
405 modifier of OMP_LIST_ALLOCATE.
406
407 2023-06-20 Tobias Burnus <tobias@codesourcery.com>
408
409 * match.cc (gfc_match_char): Match with '%S' a symbol
410 with host_assoc = 1.
411
412 2023-06-19 Tobias Burnus <tobias@codesourcery.com>
413
414 * intrinsic.texi (OpenMP Modules OMP_LIB and OMP_LIB_KINDS): Also
415 add references to the OpenMP 5.1 and 5.2 spec; add omp_initial_device
416 and omp_invalid_device named constants.
417
418 2023-06-13 Harald Anlauf <anlauf@gmx.de>
419 Mikael Morin <mikael@gcc.gnu.org>
420
421 PR fortran/86277
422 * trans-array.cc (gfc_trans_allocate_array_storage): When passing a
423 zero-sized array with fixed (= non-dynamic) size, allocate temporary
424 by the caller, not by the callee.
425
426 2023-06-10 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
427
428 * f95-lang.cc (gfc_init_builtin_functions): Add fmax() and
429 fmin() built-ins, and their variants.
430 * mathbuiltins.def: Add FMAX and FMIN built-ins.
431 * trans-intrinsic.cc (conv_intrinsic_ieee_minmax): New function.
432 (gfc_conv_ieee_arithmetic_function): Handle IEEE_MIN_NUM and
433 IEEE_MAX_NUM functions.
434
435 2023-06-09 Jakub Jelinek <jakub@redhat.com>
436
437 PR fortran/96024
438 * primary.cc (gfc_convert_to_structure_constructor): Only do
439 constant string ctor length verification and truncation/padding
440 if constant length has INTEGER type.
441
442 2023-06-08 Paul Thomas <pault@gcc.gnu.org>
443
444 PR fortran/87477
445 PR fortran/99350
446 PR fortran/107821
447 PR fortran/109451
448 * decl.cc (char_len_param_value): Simplify a copy of the expr
449 and replace the original if there is no error.
450 * gfortran.h : Remove the redundant field 'rankguessed' from
451 'gfc_association_list'.
452 * resolve.cc (resolve_assoc_var): Remove refs to 'rankguessed'.
453 (resolve_variable): Associate names with constant or structure
454 constructor targets cannot have array refs.
455 * trans-array.cc (gfc_conv_expr_descriptor): Guard expression
456 character length backend decl before using it. Suppress the
457 assignment if lhs equals rhs.
458 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
459 associate variables pointing to a variable. Add comment.
460 * trans-stmt.cc (trans_associate_var): Remove requirement that
461 the character length be deferred before assigning the value
462 returned by gfc_conv_expr_descriptor. Also, guard the backend
463 decl before testing with VAR_P.
464
465 2023-06-06 Kwok Cheung Yeung <kcy@codesourcery.com>
466 Tobias Burnus <tobias@codesourcery.com>
467
468 * dump-parse-tree.cc (show_omp_namelist): Display 'present' map
469 modifier.
470 (show_omp_clauses): Display 'present' motion modifier for 'to'
471 and 'from' clauses.
472 * gfortran.h (enum gfc_omp_map_op): Add entries with 'present'
473 modifiers.
474 (struct gfc_omp_namelist): Add 'present_modifer'.
475 * openmp.cc (gfc_match_motion_var_list): New, handles optional
476 'present' modifier for to/from clauses.
477 (gfc_match_omp_clauses): Call it for to/from clauses; parse 'present'
478 in defaultmap and map clauses.
479 (resolve_omp_clauses): Allow 'present' modifiers on 'target',
480 'target data', 'target enter' and 'target exit' directives.
481 * trans-openmp.cc (gfc_trans_omp_clauses): Apply 'present' modifiers
482 to tree node for 'map', 'to' and 'from' clauses. Apply 'present' for
483 defaultmap.
484
485 2023-06-02 Steve Kargl <kargl@gcc.gnu.org>
486
487 PR fortran/100607
488 * resolve.cc (resolve_select_rank): Remove duplicate error.
489 (resolve_fl_var_and_proc): Prevent NULL pointer dereference and
490 suppress error message for temporary.
491
492 2023-06-02 Paul Thomas <pault@gcc.gnu.org>
493
494 PR fortran/87477
495 * parse.cc (parse_associate): Replace the existing evaluation
496 of the target rank with calls to gfc_resolve_ref and
497 gfc_expression_rank. Identify untyped target function results
498 with structure constructors by finding the appropriate derived
499 type.
500 * resolve.cc (resolve_symbol): Allow associate variables to be
501 assumed shape.
502
503 2023-06-01 Harald Anlauf <anlauf@gmx.de>
504
505 PR fortran/88552
506 * decl.cc (gfc_match_kind_spec): Use error path on missing right
507 parenthesis.
508 (gfc_match_decl_type_spec): Use error return when an error occurred
509 during matching a KIND specifier.
510
511 2023-06-01 Tobias Burnus <tobias@codesourcery.com>
512
513 * parse.cc (decode_omp_directive): Accept all pure directives
514 inside a PURE procedures; handle 'error at(execution).
515
516 2023-05-26 Tobias Burnus <tobias@codesourcery.com>
517
518 * dump-parse-tree.cc (show_omp_namelist): Update allocator, fix
519 align dump.
520 (show_omp_node, show_code_node): Handle EXEC_OMP_ALLOCATE.
521 * gfortran.h (enum gfc_statement): Add ST_OMP_ALLOCATE and ..._EXEC.
522 (enum gfc_exec_op): Add EXEC_OMP_ALLOCATE.
523 (struct gfc_omp_namelist): Add 'allocator' to 'u2' union.
524 (struct gfc_namespace): Add omp_allocate.
525 (gfc_resolve_omp_allocate): New.
526 * match.cc (gfc_free_omp_namelist): Free 'u2.allocator'.
527 * match.h (gfc_match_omp_allocate, gfc_match_omp_allocators): New.
528 * openmp.cc (gfc_omp_directives): Uncomment allocate/allocators.
529 (gfc_match_omp_variable_list): Add bool arg for
530 rejecting listening common-block vars separately.
531 (gfc_match_omp_clauses): Update for u2.allocators.
532 (OMP_ALLOCATORS_CLAUSES, gfc_match_omp_allocate,
533 gfc_match_omp_allocators, is_predefined_allocator,
534 gfc_resolve_omp_allocate): New.
535 (resolve_omp_clauses): Update 'allocate' clause checks.
536 (omp_code_to_statement, gfc_resolve_omp_directive): Handle
537 OMP ALLOCATE/ALLOCATORS.
538 * parse.cc (in_exec_part): New global var.
539 (check_omp_allocate_stmt, parse_openmp_allocate_block): New.
540 (decode_omp_directive, case_exec_markers, case_omp_decl,
541 gfc_ascii_statement, parse_omp_structured_block): Handle
542 OMP allocate/allocators.
543 (verify_st_order, parse_executable): Set in_exec_part.
544 * resolve.cc (gfc_resolve_blocks, resolve_codes): Handle
545 allocate/allocators.
546 * st.cc (gfc_free_statement): Likewise.
547 * trans.cc (trans_code): Likewise.
548 * trans-openmp.cc (gfc_trans_omp_directive): Likewise.
549 (gfc_trans_omp_clauses, gfc_split_omp_clauses): Update for
550 u2.allocator, fix for u.align.
551
552 2023-05-24 Harald Anlauf <anlauf@gmx.de>
553
554 PR fortran/104350
555 * simplify.cc (simplify_size): Reject DIM argument of intrinsic SIZE
556 with error when out of valid range.
557
558 2023-05-24 Harald Anlauf <anlauf@gmx.de>
559
560 PR fortran/103794
561 * check.cc (gfc_check_reshape): Expand constant arguments SHAPE and
562 ORDER before checking.
563 * gfortran.h (gfc_is_constant_array_expr): Add prototype.
564 * iresolve.cc (gfc_resolve_reshape): Expand constant argument SHAPE.
565 * simplify.cc (is_constant_array_expr): If array is determined to be
566 constant, expand small array constructors if needed.
567 (gfc_is_constant_array_expr): Wrapper for is_constant_array_expr.
568 (gfc_simplify_reshape): Fix check for insufficient elements in SOURCE
569 when no padding specified.
570
571 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
572
573 PR fortran/103716
574 * resolve.cc (gfc_resolve_ref): Conversion of array_ref into an
575 element should be done for all characters without a len expr,
576 not just deferred lens, and for integer expressions.
577 * trans-expr.cc (conv_inquiry): For len and kind inquiry refs,
578 set the se string_length to NULL_TREE.
579
580 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
581 Steven G. Kargl <kargl@gcc.gnu.org>
582
583 PR fortran/97122
584 * decl.cc (variable_decl): Clean up white space issues.
585 (gfc_match_final_decl): Declaration of finalizable derived type
586 is allowed in a submodule.
587
588 2023-05-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
589
590 * expr.cc (gfc_get_corank): Use CLASS_DATA from gfortran.h.
591 * resolve.cc (resolve_component): Same.
592 (resolve_fl_derived0): Same.
593 * simplify.cc (gfc_simplify_extends_type_of): Same.
594 (simplify_cobound): Same.
595
596 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
597
598 * trans-array.cc (is_pointer_array): Use _P() defines from tree.h.
599 (gfc_conv_scalarized_array_ref): Ditto.
600 (gfc_conv_array_ref): Ditto.
601 * trans-decl.cc (gfc_finish_decl): Ditto.
602 (gfc_get_symbol_decl): Ditto.
603 * trans-expr.cc (gfc_trans_pointer_assignment): Ditto.
604 (gfc_trans_arrayfunc_assign): Ditto.
605 (gfc_trans_assignment_1): Ditto.
606 * trans-intrinsic.cc (gfc_conv_intrinsic_minmax): Ditto.
607 (conv_intrinsic_ieee_value): Ditto.
608 * trans-io.cc (gfc_convert_array_to_string): Ditto.
609 * trans-openmp.cc (gfc_omp_is_optional_argument): Ditto.
610 (gfc_trans_omp_clauses): Ditto.
611 * trans-stmt.cc (gfc_conv_label_variable): Ditto.
612 * trans.cc (gfc_build_addr_expr): Ditto.
613 (get_array_span): Ditto.
614
615 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
616
617 PR fortran/78798
618 * array.cc (compare_bounds): Use narrower return type.
619 (gfc_compare_array_spec): Likewise.
620 (is_constant_element): Likewise.
621 (gfc_constant_ac): Likewise.
622 * check.cc (dim_rank_check): Likewise.
623 * cpp.cc (gfc_cpp_init_options): Likewise.
624 (dump_macro): Likewise.
625 * cpp.h (gfc_cpp_handle_option): Likewise.
626 * dependency.cc (gfc_ref_needs_temporary_p): Likewise.
627 (gfc_check_argument_dependency): Likewise.
628 (gfc_check_fncall_dependency): Likewise.
629 (ref_same_as_full_array): Likewise.
630 * dependency.h (gfc_check_fncall_dependency): Likewise.
631 (gfc_dep_resolver): Likewise.
632 (gfc_are_equivalenced_arrays): Likewise.
633 * expr.cc (gfc_copy_ref): Likewise.
634 (gfc_kind_max): Likewise.
635 (numeric_type): Likewise.
636 * gfortran.h (gfc_at_end): Likewise.
637 (gfc_at_eof): Likewise.
638 (gfc_at_bol): Likewise.
639 (gfc_at_eol): Likewise.
640 (gfc_define_undef_line): Likewise.
641 (gfc_wide_is_printable): Likewise.
642 (gfc_wide_is_digit): Likewise.
643 (gfc_wide_fits_in_byte): Likewise.
644 (gfc_find_sym_tree): Likewise.
645 (gfc_generic_intrinsic): Likewise.
646 (gfc_specific_intrinsic): Likewise.
647 (gfc_intrinsic_actual_ok): Likewise.
648 (gfc_has_vector_index): Likewise.
649 (gfc_numeric_ts): Likewise.
650 (gfc_impure_variable): Likewise.
651 (gfc_pure): Likewise.
652 (gfc_implicit_pure): Likewise.
653 (gfc_elemental): Likewise.
654 (gfc_pure_function): Likewise.
655 (gfc_implicit_pure_function): Likewise.
656 (gfc_compare_array_spec): Likewise.
657 (gfc_constant_ac): Likewise.
658 (gfc_expanded_ac): Likewise.
659 (gfc_check_digit): Likewise.
660 * intrinsic.cc (gfc_find_subroutine): Likewise.
661 (gfc_generic_intrinsic): Likewise.
662 (gfc_specific_intrinsic): Likewise.
663 * io.cc (compare_to_allowed_values): Likewise. And remove
664 unneeded forward declaration.
665 * parse.cc: Likewise.
666 * parse.h (gfc_check_do_variable): Likewise.
667 * primary.cc (gfc_check_digit): Likewise.
668 * resolve.cc (resolve_structure_cons): Likewise.
669 (pure_stmt_function): Likewise.
670 (gfc_pure_function): Likewise.
671 (impure_stmt_fcn): Likewise.
672 (resolve_forall_iterators): Likewise.
673 (resolve_data): Likewise.
674 (gfc_impure_variable): Likewise.
675 (gfc_pure): Likewise.
676 (gfc_unset_implicit_pure): Likewise.
677 * scanner.cc (wide_is_ascii): Likewise.
678 (gfc_wide_toupper): Likewise.
679 (gfc_open_included_file): Likewise.
680 (gfc_at_end): Likewise.
681 (gfc_at_eof): Likewise.
682 (gfc_at_bol): Likewise.
683 (skip_comment_line): Likewise.
684 (gfc_gobble_whitespace): Likewise.
685 * symbol.cc (gfc_find_symtree_in_proc): Likewise.
686 * trans-array.cc: Likewise.
687 * trans-decl.cc (gfc_set_decl_assembler_name): Likewise.
688 * trans-types.cc (gfc_get_element_type): Likewise.
689 (gfc_add_field_to_struct): Likewise.
690 * trans-types.h (gfc_copy_dt_decls_ifequal): Likewise.
691 (gfc_return_by_reference): Likewise.
692 (gfc_is_nodesc_array): Likewise.
693 * trans.h (gfc_can_put_var_on_stack): Likewise.
694
695 2023-05-17 Harald Anlauf <anlauf@gmx.de>
696
697 PR fortran/95374
698 PR fortran/104352
699 * decl.cc (add_init_expr_to_sym): Set shape of initializer also for
700 zero-sized arrays, so that bounds violations can be detected later.
701
702 2023-05-17 Tobias Burnus <tobias@codesourcery.com>
703
704 * trans-decl.cc (gfc_get_symbol_decl): Add attributes
705 such as 'declare target' also to hidden artificial
706 variable for deferred-length character variables.
707 * trans-openmp.cc (gfc_trans_omp_array_section,
708 gfc_trans_omp_clauses, gfc_trans_omp_target_exit_data):
709 Improve mapping of array descriptors and deferred-length
710 string variables.
711
712 2023-05-16 Paul Thomas <pault@gcc.gnu.org>
713
714 PR fortran/105152
715 PR fortran/100193
716 PR fortran/87496
717 PR fortran/103389
718 PR fortran/104429
719 PR fortran/82774
720 * interface.cc (gfc_compare_actual_formal): Emit an error if an
721 unlimited polymorphic actual is not matched either to an
722 unlimited or assumed type formal argument.
723 * resolve.cc (resolve_ordinary_assign): Emit an error if the
724 var expression of an ordinary assignment is a proc pointer
725 component.
726 * trans-array.cc (gfc_walk_array_ref): Provide assumed shape
727 arrays coming from interface mapping with a viable arrayspec.
728 * trans-expr.cc (gfc_conv_intrinsic_to_class): Tidy up flagging
729 of unlimited polymorphic 'class_ts'.
730 (gfc_conv_gfc_desc_to_cfi_desc): Assumed type is unlimited
731 polymorphic and should accept any actual type.
732 (gfc_conv_procedure_call): Replace dreadful kludge with a call
733 to gfc_finalize_tree_expr. Avoid dereferencing a void pointer
734 by giving it the pointer type of the actual argument.
735 (alloc_scalar_allocatable_subcomponent): Shorten the function
736 name and replace the symbol argument with the se string length.
737 If a deferred length character length is either not present or
738 is not a variable, give the typespec a variable and assign the
739 string length to that. Use gfc_deferred_strlen to find the
740 hidden string length component.
741 (gfc_trans_subcomponent_assign): Convert the expression before
742 the call to alloc_scalar_allocatable_subcomponent so that a
743 good string length is provided.
744 (gfc_trans_structure_assign): Remove the unneeded derived type
745 symbol from calls to gfc_trans_subcomponent_assign.
746
747 2023-05-15 Harald Anlauf <anlauf@gmx.de>
748
749 PR fortran/109846
750 * expr.cc (gfc_check_vardef_context): Check appropriate pointer
751 attribute for CLASS vs. non-CLASS function result in variable
752 definition context.
753
754 2023-05-11 Xi Ruoyao <xry111@xry111.site>
755
756 * Make-lang.in: Use grep instead of fgrep.
757
758 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
759
760 * dump-parse-tree.cc (gfc_debug_expr): Remove forward declaration.
761 (debug): Add DEBUG_FUNCTION.
762 (show_code_node): Remove erroneous whitespace.
763
764 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
765
766 PR fortran/109624
767 * dump-parse-tree.cc (debug): New function for gfc_namespace.
768 (gfc_debug_code): Delete forward declaration.
769 (show_attr): Make sure to print balanced braces.
770
771 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
772
773 * resolve.cc (resolve_select_type): Fix coding style.
774
775 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
776
777 * resolve.cc (resolve_select_type): Call free() unconditionally.
778
779 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
780
781 PR fortran/68800
782 * expr.cc (find_array_section): Fix mpz memory leak.
783 * simplify.cc (gfc_simplify_reshape): Fix mpz memory leaks in
784 error paths.
785
786 2023-05-05 Harald Anlauf <anlauf@gmx.de>
787
788 PR fortran/109641
789 * arith.cc (eval_intrinsic): Check conformability of ranks of operands
790 for intrinsic binary operators before performing type conversions.
791 * gfortran.h (gfc_op_rank_conformable): Add prototype.
792 * resolve.cc (resolve_operator): Check conformability of ranks of
793 operands for intrinsic binary operators before performing type
794 conversions.
795 (gfc_op_rank_conformable): New helper function to compare ranks of
796 operands of binary operator.
797
798 2023-05-04 Julian Brown <julian@codesourcery.com>
799
800 PR fortran/109622
801 * openmp.cc (resolve_omp_clauses): Add diagnostic for
802 non-pointer/non-allocatable attach/detach.
803 * trans-openmp.cc (gfc_trans_omp_clauses): Remove dereference for
804 pointer-to-scalar derived type component attach/detach. Fix
805 attach/detach handling for descriptors.
806
807 2023-04-28 Julian Brown <julian@codesourcery.com>
808
809 PR fortran/109622
810 * trans-openmp.cc (gfc_trans_omp_clauses): Attach/detach clause fixes.
811
812 2023-04-28 Tobias Burnus <tobias@codesourcery.com>
813
814 * gfortran.texi: Fix typos.
815 * decl.cc: Fix typos in comments and in a variable name.
816 * arith.cc: Fix comment typos.
817 * check.cc: Likewise.
818 * class.cc: Likewise.
819 * dependency.cc: Likewise.
820 * expr.cc: Likewise.
821 * frontend-passes.cc: Likewise.
822 * gfortran.h: Likewise.
823 * intrinsic.cc: Likewise.
824 * iresolve.cc: Likewise.
825 * match.cc: Likewise.
826 * module.cc: Likewise.
827 * primary.cc: Likewise.
828 * resolve.cc: Likewise.
829 * simplify.cc: Likewise.
830 * trans-array.cc: Likewise.
831 * trans-decl.cc: Likewise.
832 * trans-expr.cc: Likewise.
833 * trans-intrinsic.cc: Likewise.
834 * trans-openmp.cc: Likewise.
835 * trans-stmt.cc: Likewise.
836
837 2023-04-25 Tobias Burnus <tobias@codesourcery.com>
838
839 * openmp.cc (gfc_resolve_omp_do_blocks): Handle zero
840 or more than one exec statements before/after 'omp scan'.
841 * trans-openmp.cc (gfc_trans_omp_do): Likewise.
842
843 2023-04-22 Harald Anlauf <anlauf@gmx.de>
844 Steven G. Kargl <kargl@gcc.gnu.org>
845
846 PR fortran/109500
847 * interface.cc (gfc_compare_actual_formal): Reject allocatable
848 functions being used as actual argument for allocable dummy.
849
850 2023-04-14 Harald Anlauf <anlauf@gmx.de>
851
852 PR fortran/109511
853 * simplify.cc (gfc_simplify_set_exponent): Fix implementation of
854 compile-time simplification of intrinsic SET_EXPONENT for argument
855 X < 1 and for I < 0.
856
857 2023-04-14 Paul Thomas <pault@gcc.gnu.org>
858
859 PR fortran/104272
860 * gfortran.h : Add expr3_not_explicit bit field to gfc_code.
861 * resolve.cc (resolve_allocate_expr): Set bit field when the
862 default initializer is applied to expr3.
863 * trans-stmt.cc (gfc_trans_allocate): If expr3_not_explicit is
864 set, do not deallocate expr3.
865
866 2023-04-13 Harald Anlauf <anlauf@gmx.de>
867
868 PR fortran/109492
869 * trans-expr.cc (gfc_conv_power_op): Use absu_hwi and
870 unsigned HOST_WIDE_INT for portability.
871
872 2023-04-12 Harald Anlauf <anlauf@gmx.de>
873
874 PR fortran/104312
875 * resolve.cc (resolve_entries): Handle functions with ENTRY and
876 ALLOCATABLE results.
877 * trans-expr.cc (gfc_conv_procedure_call): Functions with a result
878 with the POINTER or ALLOCATABLE attribute shall not get any special
879 treatment with -ff2c, as they cannot be written in Fortran 77.
880 * trans-types.cc (gfc_return_by_reference): Likewise.
881 (gfc_get_function_type): Likewise.
882
883 2023-04-12 Harald Anlauf <anlauf@gmx.de>
884
885 PR fortran/61615
886 PR fortran/99982
887 * interface.cc (compare_parameter): Enable type and rank checks for
888 arguments of derived type from the intrinsic module ISO_C_BINDING.
889
890 2023-04-08 Paul Thomas <pault@gcc.gnu.org>
891
892 PR fortran/87477
893 * iresolve.cc (gfc_resolve_adjustl, gfc_resolve_adjustr): if
894 string length is deferred use the string typespec for result.
895 * resolve.cc (resolve_assoc_var): Handle parentheses around the
896 target expression.
897 (resolve_block_construct): Remove unnecessary static decls.
898 * trans-array.cc (gfc_conv_expr_descriptor): Guard string len
899 expression in condition. Improve handling of string length and
900 span, especially for substrings of the descriptor.
901 (duplicate_allocatable): Make element type more explicit with
902 'eltype'.
903 * trans-decl.cc (gfc_get_symbol_decl): Emit a fatal error with
904 appropriate message instead of ICE if symbol type is unknown.
905 (gfc_generate_function_code): Set current locus to proc_sym
906 declared_at.
907 * trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in
908 'previous' and use if end expression in substring reference is
909 null.
910 (gfc_conv_string_length): Use gfc_conv_expr_descriptor if
911 'expr_flat' is an array. Add post block to catch deallocation
912 of temporaries.
913 (gfc_conv_procedure_call): Assign the parmse string length to
914 the expression string length, if it is deferred.
915 (gfc_trans_alloc_subarray_assign): If this is a deferred string
916 length component, store the string length in the hidden comp.
917 Update the typespec length accordingly. Generate a new type
918 spec for the call to gfc_duplicate-allocatable in this case.
919 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
920 deferred character array components.
921
922 2023-04-04 Harald Anlauf <anlauf@gmx.de>
923
924 PR fortran/104349
925 * expr.cc (check_restricted): Adjust check for valid variables in
926 restricted expressions: make no exception for module variables.
927
928 2023-04-01 Thomas Koenig <tkoenig@gcc.gnu.org>
929
930 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
931 type name to be "long long".
932
933 2023-03-30 Andrew Pinski <apinski@marvell.com>
934
935 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
936 type name to be "long long". Add a comment on why adding
937 2 to the name too.
938
939 2023-03-28 Jakub Jelinek <jakub@redhat.com>
940
941 PR fortran/109314
942 * openmp.cc (gfc_omp_absent_contains_clause): Fix typo in diagnostics
943 - composit -> composite.
944
945 2023-03-25 Harald Anlauf <anlauf@gmx.de>
946
947 PR fortran/104321
948 * trans-decl.cc (gfc_conv_cfi_to_gfc): Remove dead code.
949
950 2023-03-24 Harald Anlauf <anlauf@gmx.de>
951
952 * expr.cc (free_expr0): Free also BOZ strings as part of an expression.
953
954 2023-03-24 Haochen Gui <guihaoc@gcc.gnu.org>
955 Tobias Burnus <tobias@codesourcery.com>
956
957 PR target/103628
958 * target-memory.cc (gfc_interpret_float): Return FAIL when
959 native_interpret_expr gets a NULL tree.
960 * arith.cc (gfc_hollerith2real): Return NULL when
961 gfc_interpret_float fails.
962 * error.cc (gfc_buffered_p): Define.
963 * gfortran.h (gfc_buffered_p): Declare.
964 * intrinsic.cc: Add diagnostic.h to include list.
965 (do_simplify): Save errorcount and check it at finish. Report a
966 "Cannot simplify expression" error on a bad result if error count
967 doesn't change and no other errors buffered.
968
969 2023-03-22 Harald Anlauf <anlauf@gmx.de>
970 Steven G. Kargl <kargl@gcc.gnu.org>
971
972 PR fortran/104572
973 * resolve.cc (gfc_resolve_finalizers): Argument of a FINAL subroutine
974 cannot be an alternate return.
975
976 2023-03-21 Harald Anlauf <anlauf@gmx.de>
977
978 PR fortran/99036
979 * decl.cc (gfc_match_modproc): Reject MODULE PROCEDURE if not in a
980 generic module interface.
981
982 2023-03-21 Arsen Arsenović <arsen@aarsen.me>
983
984 * invoke.texi: Remove usages of @gol.
985 * intrinsic.texi: Ditto.
986
987 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
988
989 PR fortran/109206
990 * trans-array.cc (gfc_trans_array_constructor_value): Correct
991 incorrect setting of typespec.
992
993 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
994
995 PR fortran/109209
996 * resolve.cc (generate_component_assignments): Restore the
997 exclusion of allocatable components from the loop.
998
999 2023-03-20 Harald Anlauf <anlauf@gmx.de>
1000
1001 PR fortran/109216
1002 * invoke.texi: Correct documentation of how underscores are appended
1003 to external names.
1004
1005 2023-03-20 Harald Anlauf <anlauf@gmx.de>
1006
1007 PR fortran/109186
1008 * simplify.cc (gfc_simplify_nearest): Fix off-by-one error in setting
1009 up real kind-specific maximum exponent for mpfr.
1010
1011 2023-03-20 Paul Thomas <pault@gcc.gnu.org>
1012
1013 PR fortran/87127
1014 * resolve.cc (check_host_association): If an external function
1015 is typed but not declared explicitly to be external, change the
1016 old symbol from a variable to an external function.
1017
1018 2023-03-19 Harald Anlauf <anlauf@gmx.de>
1019
1020 PR fortran/85877
1021 * resolve.cc (resolve_fl_procedure): Check for an explicit interface
1022 of procedures with the BIND(C) attribute (F2018:15.4.2.2).
1023
1024 2023-03-19 Thomas Koenig <tkoenig@gcc.gnu.org>
1025
1026 * gfortran.texi: Mention behavior on overflow.
1027
1028 2023-03-18 Paul Thomas <pault@gcc.gnu.org>
1029
1030 PR fortran/103854
1031 PR fortran/96122
1032 PR fortran/37336
1033 * class.cc (finalize_component): Include the missing arguments
1034 in the call to the component's finalizer wrapper.
1035 (has_finalizer_component): Do not return true for procedure
1036 pointer components.
1037 (finalizer_insert_packed_call): Remove the redundant argument
1038 in the call to the final subroutine.
1039 (generate_finalization_wrapper): Add support for assumed rank
1040 finalizers.
1041 (gfc_may_be_finalized): New helper function.
1042 * dump-parse-tree.cc (write_proc): Whitespace.
1043 * gfortran.h : Add prototype for gfc_may_be_finalized.
1044 * resolve.cc (resolve_function): Correct derived types that
1045 have an incomplete namespace.
1046 (resolve_where, gfc_resolve_where_code_in_forall,
1047 gfc_resolve_forall_body, gfc_resolve_code): Check that the op
1048 code is still EXEC_ASSIGN. If it is set lhs to must finalize.
1049 (is_finalizable_type): New function.
1050 (generate_component_assignments): Set must_finalize if needed.
1051 (gfc_resolve_finalizers): Error if assumed rank finalizer is
1052 not the only one. Warning on lack of scalar finalizer modified
1053 to account for assumed rank finalizers.
1054 (generate_final_call): New function.
1055 (generate_component_assignments): Enclose the outermost call in
1056 a block to capture automatic deallocation and final calls.
1057 Set must_finalize as required to satisfy the standards. Use an
1058 explicit pointer assignment for pointer components to capture
1059 finalization of the target. Likewise use explicit assignment
1060 for allocatable components. Do not use the temporary copy of
1061 the lhs in defined assignment if the component is allocatable.
1062 Put the temporary in the same namespace as the lhs symbol if
1063 the component may be finalized. Remove the leading assignment
1064 from the expansion of assignment of components that have their
1065 own defined assignment components. Suppress finalization of
1066 assignment of temporary components to the lhs. Make an explicit
1067 final call for the rhs function temporary if it exists.
1068 (gfc_resolve_code): Set must_finalize for assignments with an
1069 array constructor on the rhs.
1070 (gfc_resolve_finalizers): Ensure that an assumed rank finalizer
1071 is the only finalizer for that type and correct the surprising
1072 warning for the lack of a scalar finalizer.
1073 (check_defined_assignments): Handle allocatable components.
1074 (resolve_fl_derived): Set referenced the vtab for use
1075 associated symbols.
1076 (resolve_symbol): Set referenced an unreferenced symbol that
1077 will be finalized.
1078 * trans-array.cc (gfc_trans_array_constructor_value): Add code
1079 to finalize the constructor result. Warn that this feature was
1080 removed in F2018 and that it is suppressed by -std=2018.
1081 (trans_array_constructor): Add finalblock, pass to previous
1082 and apply to loop->post if filled.
1083 (gfc_add_loop_ss_code): Add se finalblock to outer loop post.
1084 (gfc_trans_array_cobounds, gfc_trans_array_bounds): Add any
1085 generated finalization code to the main block.
1086 (structure_alloc_comps): Add boolean argument to suppress
1087 finalization and use it for calls from
1088 gfc_deallocate_alloc_comp_no_caf. Otherwise it defaults to
1089 false.
1090 (gfc_copy_alloc_comp_no_fini): New wrapper for
1091 structure_alloc_comps.
1092 (gfc_alloc_allocatable_for_assignment): Suppress finalization
1093 by setting new arg in call to gfc_deallocate_alloc_comp_no_caf.
1094 (gfc_trans_deferred_array): Use gfc_may_be_finalized and do not
1095 deallocate the components of entities with a leading '_' in the
1096 name that are also marked as artificial.
1097 * trans-array.h : Add the new boolean argument to the prototype
1098 of gfc_deallocate_alloc_comp_no_caf with a default of false.
1099 Add prototype for gfc_copy_alloc_comp_no_fini.
1100 * trans-decl.cc(init_intent_out_dt): Tidy up the code.
1101 * trans-expr.cc (gfc_init_se): Initialize finalblock.
1102 (gfc_conv_procedure_call): Use gfc_finalize_tree_expr to
1103 finalize function results. Replace in-line block for class
1104 results with call to new function.
1105 (gfc_conv_expr): Finalize structure constructors for F2003 and
1106 F2008. Warn that this feature was deleted in F2018 and, unlike
1107 array constructors, is not default. Add array constructor
1108 finalblock to the post block.
1109 (gfc_trans_scalar_assign): Suppress finalization by setting new
1110 argument in call to gfc_deallocate_alloc_comp_no_caf. Add the
1111 finalization blocks to the main block.
1112 (gfc_trans_arrayfunc_assign): Use gfc_assignment_finalizer_call
1113 and ensure that finalization occurs after the evaluation of the
1114 rhs but using the initial value for the lhs. Finalize rhs
1115 function results using gfc_finalize_tree_expr.
1116 (trans_class_assignment, gfc_trans_assignment_1): As previous
1117 function, taking care to order evaluation, assignment and
1118 finalization correctly.
1119 * trans-io.cc (gfc_trans_transfer): Add the final block.
1120 * trans-stmt.cc (gfc_trans_call, gfc_trans_allocate): likewise.
1121 (trans_associate_var): Nullify derived allocatable components
1122 and finalize function targets with defined assignment
1123 components on leaving the block scope.
1124 (trans_allocate): Finalize source expressions, if required,
1125 and set init_expr artificial temporarily to suppress the
1126 finalization in gfc_trans_assignment.
1127 * trans.cc (gfc_add_finalizer_call): Do not finalize the
1128 temporaries generated in type assignment with defined
1129 assignment components.
1130 (gfc_assignment_finalizer_call): New function.
1131 (gfc_finalize_tree_expr): New function.
1132 * trans.h: Add finalblock to gfc_se. Add the prototypes for
1133 gfc_finalize_tree_expr and gfc_assignment_finalizer_call.
1134
1135 2023-03-15 Harald Anlauf <anlauf@gmx.de>
1136 Tobias Burnus <tobias@codesourcery.com>
1137
1138 PR fortran/58331
1139 * interface.cc (compare_parameter): Adjust check of array dummy
1140 arguments to handle the case of CLASS variables.
1141
1142 2023-03-11 Harald Anlauf <anlauf@gmx.de>
1143
1144 PR fortran/106945
1145 * trans-expr.cc (gfc_copy_class_to_class): Convert element counts in
1146 bounds check to common type for comparison.
1147
1148 2023-03-10 Harald Anlauf <anlauf@gmx.de>
1149
1150 PR fortran/104332
1151 * resolve.cc (resolve_symbol): Avoid NULL pointer dereference while
1152 checking a symbol with the BIND(C) attribute.
1153
1154 2023-03-05 Harald Anlauf <anlauf@gmx.de>
1155 Tobias Burnus <tobias@codesourcery.com>
1156
1157 PR fortran/106856
1158 * class.cc (gfc_build_class_symbol): Handle update of attributes of
1159 existing class container.
1160 (gfc_find_derived_vtab): Fix several memory leaks.
1161 (find_intrinsic_vtab): Ditto.
1162 * decl.cc (attr_decl1): Manage update of symbol attributes from
1163 CLASS attributes.
1164 * primary.cc (gfc_variable_attr): OPTIONAL shall not be taken or
1165 updated from the class container.
1166 * symbol.cc (free_old_symbol): Adjust management of symbol versions
1167 to not prematurely free array specs while working on the declation
1168 of CLASS variables.
1169
1170 2023-03-01 Tobias Burnus <tobias@codesourcery.com>
1171
1172 PR middle-end/108546
1173 * trans-openmp.cc (gfc_trans_omp_clauses): Fix mapping of
1174 type(C_ptr) variables.
1175
1176 2023-02-27 Harald Anlauf <anlauf@gmx.de>
1177
1178 PR fortran/108937
1179 * trans-intrinsic.cc (gfc_conv_intrinsic_ibits): Handle corner case
1180 LEN argument of IBITS equal to BITSIZE(I).
1181
1182 2023-02-25 Mikael Morin <mikael@gcc.gnu.org>
1183
1184 PR fortran/108923
1185 * intrinsic.cc (get_intrinsic_dummy_arg,
1186 set_intrinsic_dummy_arg): Rename the former to the latter.
1187 Remove the return value, add a reference to the lhs as argument,
1188 and do the pointer assignment inside the function. Don't do
1189 it if the pointer is already non-NULL.
1190 (sort_actual): Update caller.
1191
1192 2023-02-25 Harald Anlauf <anlauf@gmx.de>
1193
1194 * arith.cc (gfc_real2int): Clear mpfr variable after use.
1195
1196 2023-02-25 Tobias Burnus <tobias@codesourcery.com>
1197
1198 PR fortran/108621
1199 * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Skip setting of
1200 bounds of CFI desc for 'pointer,intent(out)'.
1201
1202 2023-02-24 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
1203
1204 * trans-decl.cc (gfc_finish_var_decl): Apply attribute.
1205 (generate_local_decl): Add diagnostic for dummy and local variables.
1206
1207 2023-02-24 Mikael Morin <mikael@gcc.gnu.org>
1208
1209 PR fortran/108923
1210 * expr.cc (gfc_free_actual_arglist): Free associated_dummy
1211 memory.
1212 (gfc_copy_actual_arglist): Make a copy of the associated_dummy
1213 field if it is set in the original element.
1214
1215 2023-02-24 Harald Anlauf <anlauf@gmx.de>
1216
1217 PR fortran/108924
1218 * frontend-passes.cc (do_subscript): Clear used gmp variable.
1219
1220 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
1221
1222 * invoke.texi: Reorder index entries around @items.
1223
1224 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
1225
1226 * invoke.texi: Reorder @opindex commands to precede @items they
1227 relate to.
1228
1229 2023-02-22 Harald Anlauf <anlauf@gmx.de>
1230
1231 PR fortran/96024
1232 * resolve.cc (resolve_component): The type of a CHARACTER length
1233 expression must be INTEGER.
1234
1235 2023-02-21 Harald Anlauf <anlauf@gmx.de>
1236
1237 PR fortran/96025
1238 * parse.cc (check_function_result_typed): Improve type check of
1239 specification expression for character length and return status.
1240 (parse_spec): Use status from above.
1241 * resolve.cc (resolve_fntype): Prevent use of invalid specification
1242 expression for character length.
1243
1244 2023-02-16 Patrick Palka <ppalka@redhat.com>
1245
1246 * gfortran.h: Mechanically drop static from static inline
1247 functions via s/^static inline/inline/g.
1248
1249 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
1250
1251 PR fortran/103608
1252 * frontend-passes.cc (do_intent): Catch NULL pointer dereference on
1253 reference to invalid formal argument.
1254
1255 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
1256
1257 PR fortran/104554
1258 * resolve.cc (check_assumed_size_reference): Avoid NULL pointer
1259 dereference.
1260
1261 2023-02-15 Tobias Burnus <tobias@codesourcery.com>
1262
1263 PR fortran/108512
1264 * openmp.cc (gfc_resolve_omp_parallel_blocks): Handle combined 'loop'
1265 directives.
1266 (gfc_resolve_do_iterator): Set a source location for added
1267 'private'-clause arguments.
1268 * resolve.cc (gfc_resolve_code): Call gfc_resolve_omp_do_blocks
1269 also for EXEC_OMP_LOOP and gfc_resolve_omp_parallel_blocks for
1270 combined directives with loop + '{masked,master} taskloop (simd)'.
1271
1272 2023-02-13 Harald Anlauf <anlauf@gmx.de>
1273
1274 PR fortran/103475
1275 * primary.cc (gfc_expr_attr): Avoid NULL pointer dereference for
1276 invalid use of CLASS variable.
1277
1278 2023-02-13 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
1279
1280 * decl.cc: Add EXT_ATTR_NOINLINE, EXT_ATTR_NORETURN, EXT_ATTR_WEAK.
1281 * gfortran.h (ext_attr_id_t): Ditto.
1282 * gfortran.texi (GCC$ ATTRIBUTES): Document them.
1283 * trans-decl.cc (build_function_decl): Apply them.
1284
1285 2023-02-09 Harald Anlauf <anlauf@gmx.de>
1286 Steven G. Kargl <kargl@gcc.gnu.org>
1287
1288 PR fortran/69636
1289 PR fortran/103779
1290 * intrinsic.cc (gfc_convert_chartype): Recover on invalid character
1291 kind in conversion instead of generating an internal error.
1292
1293 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
1294
1295 PR fortran/107424
1296 * trans-openmp.cc (struct dovar_init_d): Add 'sym' and
1297 'non_unit_incr' members.
1298 (gfc_nonrect_loop_expr): New.
1299 (gfc_trans_omp_do): Call it; use normal loop bounds
1300 for unit stride - and only create local loop var.
1301
1302 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
1303
1304 * parse.cc (decode_omp_directive): Really ignore 'assumes' with
1305 -fopenmp-simd.
1306
1307 2023-02-08 Steve Kargl <kargl@gcc.gnu.org>
1308
1309 PR fortran/103259
1310 * resolve.cc (resolve_common_vars): Avoid NULL pointer dereference
1311 when a symbol's location is not set.
1312
1313 2023-02-07 Harald Anlauf <anlauf@gmx.de>
1314
1315 PR fortran/95107
1316 * trans-decl.cc (gfc_finish_var_decl): With -fno-automatic, do not
1317 make ASSOCIATE variables TREE_STATIC.
1318
1319 2023-02-05 Harald Anlauf <anlauf@gmx.de>
1320
1321 PR fortran/108592
1322 * arith.cc (gfc_arith_divide): Emit integer division truncation
1323 warnings using gfc_warning instead of gfc_warning_now to prevent
1324 redundant messages.
1325
1326 2023-02-03 Jakub Jelinek <jakub@redhat.com>
1327
1328 PR fortran/108451
1329 * trans-decl.cc (gfc_trans_use_stmts): Call clear_slot before
1330 doing continue.
1331
1332 2023-02-01 Harald Anlauf <anlauf@gmx.de>
1333
1334 PR fortran/108609
1335 * expr.cc (find_array_section): Add check to prevent interpreting an
1336 mpz non-integer constant as an integer.
1337
1338 2023-02-01 Tobias Burnus <tobias@codesourcery.com>
1339
1340 * openmp.cc (resolve_omp_clauses): Check also for
1341 power of two.
1342
1343 2023-01-29 Mikael Morin <mikael@gcc.gnu.org>
1344
1345 PR fortran/108450
1346 * check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
1347 (gfc_check_findloc): Ditto.
1348
1349 2023-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1350
1351 PR fortran/103506
1352 * parse.cc (parse_module): Remove use of a bool error value
1353 that prevented proper setting of the namespace pointer.
1354
1355 2023-01-28 Harald Anlauf <anlauf@gmx.de>
1356 Steven G. Kargl <kargl@gcc.gnu.org>
1357
1358 PR fortran/108527
1359 * resolve.cc (compare_bound_int): Expression to compare must be of
1360 type INTEGER.
1361 (compare_bound_mpz_t): Likewise.
1362 (check_dimension): Fix comment on checks applied to array section
1363 and clean up associated logic.
1364
1365 2023-01-28 Harald Anlauf <anlauf@gmx.de>
1366
1367 PR fortran/108453
1368 * match.cc (gfc_match_common): A USE associated name shall not appear
1369 in a COMMON block (F2018:C8121).
1370
1371 2023-01-27 Tobias Burnus <tobias@codesourcery.com>
1372
1373 PR fortran/108558
1374 * trans-openmp.cc (gfc_split_omp_clauses): Handle has_device_addr.
1375
1376 2023-01-26 Harald Anlauf <anlauf@gmx.de>
1377
1378 PR fortran/108544
1379 * resolve.cc (check_host_association): Extend host association check
1380 so that it is not restricted to functions. Also prevent NULL pointer
1381 dereference.
1382
1383 2023-01-25 Steve Kargl <kargl@gcc.gnu.org>
1384
1385 PR fortran/108528
1386 * array.cc (compare_bounds): Return false instead of generating an
1387 internal error on an invalid argument type.
1388
1389 2023-01-24 Harald Anlauf <anlauf@gmx.de>
1390
1391 PR fortran/108529
1392 * simplify.cc (simplify_transformation): Do not try to simplify
1393 transformational intrinsic when the ARRAY argument has a NULL shape.
1394
1395 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1396
1397 PR fortran/108502
1398 * dependency.cc (gfc_check_dependency): Prevent NULL pointer
1399 dereference while recursively checking expressions.
1400
1401 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1402
1403 PR fortran/108501
1404 * interface.cc (get_expr_storage_size): Check array subscript triplets
1405 that we actually have integer values before trying to extract with
1406 mpz_get_si.
1407
1408 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1409
1410 PR fortran/108420
1411 * iresolve.cc (check_charlen_present): Preserve character length if
1412 there is no array constructor.
1413
1414 2023-01-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1415
1416 PR fortran/102595
1417 * data.cc (gfc_assign_data_value): Remove check for PARAMETER in DATA.
1418 * primary.cc (match_variable): Add check for PARAMETER in DATA.
1419
1420 2023-01-19 Harald Anlauf <anlauf@gmx.de>
1421
1422 PR fortran/108434
1423 * expr.cc (class_allocatable): Prevent NULL pointer dereference
1424 or invalid read.
1425 (class_pointer): Likewise.
1426
1427 2023-01-17 Harald Anlauf <anlauf@gmx.de>
1428
1429 PR fortran/108421
1430 * interface.cc (get_expr_storage_size): Check that we actually have
1431 an integer value before trying to extract it with mpz_get_si.
1432
1433 2023-01-12 Tobias Burnus <tobias@codesourcery.com>
1434
1435 PR fortran/107706
1436 * openmp.cc (gfc_resolve_omp_assumptions): Reject nonscalars.
1437
1438 2023-01-11 Jakub Jelinek <jakub@redhat.com>
1439
1440 PR fortran/108349
1441 * f95-lang.cc (gfc_init_builtin_function): Fix up function types
1442 for BUILT_IN_REALLOC and BUILT_IN_SINCOS{F,,L}. Formatting fixes.
1443
1444 2023-01-10 Harald Anlauf <anlauf@gmx.de>
1445
1446 PR fortran/97345
1447 * frontend-passes.cc (do_subscript): Clear used gmp variables.
1448
1449 2023-01-02 Jakub Jelinek <jakub@redhat.com>
1450
1451 * gfortranspec.cc (lang_specific_driver): Update copyright notice
1452 dates.
1453 * gfc-internals.texi: Bump @copying's copyright year.
1454 * gfortran.texi: Ditto.
1455 * intrinsic.texi: Ditto.
1456 * invoke.texi: Ditto.
1457
1458 \f
1459 Copyright (C) 2023 Free Software Foundation, Inc.
1460
1461 Copying and distribution of this file, with or without modification,
1462 are permitted in any medium without royalty provided the copyright
1463 notice and this notice are preserved.