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