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