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