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