]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/fortran/ChangeLog
Daily bump.
[thirdparty/gcc.git] / gcc / fortran / ChangeLog
1 2023-11-26 Harald Anlauf <anlauf@gmx.de>
2
3 PR fortran/111880
4 * resolve.cc (resolve_common_vars): Do not call gfc_add_in_common
5 for symbols that are USE associated or used in a submodule.
6
7 2023-11-24 Tobias Burnus <tobias@codesourcery.com>
8
9 * lang.opt (Wopenmp): Add, enabled by dafault and documented in C.
10 * openmp.cc (gfc_match_omp_declare_target, resolve_positive_int_expr,
11 resolve_nonnegative_int_expr, resolve_omp_clauses,
12 gfc_resolve_omp_do_blocks): Use OPT_Wopenmp with gfc_warning{,_now}.
13
14 2023-11-24 Tobias Burnus <tobias@codesourcery.com>
15
16 * openmp.cc (gfc_match_omp_depobj): Accept optionally an argument
17 to the destroy clause.
18
19 2023-11-23 Harald Anlauf <anlauf@gmx.de>
20
21 PR fortran/112609
22 * check.cc (gfc_check_system_clock): Add checks on integer arguments
23 to SYSTEM_CLOCK specific to F2023.
24 * error.cc (notify_std_msg): Adjust to handle new features added
25 in F2023.
26 * gfortran.texi (_gfortran_set_options): Document GFC_STD_F2023_DEL,
27 remove obsolete option GFC_STD_F2008_TS and fix enumeration values.
28 * libgfortran.h (GFC_STD_F2023_DEL): Add and use in GFC_STD_OPT_F23.
29 * options.cc (set_default_std_flags): Add GFC_STD_F2023_DEL.
30
31 2023-11-17 Tobias Burnus <tobias@codesourcery.com>
32
33 * gfortran.texi (_gfortran_set_options): Document GFC_STD_F2023.
34 * invoke.texi (std,pedantic,Wampersand,Wtabs): Add -std=2023.
35 * lang.opt (std=f2023): Add.
36 * libgfortran.h (GFC_STD_F2023, GFC_STD_OPT_F23): Add.
37 * options.cc (set_default_std_flags): Add GFC_STD_F2023.
38 (gfc_init_options): Set max_continue_free to 1,000,000.
39 (gfc_post_options): Set flag_free_line_length if unset.
40 (gfc_handle_option): Add OPT_std_f2023, set max_continue_free = 255
41 for -std=f2003, f2008 and f2018.
42
43 2023-11-14 David Malcolm <dmalcolm@redhat.com>
44
45 * error.cc (gfc_diagnostics_init): Use diagnostic_start_span.
46
47 2023-11-07 Joseph Myers <joseph@codesourcery.com>
48
49 * gfortran.h (gfc_real_info): Refer to C23 instead of C2X in
50 comment.
51
52 2023-11-06 Martin Jambor <mjambor@suse.cz>
53
54 * trans-decl.cc (gfc_build_builtin_function_decls): Fix fnspec of
55 generate_error.
56
57 2023-11-04 David Malcolm <dmalcolm@redhat.com>
58
59 * cpp.cc: Update for changes to diagnostic_context.
60 * error.cc: Likewise.
61 * options.cc: Likewise.
62
63 2023-11-03 Harald Anlauf <anlauf@gmx.de>
64
65 PR fortran/97245
66 * match.cc (gfc_match_call): If a procedure pointer has already been
67 resolved, do not create a new symbol in a procedure reference of
68 the same name shadowing the first one if it is host-associated.
69
70 2023-11-03 Harald Anlauf <anlauf@gmx.de>
71
72 PR fortran/92887
73 * trans-expr.cc (conv_cond_temp): Helper function for creation of a
74 conditional temporary.
75 (gfc_conv_procedure_call): Handle passing of allocatable or pointer
76 actual argument to dummy with OPTIONAL + VALUE attribute. Actual
77 arguments that are not allocated or associated are treated as not
78 present.
79
80 2023-11-03 Paul Thomas <pault@gcc.gnu.org>
81
82 PR fortran/98498
83 * interface.cc (upoly_ok): Defined operators using unlimited
84 polymorphic formal arguments must not override the intrinsic
85 operator use.
86
87 2023-11-02 Paul Thomas <pault@gcc.gnu.org>
88
89 PR fortran/112316
90 * parse.cc (parse_associate): Remove condition that caused this
91 regression.
92
93 2023-10-30 Paul Thomas <pault@gcc.gnu.org>
94
95 PR fortran/104555
96 * resolve.cc (resolve_select_type): If the selector expression
97 has no class component references and the expression is a
98 derived type, copy the typespec of the symbol to that of the
99 expression.
100
101 2023-10-27 Harald Anlauf <anlauf@gmx.de>
102 Steven G. Kargl <kargl@gcc.gnu.org>
103
104 PR fortran/104649
105 * decl.cc (gfc_match_formal_arglist): Handle conflicting declarations
106 of a MODULE PROCEDURE when one of the declarations is an alternate
107 return.
108
109 2023-10-27 Paul Thomas <pault@gcc.gnu.org>
110
111 PR fortran/104625
112 * expr.cc (gfc_check_vardef_context): Check that the target
113 does have a vector index before emitting the specific error.
114 * match.cc (copy_ts_from_selector_to_associate): Ensure that
115 class valued operator expressions set the selector rank and
116 use the rank to provide the associate variable with an
117 appropriate array spec.
118 * resolve.cc (resolve_operator): Reduce stacked parentheses to
119 a single pair.
120 (fixup_array_ref): Extract selector symbol from parentheses.
121
122 2023-10-26 Paul-Antoine Arras <pa@codesourcery.com>
123 Tobias Burnus <tobias@codesourcery.com>
124
125 * interface.cc (gfc_compare_types): Return true if one type is C_PTR
126 and the other is a compatible INTEGER(8).
127 * misc.cc (gfc_typename): Handle the case where an INTEGER(8) actually
128 holds a TYPE(C_PTR).
129
130 2023-10-25 Thomas Schwinge <thomas@codesourcery.com>
131
132 * openmp.cc (omp_mask2): Split 'OMP_CLAUSE_HOST_SELF' into
133 'OMP_CLAUSE_SELF', 'OMP_CLAUSE_HOST'.
134 (gfc_match_omp_clauses, OACC_UPDATE_CLAUSES): Adjust.
135
136 2023-10-25 Chung-Lin Tang <cltang@codesourcery.com>
137
138 * gfortran.h (typedef struct gfc_omp_clauses): Add self_expr field.
139 * openmp.cc (enum omp_mask2): Add OMP_CLAUSE_SELF.
140 (gfc_match_omp_clauses): Add handling for OMP_CLAUSE_SELF.
141 (OACC_PARALLEL_CLAUSES): Add OMP_CLAUSE_SELF.
142 (OACC_KERNELS_CLAUSES): Likewise.
143 (OACC_SERIAL_CLAUSES): Likewise.
144 (resolve_omp_clauses): Add handling for omp_clauses->self_expr.
145 * trans-openmp.cc (gfc_trans_omp_clauses): Add handling of
146 clauses->self_expr and building of OMP_CLAUSE_SELF tree clause.
147 (gfc_split_omp_clauses): Add handling of self_expr field copy.
148
149 2023-10-25 Thomas Schwinge <thomas@codesourcery.com>
150
151 * dump-parse-tree.cc (show_omp_clauses): Group handling of 'if'
152 clause without and with modifier.
153 * frontend-passes.cc (gfc_code_walker): Likewise.
154 * gfortran.h (gfc_omp_clauses): Likewise.
155 * openmp.cc (gfc_free_omp_clauses): Likewise.
156
157 2023-10-18 Tobias Burnus <tobias@codesourcery.com>
158
159 * intrinsic.texi (signal): Add 'intrinsic :: signal, sleep' to
160 the example to make it safer.
161
162 2023-10-17 Harald Anlauf <anlauf@gmx.de>
163
164 PR fortran/111837
165 * frontend-passes.cc (traverse_io_block): Dependency check of loop
166 nest shall be triangular, not banded.
167
168 2023-10-17 Tobias Burnus <tobias@codesourcery.com>
169
170 * intrinsic.texi (signal): Mention that the argument
171 passed to the signal handler procedure is passed by reference.
172 Extend example.
173
174 2023-10-15 Tobias Burnus <tobias@codesourcery.com>
175
176 * scanner.cc (skip_free_comments, skip_fixed_comments): Remove
177 leftover 'OpenACC' from comments about OpenMP's conditional
178 compilation sentinel.
179
180 2023-10-14 Tobias Burnus <tobias@codesourcery.com>
181
182 * gfortran.h (ext_attr_t): Add omp_allocate flag.
183 * match.cc (gfc_free_omp_namelist): Void deleting same
184 u2.allocator multiple times now that a sequence can use
185 the same one.
186 * openmp.cc (gfc_match_omp_clauses, gfc_match_omp_allocate): Use
187 same allocator expr multiple times.
188 (is_predefined_allocator): Make static.
189 (gfc_resolve_omp_allocate): Update/extend restriction checks;
190 remove sorry message.
191 (resolve_omp_clauses): Reject corarrays in allocate/allocators
192 directive.
193 * parse.cc (check_omp_allocate_stmt): Permit procedure pointers
194 here (rejected later) for less misleading diagnostic.
195 * trans-array.cc (gfc_trans_auto_array_allocation): Propagate
196 size for GOMP_alloc and location to which it should be added to.
197 * trans-decl.cc (gfc_trans_deferred_vars): Handle 'omp allocate'
198 for stack variables; sorry for static variables/common blocks.
199 * trans-openmp.cc (gfc_trans_omp_clauses): Evaluate 'allocate'
200 clause's allocator only once; fix adding expressions to the
201 block.
202 (gfc_trans_omp_single): Pass a block to gfc_trans_omp_clauses.
203
204 2023-10-13 Harald Anlauf <anlauf@gmx.de>
205
206 PR fortran/104351
207 * decl.cc (get_proc_name): Extend name conflict detection between
208 internal procedure and previous declaration also to derived type.
209
210 2023-10-13 Harald Anlauf <anlauf@gmx.de>
211
212 PR fortran/110957
213 * invoke.texi: Update documentation to reflect '-ffpe-trap=none'.
214 * options.cc (gfc_handle_fpe_option): Fix mixup up of error messages
215 for options -ffpe-trap and -ffpe-summary. Accept '-ffpe-trap=none'
216 to clear FPU traps previously set on command line.
217
218 2023-10-13 Richard Biener <rguenther@suse.de>
219
220 PR tree-optimization/111779
221 * trans-expr.cc (gfc_trans_assignment_1): Initialize
222 lhs_caf_attr and rhs_caf_attr codimension flag to avoid
223 false positive -Wuninitialized.
224
225 2023-10-12 Paul Thomas <pault@gcc.gnu.org>
226
227 PR fortran/67740
228 * trans-expr.cc (gfc_trans_pointer_assignment): Set the hidden
229 string length component for pointer assignment to character
230 pointer components.
231
232 2023-10-08 Tobias Burnus <tobias@codesourcery.com>
233
234 * parse.cc (parse_omp_structured_block): Make the user code end
235 up inside of BLOCK construct for strictly structured blocks;
236 fix fallout for 'section' and 'teams'.
237 * openmp.cc (resolve_omp_target): Fix changed BLOCK handling
238 for teams in target checking.
239
240 2023-10-04 Paul Thomas <pault@gcc.gnu.org>
241
242 PR fortran/37336
243 PR fortran/111674
244 * trans-expr.cc (gfc_trans_scalar_assign): Finalize components
245 on deallocation if derived type is not finalizable.
246
247 2023-10-03 David Malcolm <dmalcolm@redhat.com>
248
249 * error.cc (gfc_format_decoder): Update for "m_" prefixes to
250 text_info fields.
251
252 2023-10-02 David Malcolm <dmalcolm@redhat.com>
253
254 * error.cc (gfc_diagnostics_init): Update for change to start_span.
255
256 2023-10-02 David Malcolm <dmalcolm@redhat.com>
257
258 * error.cc (gfc_diagnostic_starter): Update for reorganization of
259 source-printing fields of diagnostic_context.
260 (gfc_diagnostics_init): Likewise.
261 (gfc_diagnostics_finish): Likewise.
262
263 2023-09-29 Andre Vehreschild <vehre@gcc.gnu.org>
264
265 PR fortran/37336
266 * trans-array.cc (structure_alloc_comps): Deref coarray.
267 (gfc_trans_deferred_array): Add freeing of components after
268 check for allocated coarray.
269
270 2023-09-24 Paul Thomas <pault@gcc.gnu.org>
271
272 PR fortran/68155
273 PR fortran/111271
274 * decl.cc (fix_initializer_charlen): New function broken out of
275 add_init_expr_to_sym.
276 (add_init_expr_to_sym, build_struct): Call the new function.
277 * trans-expr.cc (gfc_conv_intrinsic_to_class): Remove repeated
278 condition.
279
280 2023-09-23 Harald Anlauf <anlauf@gmx.de>
281
282 PR fortran/95710
283 * class.cc (gfc_build_class_symbol): Do not try to build class
284 container for invalid typespec.
285 * resolve.cc (resolve_fl_var_and_proc): Prevent NULL pointer
286 dereference.
287 (resolve_symbol): Likewise.
288
289 2023-09-19 Harald Anlauf <anlauf@gmx.de>
290
291 PR fortran/70231
292 * trans-array.cc (trans_array_constructor): In absence of a typespec,
293 use string length determined by get_array_ctor_strlen() to reasonably
294 initialize auxiliary variable for bounds-checking.
295
296 2023-09-15 Harald Anlauf <anlauf@gmx.de>
297
298 PR fortran/30802
299 * trans-array.cc (trans_array_bound_check): Add optional argument
300 COMPNAME for explicit specification of array component name.
301 (array_bound_check_elemental): Helper function for generating
302 bounds-checking code for elemental dimensions.
303 (gfc_conv_expr_descriptor): Use bounds-checking also for elemental
304 dimensions, i.e. those not handled by the scalarizer.
305
306 2023-09-15 Mikael Morin <mikael@gcc.gnu.org>
307
308 PR fortran/108957
309 * gfortran.h (gfc_symbol): Add comment documenting reference counting.
310 * parse.cc (parse_interface): Remove reference count incrementation.
311
312 2023-09-12 Mikael Morin <mikael@gcc.gnu.org>
313
314 PR fortran/110996
315 * gfortran.h (gfc_release_symbol): Set return type to bool.
316 * symbol.cc (gfc_release_symbol): Ditto. Return whether symbol was
317 freed.
318 (delete_symbol_from_ns): New, outline code from...
319 (gfc_restore_last_undo_checkpoint): ... here. Delete new symbols
320 from two more namespaces.
321
322 2023-09-09 Mikael Morin <mikael@gcc.gnu.org>
323
324 * bbt.cc (delete_treap): Add argument REMOVED, set it to the removed
325 element from the tree. Change NULL to nullptr.
326 (gfc_delete_bbt): Return the removed element from the tree.
327 * gfortran.h (gfc_delete_symtree): Remove prototype.
328 (gfc_delete_bbt): Set return type to pointer.
329 * symbol.cc (gfc_delete_symtree): Make static. Get the element to be
330 freed from the result of gfc_delete_bbt. Remove the preliminary walk to
331 get it.
332
333 2023-09-01 Harald Anlauf <anlauf@gmx.de>
334
335 PR fortran/31059
336 * trans-array.cc (gfc_conv_ss_startstride): For array bounds checking,
337 consider also array constructors in expressions, and use their shape.
338
339 2023-08-31 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
340
341 * gfortran.texi: Likewise.
342
343 2023-08-30 Mikael Morin <mikael@gcc.gnu.org>
344
345 PR fortran/48776
346 * gfortran.h (gfc_drop_interface_elements_before): New prototype.
347 (gfc_current_interface_head): Return a reference to the pointer.
348 * interface.cc (gfc_current_interface_head): Ditto.
349 (free_interface_elements_until): New function, generalizing
350 gfc_free_interface.
351 (gfc_free_interface): Use free_interface_elements_until.
352 (gfc_drop_interface_elements_before): New function.
353 * parse.cc
354 (current_interface_ptr, previous_interface_head): New static variables.
355 (current_interface_valid_p, get_current_interface_ptr): New functions.
356 (decode_statement): Initialize previous_interface_head.
357 (reject_statement): Restore current interface pointer to point to
358 previous_interface_head.
359
360 2023-08-26 Paul Thomas <pault@gcc.gnu.org>
361
362 PR fortran/92586
363 * trans-expr.cc (gfc_trans_arrayfunc_assign): Supply a missing
364 dereference for the call to gfc_deallocate_alloc_comp_no_caf.
365
366 2023-08-25 Sandra Loosemore <sandra@codesourcery.com>
367
368 * gfortran.h (struct gfc_namespace): Add omp_structured_block bit.
369 * openmp.cc: Include omp-api.h.
370 (resolve_omp_clauses): Consolidate inscan reduction clause conflict
371 checking here.
372 (find_nested_loop_in_chain): New.
373 (find_nested_loop_in_block): New.
374 (gfc_resolve_omp_do_blocks): Set omp_current_do_collapse properly.
375 Handle imperfectly-nested loops when looking for nested omp scan.
376 Refactor to move inscan reduction clause conflict checking to
377 resolve_omp_clauses.
378 (gfc_resolve_do_iterator): Handle imperfectly-nested loops.
379 (struct icode_error_state): New.
380 (icode_code_error_callback): New.
381 (icode_expr_error_callback): New.
382 (diagnose_intervening_code_errors_1): New.
383 (diagnose_intervening_code_errors): New.
384 (make_structured_block): New.
385 (restructure_intervening_code): New.
386 (is_outer_iteration_variable): Do not assume loops are perfectly
387 nested.
388 (check_nested_loop_in_chain): New.
389 (check_nested_loop_in_block_state): New.
390 (check_nested_loop_in_block_symbol): New.
391 (check_nested_loop_in_block): New.
392 (expr_uses_intervening_var): New.
393 (is_intervening_var): New.
394 (expr_is_invariant): Do not assume loops are perfectly nested.
395 (resolve_omp_do): Handle imperfectly-nested loops.
396 * trans-stmt.cc (gfc_trans_block_construct): Generate
397 OMP_STRUCTURED_BLOCK if magic bit is set on block namespace.
398
399 2023-08-25 Harald Anlauf <anlauf@gmx.de>
400
401 PR fortran/35095
402 * data.cc (get_array_index): Add bounds-checking code and return error
403 status. Overindexing will be allowed as an extension for -std=legacy
404 and generate an error in standard-conforming mode.
405 (gfc_assign_data_value): Use error status from get_array_index for
406 graceful error recovery.
407
408 2023-08-25 Uros Bizjak <ubizjak@gmail.com>
409
410 * match.cc (gfc_match_equivalence): Rename TRUE/FALSE to true/false.
411 * module.cc (check_access): Ditto.
412 * primary.cc (match_real_constant): Ditto.
413 * trans-array.cc (gfc_trans_allocate_array_storage): Ditto.
414 (get_array_ctor_strlen): Ditto.
415 * trans-common.cc (find_equivalence): Ditto.
416 (add_equivalences): Ditto.
417
418 2023-08-23 Harald Anlauf <anlauf@gmx.de>
419
420 PR fortran/32986
421 * resolve.cc (is_non_constant_shape_array): Add forward declaration.
422 (resolve_common_vars): Diagnose automatic array object in COMMON.
423 (resolve_symbol): Prevent confusing follow-on error.
424
425 2023-08-22 Tobias Burnus <tobias@codesourcery.com>
426
427 * gfortran.h (enum gfc_omp_defaultmap_category):
428 Add OMP_DEFAULTMAP_CAT_ALL.
429 * openmp.cc (gfc_match_omp_clauses): Parse
430 'all' as category.
431 * trans-openmp.cc (gfc_trans_omp_clauses): Handle it.
432
433 2023-08-22 Harald Anlauf <anlauf@gmx.de>
434
435 PR fortran/49588
436 * data.cc (gfc_advance_section): Derive next index set and next offset
437 into DATA variable also for array references using vector sections.
438 Use auxiliary array to keep track of offsets into indexing vectors.
439 (gfc_get_section_index): Set up initial indices also for DATA variables
440 with array references using vector sections.
441 * data.h (gfc_get_section_index): Adjust prototype.
442 (gfc_advance_section): Likewise.
443 * resolve.cc (check_data_variable): Pass vector offsets.
444
445 2023-08-16 Harald Anlauf <anlauf@gmx.de>
446
447 PR fortran/110360
448 * trans-expr.cc (conv_scalar_char_value): Use gfc_replace_expr to
449 avoid leaking replaced gfc_expr.
450
451 2023-08-15 Martin Jambor <mjambor@suse.cz>
452 Harald Anlauf <anlauf@gmx.de>
453
454 PR fortran/110677
455 * resolve.cc (resolve_structure_cons): Check comp->ts is character
456 type before accessing stuff through comp->ts.u.cl.
457
458 2023-08-15 Chung-Lin Tang <cltang@codesourcery.com>
459 Thomas Schwinge <thomas@codesourcery.com>
460
461 * openmp.cc (OACC_DATA_CLAUSES): Add OMP_CLAUSE_DEFAULT.
462
463 2023-08-14 Mikael Morin <mikael@gcc.gnu.org>
464
465 PR fortran/110360
466 PR fortran/110419
467 * trans-types.cc (gfc_sym_type): Use a bare character type for length
468 one value character dummy arguments.
469 * trans-expr.cc (gfc_conv_string_parameter): Handle single character
470 case.
471 (gfc_conv_procedure_call): Don't exclude interoperable kinds
472 from single character handling. For single character dummy arguments,
473 extend the existing handling of non-constant expressions to constant
474 expressions.
475
476 2023-08-14 Mikael Morin <mikael@gcc.gnu.org>
477
478 * gfortran.h (gfc_length_one_character_type_p): New inline
479 function.
480 * check.cc (is_c_interoperable): Use
481 gfc_length_one_character_type_p.
482 * decl.cc (verify_bind_c_sym): Same.
483 * trans-expr.cc (gfc_conv_procedure_call): Same.
484
485 2023-08-09 Steve Kargl <sgk@troutmask.apl.washington.edu>
486
487 PR fortran/109684
488 * resolve.cc (resolve_types): Exclude contained procedures with
489 the artificial attribute from test for pureness.
490
491 2023-07-31 Chung-Lin Tang <cltang@codesourcery.com>
492
493 * openmp.cc (resolve_omp_clauses): Add checking requiring
494 OpenACC host_data construct to have an use_device clause.
495
496 2023-07-28 Harald Anlauf <anlauf@gmx.de>
497
498 PR fortran/110825
499 * gfortran.texi: Clarify argument passing convention.
500 * trans-expr.cc (gfc_conv_procedure_call): Do not pass the character
501 length as hidden argument when the declared dummy argument is
502 assumed-type.
503
504 2023-07-27 Tobias Burnus <tobias@codesourcery.com>
505
506 * openmp.cc (resolve_omp_target): Minor cleanup.
507 * parse.cc (decode_omp_directive): Find TARGET statement
508 also higher in the stack.
509
510 2023-07-26 Harald Anlauf <anlauf@gmx.de>
511
512 PR fortran/68569
513 * resolve.cc (check_data_variable): Do not accept strings with
514 deferred length or non-constant length in a DATA statement.
515 Reject also substrings of string variables of non-constant length.
516
517 2023-07-25 Tobias Burnus <tobias@codesourcery.com>
518
519 PR fortran/110725
520 PR middle-end/71065
521 * gfortran.h (gfc_omp_clauses): Add target_first_st_is_teams.
522 * parse.cc (parse_omp_structured_block): Set it if the first
523 statement in the structured block of a TARGET is TEAMS or
524 a combined/composite starting with TEAMS.
525 * openmp.cc (resolve_omp_target): Also show an error for
526 contains_teams_construct without target_first_st_is_teams.
527
528 2023-07-24 Tobias Burnus <tobias@codesourcery.com>
529
530 PR fortran/110725
531 PR middle-end/71065
532 * gfortran.h (gfc_omp_clauses): Add contains_teams_construct.
533 * openmp.cc (resolve_omp_target): New; check for teams nesting.
534 (gfc_resolve_omp_directive): Call it.
535 * parse.cc (decode_omp_directive): Set contains_teams_construct
536 on enclosing ST_OMP_TARGET.
537
538 2023-07-20 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
539
540 * trans-intrinsic.cc (conv_intrinsic_ieee_comparison): Only
541 define it once.
542
543 2023-07-20 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
544
545 * f95-lang.cc (gfc_init_builtin_functions): Add __builtin_iseqsig.
546 * trans-intrinsic.cc (conv_intrinsic_ieee_comparison): New
547 function.
548 (gfc_conv_ieee_arithmetic_function): Handle IEEE comparisons.
549
550 2023-07-19 Tobias Burnus <tobias@codesourcery.com>
551
552 PR fortran/107424
553 * trans-openmp.cc (gfc_nonrect_loop_expr): Accept all
554 constant loop steps.
555 (gfc_trans_omp_do): Likewise; use sign to determine
556 loop direction.
557
558 2023-07-17 Harald Anlauf <anlauf@gmx.de>
559
560 PR fortran/95947
561 PR fortran/110658
562 * trans-expr.cc (gfc_conv_procedure_call): For intrinsic procedures
563 whose result characteristics depends on the first argument and which
564 can be of type character, the character length will not be deferred.
565
566 2023-07-17 Tobias Burnus <tobias@codesoucery.com>
567 Chung-Lin Tang <cltang@codesourcery.com>
568
569 * dump-parse-tree.cc (show_omp_namelist, show_omp_clauses): Dump
570 uses_allocators clause.
571 * gfortran.h (gfc_free_omp_namelist): Add memspace_sym to u union
572 and traits_sym to u2 union.
573 (OMP_LIST_USES_ALLOCATORS): New enum value.
574 (gfc_free_omp_namelist): Add 'bool free_mem_traits_space' arg.
575 * match.cc (gfc_free_omp_namelist): Likewise.
576 * openmp.cc (gfc_free_omp_clauses, gfc_match_omp_variable_list,
577 gfc_match_omp_to_link, gfc_match_omp_doacross_sink,
578 gfc_match_omp_clause_reduction, gfc_match_omp_allocate,
579 gfc_match_omp_flush): Update call.
580 (gfc_match_omp_clauses): Likewise. Parse uses_allocators clause.
581 (gfc_match_omp_clause_uses_allocators): New.
582 (enum omp_mask2): Add new OMP_CLAUSE_USES_ALLOCATORS.
583 (OMP_TARGET_CLAUSES): Accept it.
584 (resolve_omp_clauses): Resolve uses_allocators clause
585 * st.cc (gfc_free_statement): Update gfc_free_omp_namelist call.
586 * trans-openmp.cc (gfc_trans_omp_clauses): Handle
587 OMP_LIST_USES_ALLOCATORS; fail with sorry unless predefined allocator.
588 (gfc_split_omp_clauses): Handle uses_allocators.
589
590 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
591
592 PR fortran/110618
593 * trans.h (gfc_deallocate_with_status): Add class container
594 argument.
595 (gfc_deallocate_scalar_with_status): Ditto.
596 * trans.cc (gfc_deallocate_with_status): Add class container
597 argument and pass it down to gfc_add_finalize_call.
598 (gfc_deallocate_scalar_with_status): Same.
599 * trans-array.cc (structure_alloc_comps): Update caller.
600 * trans-stmt.cc (gfc_trans_deallocate): Ditto.
601 * trans-expr.cc (gfc_conv_procedure_call): Ditto. Pass
602 pre-evaluated class container argument if it's available.
603
604 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
605
606 PR fortran/110618
607 * trans.h (gfc_add_finalizer_call): Add class container argument.
608 * trans.cc (gfc_add_finalizer_call): Ditto. Pass down new
609 argument to get_final_proc_ref, get_elem_size, get_var_desc,
610 and get_vptr.
611 (get_elem_size): Add class container argument.
612 Use provided class container if it's available.
613 (get_var_descr): Same.
614 (get_vptr): Same.
615 (get_final_proc_ref): Same. Add boolean telling the class
616 container argument is used. Set it. Don't try to use
617 final_wrapper if class container argument was used.
618
619 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
620
621 * trans.cc (get_var_descr): Factor scalar descriptor generation.
622
623 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
624
625 * trans.cc (get_vptr): New function.
626 (gfc_add_finalizer_call): Move virtual table pointer evaluation
627 to get_vptr.
628
629 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
630
631 * trans.cc (get_var_descr): Remove argument ts. Use var->ts
632 instead.
633 (gfc_add_finalizer_call): Update caller.
634
635 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
636
637 * trans.cc (gfc_add_finalizer_call): Inline definition of
638 variable has_finalizer. Merge nested conditions.
639
640 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
641
642 * trans.cc (gfc_add_finalizer_call): Remove local variable
643 final_expr. Pass down expr to get_final_proc_ref and move
644 final procedure expression generation down to its one usage
645 in get_final_proc_ref.
646 (get_final_proc_ref): Add argument expr. Remove argument
647 final_wrapper. Recreate final_wrapper from expr.
648
649 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
650
651 * trans.cc (gfc_add_finalizer_call): Remove local variable
652 elem_size. Pass expression to get_elem_size and move the
653 element size expression generation close to its usage there.
654 (get_elem_size): Add argument expr, remove class_size argument
655 and rebuild it from expr. Remove ts argument and use the
656 type of expr instead.
657
658 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
659
660 * trans.cc (gfc_add_finalizer_call): Move pre and post code for
661 the final procedure pointer expression to the outer block.
662 Reuse the previously evaluated final procedure pointer
663 expression.
664
665 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
666
667 * trans.cc (gfc_add_finalizer_call): Add post code for desc_se
668 after the finalizer call. Add post code for final_se and
669 size_se as well.
670
671 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
672
673 * trans.cc (gfc_build_final_call): Inline...
674 (gfc_add_finalizer_call): ... to its one caller.
675
676 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
677
678 * trans.cc (get_var_descr): New function.
679 (gfc_build_final_call): Outline the data reference descriptor
680 evaluation code to get_var_descr.
681
682 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
683
684 * trans.cc (get_elem_size): New function.
685 (gfc_build_final_call): Outline the element size evaluation
686 to get_elem_size.
687
688 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
689
690 * trans.cc (get_final_proc_ref): New function.
691 (gfc_build_final_call): Outline the pointer evaluation code
692 to get_final_proc_ref.
693
694 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
695
696 * trans.cc (gfc_build_final_call): Remove commented assertion.
697
698 2023-07-14 Mikael Morin <mikael@gcc.gnu.org>
699
700 PR fortran/92178
701 * trans.h (gfc_reset_vptr): Add class_container argument.
702 * trans-expr.cc (gfc_reset_vptr): Ditto. If a valid vptr can
703 be obtained through class_container argument, bypass evaluation
704 of e.
705 (gfc_conv_procedure_call): Wrap the argument evaluation code
706 in a conditional if the associated dummy is optional. Evaluate
707 the data reference to a pointer now, and replace later
708 references with usage of the pointer.
709
710 2023-07-14 Mikael Morin <mikael@gcc.gnu.org>
711
712 PR fortran/92178
713 * trans.h (struct gfc_se): New field class_container.
714 (struct gfc_ss_info): Ditto.
715 (gfc_evaluate_data_ref_now): New prototype.
716 * trans.cc (gfc_evaluate_data_ref_now): Implement it.
717 * trans-array.cc (gfc_conv_ss_descriptor): Copy class_container
718 field from gfc_se struct to gfc_ss_info struct.
719 (gfc_conv_expr_descriptor): Copy class_container field from
720 gfc_ss_info struct to gfc_se struct.
721 * trans-expr.cc (gfc_conv_class_to_class): Use class container
722 set in class_container field if available.
723 (gfc_conv_variable): Set class_container field on encountering
724 class variables or components, clear it on encountering
725 non-class components.
726 (gfc_conv_procedure_call): Evaluate data ref to a pointer now,
727 and replace later references by usage of the pointer.
728
729 2023-07-14 Mikael Morin <mikael@gcc.gnu.org>
730
731 PR fortran/92178
732 * trans-expr.cc (gfc_conv_procedure_call): Use a separate gfc_se
733 struct, initalized from parmse, to generate the class wrapper.
734 After the class wrapper code has been generated, copy it back
735 depending on whether parameter deallocation code has been
736 generated.
737
738 2023-07-13 Mikael Morin <mikael@gcc.gnu.org>
739
740 PR fortran/106050
741 * symbol.cc (gfc_restore_last_undo_checkpoint): Release symbols
742 in reverse order.
743
744 2023-07-12 Andre Vehreschild <vehre@gcc.gnu.org>
745
746 PR fortran/102003
747 * expr.cc (find_inquiry_ref): Replace len of pdt_string by
748 constant.
749 (simplify_ref_chain): Ensure input to find_inquiry_ref is
750 NULL.
751 (gfc_match_init_expr): Prevent PDT analysis for function calls.
752 (gfc_pdt_find_component_copy_initializer): Get the initializer
753 value for given component.
754 * gfortran.h (gfc_pdt_find_component_copy_initializer): New
755 function.
756 * simplify.cc (gfc_simplify_len): Replace len() of PDT with pdt
757 component ref or constant.
758
759 2023-07-11 Harald Anlauf <anlauf@gmx.de>
760
761 PR fortran/110288
762 * symbol.cc (gfc_copy_formal_args_intr): When deriving the formal
763 argument attributes from the actual ones for intrinsic procedure
764 calls, take special care of CHARACTER arguments that we do not
765 wrongly treat them formally as deferred-length.
766
767 2023-07-08 Steve Kargl <sgk@troutmask.apl.washington.edu>
768
769 PR fortran/99139
770 PR fortran/99368
771 * match.cc (gfc_match_namelist): Check for host associated or
772 defined types before applying default type.
773 (gfc_match_select_rank): Apply default type to selector of
774 unknown type if possible.
775 * resolve.cc (resolve_fl_variable): Do not apply local default
776 initialization to assumed rank entities.
777
778 2023-07-08 Harald Anlauf <anlauf@gmx.de>
779 Steven G. Kargl <kargl@gcc.gnu.org>
780
781 PR fortran/92178
782 * trans-expr.cc (gfc_conv_procedure_call): Check procedures for
783 allocatable dummy arguments with INTENT(OUT) and move deallocation
784 of actual arguments after evaluation of argument expressions before
785 the procedure is executed.
786
787 2023-07-08 Harald Anlauf <anlauf@gmx.de>
788
789 PR fortran/110585
790 * arith.cc (gfc_compare_expr): Handle equality comparison of constant
791 complex gfc_expr arguments.
792
793 2023-07-05 Robin Dapp <rdapp@ventanamicro.com>
794 Juzhe-Zhong <juzhe.zhong@rivai.ai>
795
796 * trans-types.cc (gfc_type_for_mode): Ditto.
797
798 2023-06-28 Harald Anlauf <anlauf@gmx.de>
799
800 PR fortran/110360
801 * trans-expr.cc (gfc_conv_procedure_call): For non-constant string
802 argument passed to CHARACTER(LEN=1),VALUE dummy, ensure proper
803 dereferencing and truncation of string to length 1.
804
805 2023-06-28 Paul Thomas <pault@gcc.gnu.org>
806
807 PR fortran/49213
808 * expr.cc (gfc_is_ptr_fcn): Remove reference to class_pointer.
809 * resolve.cc (resolve_assoc_var): Call gfc_is_ptr_fcn to allow
810 associate names with pointer function targets to be used in
811 variable definition context.
812 * trans-decl.cc (get_symbol_decl): Remove extraneous line.
813 * trans-expr.cc (alloc_scalar_allocatable_subcomponent): Obtain
814 size of intrinsic and character expressions.
815 (gfc_trans_subcomponent_assign): Expand assignment to class
816 components to include intrinsic and character expressions.
817
818 2023-06-24 Harald Anlauf <anlauf@gmx.de>
819
820 PR fortran/110360
821 * trans-expr.cc (gfc_conv_procedure_call): Truncate constant string
822 argument of length > 1 passed to scalar CHARACTER(1),VALUE dummy.
823
824 2023-06-23 Harald Anlauf <anlauf@gmx.de>
825
826 PR fortran/110360
827 * trans-expr.cc (gfc_conv_procedure_call): Pass actual argument
828 to scalar CHARACTER(1),VALUE dummy argument by value.
829
830 2023-06-21 Paul Thomas <pault@gcc.gnu.org>
831
832 PR fortran/87477
833 PR fortran/88688
834 PR fortran/94380
835 PR fortran/107900
836 PR fortran/110224
837 * decl.cc (char_len_param_value): Fix memory leak.
838 (resolve_block_construct): Remove unnecessary static decls.
839 * expr.cc (gfc_is_ptr_fcn): New function.
840 (gfc_check_vardef_context): Use it to permit pointer function
841 result selectors to be used for associate names in variable
842 definition context.
843 * gfortran.h: Prototype for gfc_is_ptr_fcn.
844 * match.cc (build_associate_name): New function.
845 (gfc_match_select_type): Use the new function to replace inline
846 version and to build a new associate name for the case where
847 the supplied associate name is already used for that purpose.
848 * resolve.cc (resolve_assoc_var): Call gfc_is_ptr_fcn to allow
849 associate names with pointer function targets to be used in
850 variable definition context.
851 * trans-decl.cc (gfc_get_symbol_decl): Unlimited polymorphic
852 variables need deferred initialisation of the vptr.
853 (gfc_trans_deferred_vars): Do the vptr initialisation.
854 * trans-stmt.cc (trans_associate_var): Ensure that a pointer
855 associate name points to the target of the selector and not
856 the selector itself.
857
858 2023-06-21 Paul Thomas <pault@gcc.gnu.org>
859
860 PR fortran/108961
861 * trans-expr.cc (gfc_conv_procedure_call): The hidden string
862 length must not be passed to a formal arg of type(cptr).
863
864 2023-06-20 Tobias Burnus <tobias@codesourcery.com>
865
866 * dump-parse-tree.cc (show_omp_namelist): Fix dump of the allocator
867 modifier of OMP_LIST_ALLOCATE.
868
869 2023-06-20 Tobias Burnus <tobias@codesourcery.com>
870
871 * match.cc (gfc_match_char): Match with '%S' a symbol
872 with host_assoc = 1.
873
874 2023-06-19 Tobias Burnus <tobias@codesourcery.com>
875
876 * intrinsic.texi (OpenMP Modules OMP_LIB and OMP_LIB_KINDS): Also
877 add references to the OpenMP 5.1 and 5.2 spec; add omp_initial_device
878 and omp_invalid_device named constants.
879
880 2023-06-13 Harald Anlauf <anlauf@gmx.de>
881 Mikael Morin <mikael@gcc.gnu.org>
882
883 PR fortran/86277
884 * trans-array.cc (gfc_trans_allocate_array_storage): When passing a
885 zero-sized array with fixed (= non-dynamic) size, allocate temporary
886 by the caller, not by the callee.
887
888 2023-06-10 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
889
890 * f95-lang.cc (gfc_init_builtin_functions): Add fmax() and
891 fmin() built-ins, and their variants.
892 * mathbuiltins.def: Add FMAX and FMIN built-ins.
893 * trans-intrinsic.cc (conv_intrinsic_ieee_minmax): New function.
894 (gfc_conv_ieee_arithmetic_function): Handle IEEE_MIN_NUM and
895 IEEE_MAX_NUM functions.
896
897 2023-06-09 Jakub Jelinek <jakub@redhat.com>
898
899 PR fortran/96024
900 * primary.cc (gfc_convert_to_structure_constructor): Only do
901 constant string ctor length verification and truncation/padding
902 if constant length has INTEGER type.
903
904 2023-06-08 Paul Thomas <pault@gcc.gnu.org>
905
906 PR fortran/87477
907 PR fortran/99350
908 PR fortran/107821
909 PR fortran/109451
910 * decl.cc (char_len_param_value): Simplify a copy of the expr
911 and replace the original if there is no error.
912 * gfortran.h : Remove the redundant field 'rankguessed' from
913 'gfc_association_list'.
914 * resolve.cc (resolve_assoc_var): Remove refs to 'rankguessed'.
915 (resolve_variable): Associate names with constant or structure
916 constructor targets cannot have array refs.
917 * trans-array.cc (gfc_conv_expr_descriptor): Guard expression
918 character length backend decl before using it. Suppress the
919 assignment if lhs equals rhs.
920 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
921 associate variables pointing to a variable. Add comment.
922 * trans-stmt.cc (trans_associate_var): Remove requirement that
923 the character length be deferred before assigning the value
924 returned by gfc_conv_expr_descriptor. Also, guard the backend
925 decl before testing with VAR_P.
926
927 2023-06-06 Kwok Cheung Yeung <kcy@codesourcery.com>
928 Tobias Burnus <tobias@codesourcery.com>
929
930 * dump-parse-tree.cc (show_omp_namelist): Display 'present' map
931 modifier.
932 (show_omp_clauses): Display 'present' motion modifier for 'to'
933 and 'from' clauses.
934 * gfortran.h (enum gfc_omp_map_op): Add entries with 'present'
935 modifiers.
936 (struct gfc_omp_namelist): Add 'present_modifer'.
937 * openmp.cc (gfc_match_motion_var_list): New, handles optional
938 'present' modifier for to/from clauses.
939 (gfc_match_omp_clauses): Call it for to/from clauses; parse 'present'
940 in defaultmap and map clauses.
941 (resolve_omp_clauses): Allow 'present' modifiers on 'target',
942 'target data', 'target enter' and 'target exit' directives.
943 * trans-openmp.cc (gfc_trans_omp_clauses): Apply 'present' modifiers
944 to tree node for 'map', 'to' and 'from' clauses. Apply 'present' for
945 defaultmap.
946
947 2023-06-02 Steve Kargl <kargl@gcc.gnu.org>
948
949 PR fortran/100607
950 * resolve.cc (resolve_select_rank): Remove duplicate error.
951 (resolve_fl_var_and_proc): Prevent NULL pointer dereference and
952 suppress error message for temporary.
953
954 2023-06-02 Paul Thomas <pault@gcc.gnu.org>
955
956 PR fortran/87477
957 * parse.cc (parse_associate): Replace the existing evaluation
958 of the target rank with calls to gfc_resolve_ref and
959 gfc_expression_rank. Identify untyped target function results
960 with structure constructors by finding the appropriate derived
961 type.
962 * resolve.cc (resolve_symbol): Allow associate variables to be
963 assumed shape.
964
965 2023-06-01 Harald Anlauf <anlauf@gmx.de>
966
967 PR fortran/88552
968 * decl.cc (gfc_match_kind_spec): Use error path on missing right
969 parenthesis.
970 (gfc_match_decl_type_spec): Use error return when an error occurred
971 during matching a KIND specifier.
972
973 2023-06-01 Tobias Burnus <tobias@codesourcery.com>
974
975 * parse.cc (decode_omp_directive): Accept all pure directives
976 inside a PURE procedures; handle 'error at(execution).
977
978 2023-05-26 Tobias Burnus <tobias@codesourcery.com>
979
980 * dump-parse-tree.cc (show_omp_namelist): Update allocator, fix
981 align dump.
982 (show_omp_node, show_code_node): Handle EXEC_OMP_ALLOCATE.
983 * gfortran.h (enum gfc_statement): Add ST_OMP_ALLOCATE and ..._EXEC.
984 (enum gfc_exec_op): Add EXEC_OMP_ALLOCATE.
985 (struct gfc_omp_namelist): Add 'allocator' to 'u2' union.
986 (struct gfc_namespace): Add omp_allocate.
987 (gfc_resolve_omp_allocate): New.
988 * match.cc (gfc_free_omp_namelist): Free 'u2.allocator'.
989 * match.h (gfc_match_omp_allocate, gfc_match_omp_allocators): New.
990 * openmp.cc (gfc_omp_directives): Uncomment allocate/allocators.
991 (gfc_match_omp_variable_list): Add bool arg for
992 rejecting listening common-block vars separately.
993 (gfc_match_omp_clauses): Update for u2.allocators.
994 (OMP_ALLOCATORS_CLAUSES, gfc_match_omp_allocate,
995 gfc_match_omp_allocators, is_predefined_allocator,
996 gfc_resolve_omp_allocate): New.
997 (resolve_omp_clauses): Update 'allocate' clause checks.
998 (omp_code_to_statement, gfc_resolve_omp_directive): Handle
999 OMP ALLOCATE/ALLOCATORS.
1000 * parse.cc (in_exec_part): New global var.
1001 (check_omp_allocate_stmt, parse_openmp_allocate_block): New.
1002 (decode_omp_directive, case_exec_markers, case_omp_decl,
1003 gfc_ascii_statement, parse_omp_structured_block): Handle
1004 OMP allocate/allocators.
1005 (verify_st_order, parse_executable): Set in_exec_part.
1006 * resolve.cc (gfc_resolve_blocks, resolve_codes): Handle
1007 allocate/allocators.
1008 * st.cc (gfc_free_statement): Likewise.
1009 * trans.cc (trans_code): Likewise.
1010 * trans-openmp.cc (gfc_trans_omp_directive): Likewise.
1011 (gfc_trans_omp_clauses, gfc_split_omp_clauses): Update for
1012 u2.allocator, fix for u.align.
1013
1014 2023-05-24 Harald Anlauf <anlauf@gmx.de>
1015
1016 PR fortran/104350
1017 * simplify.cc (simplify_size): Reject DIM argument of intrinsic SIZE
1018 with error when out of valid range.
1019
1020 2023-05-24 Harald Anlauf <anlauf@gmx.de>
1021
1022 PR fortran/103794
1023 * check.cc (gfc_check_reshape): Expand constant arguments SHAPE and
1024 ORDER before checking.
1025 * gfortran.h (gfc_is_constant_array_expr): Add prototype.
1026 * iresolve.cc (gfc_resolve_reshape): Expand constant argument SHAPE.
1027 * simplify.cc (is_constant_array_expr): If array is determined to be
1028 constant, expand small array constructors if needed.
1029 (gfc_is_constant_array_expr): Wrapper for is_constant_array_expr.
1030 (gfc_simplify_reshape): Fix check for insufficient elements in SOURCE
1031 when no padding specified.
1032
1033 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
1034
1035 PR fortran/103716
1036 * resolve.cc (gfc_resolve_ref): Conversion of array_ref into an
1037 element should be done for all characters without a len expr,
1038 not just deferred lens, and for integer expressions.
1039 * trans-expr.cc (conv_inquiry): For len and kind inquiry refs,
1040 set the se string_length to NULL_TREE.
1041
1042 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
1043 Steven G. Kargl <kargl@gcc.gnu.org>
1044
1045 PR fortran/97122
1046 * decl.cc (variable_decl): Clean up white space issues.
1047 (gfc_match_final_decl): Declaration of finalizable derived type
1048 is allowed in a submodule.
1049
1050 2023-05-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1051
1052 * expr.cc (gfc_get_corank): Use CLASS_DATA from gfortran.h.
1053 * resolve.cc (resolve_component): Same.
1054 (resolve_fl_derived0): Same.
1055 * simplify.cc (gfc_simplify_extends_type_of): Same.
1056 (simplify_cobound): Same.
1057
1058 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1059
1060 * trans-array.cc (is_pointer_array): Use _P() defines from tree.h.
1061 (gfc_conv_scalarized_array_ref): Ditto.
1062 (gfc_conv_array_ref): Ditto.
1063 * trans-decl.cc (gfc_finish_decl): Ditto.
1064 (gfc_get_symbol_decl): Ditto.
1065 * trans-expr.cc (gfc_trans_pointer_assignment): Ditto.
1066 (gfc_trans_arrayfunc_assign): Ditto.
1067 (gfc_trans_assignment_1): Ditto.
1068 * trans-intrinsic.cc (gfc_conv_intrinsic_minmax): Ditto.
1069 (conv_intrinsic_ieee_value): Ditto.
1070 * trans-io.cc (gfc_convert_array_to_string): Ditto.
1071 * trans-openmp.cc (gfc_omp_is_optional_argument): Ditto.
1072 (gfc_trans_omp_clauses): Ditto.
1073 * trans-stmt.cc (gfc_conv_label_variable): Ditto.
1074 * trans.cc (gfc_build_addr_expr): Ditto.
1075 (get_array_span): Ditto.
1076
1077 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1078
1079 PR fortran/78798
1080 * array.cc (compare_bounds): Use narrower return type.
1081 (gfc_compare_array_spec): Likewise.
1082 (is_constant_element): Likewise.
1083 (gfc_constant_ac): Likewise.
1084 * check.cc (dim_rank_check): Likewise.
1085 * cpp.cc (gfc_cpp_init_options): Likewise.
1086 (dump_macro): Likewise.
1087 * cpp.h (gfc_cpp_handle_option): Likewise.
1088 * dependency.cc (gfc_ref_needs_temporary_p): Likewise.
1089 (gfc_check_argument_dependency): Likewise.
1090 (gfc_check_fncall_dependency): Likewise.
1091 (ref_same_as_full_array): Likewise.
1092 * dependency.h (gfc_check_fncall_dependency): Likewise.
1093 (gfc_dep_resolver): Likewise.
1094 (gfc_are_equivalenced_arrays): Likewise.
1095 * expr.cc (gfc_copy_ref): Likewise.
1096 (gfc_kind_max): Likewise.
1097 (numeric_type): Likewise.
1098 * gfortran.h (gfc_at_end): Likewise.
1099 (gfc_at_eof): Likewise.
1100 (gfc_at_bol): Likewise.
1101 (gfc_at_eol): Likewise.
1102 (gfc_define_undef_line): Likewise.
1103 (gfc_wide_is_printable): Likewise.
1104 (gfc_wide_is_digit): Likewise.
1105 (gfc_wide_fits_in_byte): Likewise.
1106 (gfc_find_sym_tree): Likewise.
1107 (gfc_generic_intrinsic): Likewise.
1108 (gfc_specific_intrinsic): Likewise.
1109 (gfc_intrinsic_actual_ok): Likewise.
1110 (gfc_has_vector_index): Likewise.
1111 (gfc_numeric_ts): Likewise.
1112 (gfc_impure_variable): Likewise.
1113 (gfc_pure): Likewise.
1114 (gfc_implicit_pure): Likewise.
1115 (gfc_elemental): Likewise.
1116 (gfc_pure_function): Likewise.
1117 (gfc_implicit_pure_function): Likewise.
1118 (gfc_compare_array_spec): Likewise.
1119 (gfc_constant_ac): Likewise.
1120 (gfc_expanded_ac): Likewise.
1121 (gfc_check_digit): Likewise.
1122 * intrinsic.cc (gfc_find_subroutine): Likewise.
1123 (gfc_generic_intrinsic): Likewise.
1124 (gfc_specific_intrinsic): Likewise.
1125 * io.cc (compare_to_allowed_values): Likewise. And remove
1126 unneeded forward declaration.
1127 * parse.cc: Likewise.
1128 * parse.h (gfc_check_do_variable): Likewise.
1129 * primary.cc (gfc_check_digit): Likewise.
1130 * resolve.cc (resolve_structure_cons): Likewise.
1131 (pure_stmt_function): Likewise.
1132 (gfc_pure_function): Likewise.
1133 (impure_stmt_fcn): Likewise.
1134 (resolve_forall_iterators): Likewise.
1135 (resolve_data): Likewise.
1136 (gfc_impure_variable): Likewise.
1137 (gfc_pure): Likewise.
1138 (gfc_unset_implicit_pure): Likewise.
1139 * scanner.cc (wide_is_ascii): Likewise.
1140 (gfc_wide_toupper): Likewise.
1141 (gfc_open_included_file): Likewise.
1142 (gfc_at_end): Likewise.
1143 (gfc_at_eof): Likewise.
1144 (gfc_at_bol): Likewise.
1145 (skip_comment_line): Likewise.
1146 (gfc_gobble_whitespace): Likewise.
1147 * symbol.cc (gfc_find_symtree_in_proc): Likewise.
1148 * trans-array.cc: Likewise.
1149 * trans-decl.cc (gfc_set_decl_assembler_name): Likewise.
1150 * trans-types.cc (gfc_get_element_type): Likewise.
1151 (gfc_add_field_to_struct): Likewise.
1152 * trans-types.h (gfc_copy_dt_decls_ifequal): Likewise.
1153 (gfc_return_by_reference): Likewise.
1154 (gfc_is_nodesc_array): Likewise.
1155 * trans.h (gfc_can_put_var_on_stack): Likewise.
1156
1157 2023-05-17 Harald Anlauf <anlauf@gmx.de>
1158
1159 PR fortran/95374
1160 PR fortran/104352
1161 * decl.cc (add_init_expr_to_sym): Set shape of initializer also for
1162 zero-sized arrays, so that bounds violations can be detected later.
1163
1164 2023-05-17 Tobias Burnus <tobias@codesourcery.com>
1165
1166 * trans-decl.cc (gfc_get_symbol_decl): Add attributes
1167 such as 'declare target' also to hidden artificial
1168 variable for deferred-length character variables.
1169 * trans-openmp.cc (gfc_trans_omp_array_section,
1170 gfc_trans_omp_clauses, gfc_trans_omp_target_exit_data):
1171 Improve mapping of array descriptors and deferred-length
1172 string variables.
1173
1174 2023-05-16 Paul Thomas <pault@gcc.gnu.org>
1175
1176 PR fortran/105152
1177 PR fortran/100193
1178 PR fortran/87496
1179 PR fortran/103389
1180 PR fortran/104429
1181 PR fortran/82774
1182 * interface.cc (gfc_compare_actual_formal): Emit an error if an
1183 unlimited polymorphic actual is not matched either to an
1184 unlimited or assumed type formal argument.
1185 * resolve.cc (resolve_ordinary_assign): Emit an error if the
1186 var expression of an ordinary assignment is a proc pointer
1187 component.
1188 * trans-array.cc (gfc_walk_array_ref): Provide assumed shape
1189 arrays coming from interface mapping with a viable arrayspec.
1190 * trans-expr.cc (gfc_conv_intrinsic_to_class): Tidy up flagging
1191 of unlimited polymorphic 'class_ts'.
1192 (gfc_conv_gfc_desc_to_cfi_desc): Assumed type is unlimited
1193 polymorphic and should accept any actual type.
1194 (gfc_conv_procedure_call): Replace dreadful kludge with a call
1195 to gfc_finalize_tree_expr. Avoid dereferencing a void pointer
1196 by giving it the pointer type of the actual argument.
1197 (alloc_scalar_allocatable_subcomponent): Shorten the function
1198 name and replace the symbol argument with the se string length.
1199 If a deferred length character length is either not present or
1200 is not a variable, give the typespec a variable and assign the
1201 string length to that. Use gfc_deferred_strlen to find the
1202 hidden string length component.
1203 (gfc_trans_subcomponent_assign): Convert the expression before
1204 the call to alloc_scalar_allocatable_subcomponent so that a
1205 good string length is provided.
1206 (gfc_trans_structure_assign): Remove the unneeded derived type
1207 symbol from calls to gfc_trans_subcomponent_assign.
1208
1209 2023-05-15 Harald Anlauf <anlauf@gmx.de>
1210
1211 PR fortran/109846
1212 * expr.cc (gfc_check_vardef_context): Check appropriate pointer
1213 attribute for CLASS vs. non-CLASS function result in variable
1214 definition context.
1215
1216 2023-05-11 Xi Ruoyao <xry111@xry111.site>
1217
1218 * Make-lang.in: Use grep instead of fgrep.
1219
1220 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1221
1222 * dump-parse-tree.cc (gfc_debug_expr): Remove forward declaration.
1223 (debug): Add DEBUG_FUNCTION.
1224 (show_code_node): Remove erroneous whitespace.
1225
1226 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1227
1228 PR fortran/109624
1229 * dump-parse-tree.cc (debug): New function for gfc_namespace.
1230 (gfc_debug_code): Delete forward declaration.
1231 (show_attr): Make sure to print balanced braces.
1232
1233 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1234
1235 * resolve.cc (resolve_select_type): Fix coding style.
1236
1237 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1238
1239 * resolve.cc (resolve_select_type): Call free() unconditionally.
1240
1241 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1242
1243 PR fortran/68800
1244 * expr.cc (find_array_section): Fix mpz memory leak.
1245 * simplify.cc (gfc_simplify_reshape): Fix mpz memory leaks in
1246 error paths.
1247
1248 2023-05-05 Harald Anlauf <anlauf@gmx.de>
1249
1250 PR fortran/109641
1251 * arith.cc (eval_intrinsic): Check conformability of ranks of operands
1252 for intrinsic binary operators before performing type conversions.
1253 * gfortran.h (gfc_op_rank_conformable): Add prototype.
1254 * resolve.cc (resolve_operator): Check conformability of ranks of
1255 operands for intrinsic binary operators before performing type
1256 conversions.
1257 (gfc_op_rank_conformable): New helper function to compare ranks of
1258 operands of binary operator.
1259
1260 2023-05-04 Julian Brown <julian@codesourcery.com>
1261
1262 PR fortran/109622
1263 * openmp.cc (resolve_omp_clauses): Add diagnostic for
1264 non-pointer/non-allocatable attach/detach.
1265 * trans-openmp.cc (gfc_trans_omp_clauses): Remove dereference for
1266 pointer-to-scalar derived type component attach/detach. Fix
1267 attach/detach handling for descriptors.
1268
1269 2023-04-28 Julian Brown <julian@codesourcery.com>
1270
1271 PR fortran/109622
1272 * trans-openmp.cc (gfc_trans_omp_clauses): Attach/detach clause fixes.
1273
1274 2023-04-28 Tobias Burnus <tobias@codesourcery.com>
1275
1276 * gfortran.texi: Fix typos.
1277 * decl.cc: Fix typos in comments and in a variable name.
1278 * arith.cc: Fix comment typos.
1279 * check.cc: Likewise.
1280 * class.cc: Likewise.
1281 * dependency.cc: Likewise.
1282 * expr.cc: Likewise.
1283 * frontend-passes.cc: Likewise.
1284 * gfortran.h: Likewise.
1285 * intrinsic.cc: Likewise.
1286 * iresolve.cc: Likewise.
1287 * match.cc: Likewise.
1288 * module.cc: Likewise.
1289 * primary.cc: Likewise.
1290 * resolve.cc: Likewise.
1291 * simplify.cc: Likewise.
1292 * trans-array.cc: Likewise.
1293 * trans-decl.cc: Likewise.
1294 * trans-expr.cc: Likewise.
1295 * trans-intrinsic.cc: Likewise.
1296 * trans-openmp.cc: Likewise.
1297 * trans-stmt.cc: Likewise.
1298
1299 2023-04-25 Tobias Burnus <tobias@codesourcery.com>
1300
1301 * openmp.cc (gfc_resolve_omp_do_blocks): Handle zero
1302 or more than one exec statements before/after 'omp scan'.
1303 * trans-openmp.cc (gfc_trans_omp_do): Likewise.
1304
1305 2023-04-22 Harald Anlauf <anlauf@gmx.de>
1306 Steven G. Kargl <kargl@gcc.gnu.org>
1307
1308 PR fortran/109500
1309 * interface.cc (gfc_compare_actual_formal): Reject allocatable
1310 functions being used as actual argument for allocable dummy.
1311
1312 2023-04-14 Harald Anlauf <anlauf@gmx.de>
1313
1314 PR fortran/109511
1315 * simplify.cc (gfc_simplify_set_exponent): Fix implementation of
1316 compile-time simplification of intrinsic SET_EXPONENT for argument
1317 X < 1 and for I < 0.
1318
1319 2023-04-14 Paul Thomas <pault@gcc.gnu.org>
1320
1321 PR fortran/104272
1322 * gfortran.h : Add expr3_not_explicit bit field to gfc_code.
1323 * resolve.cc (resolve_allocate_expr): Set bit field when the
1324 default initializer is applied to expr3.
1325 * trans-stmt.cc (gfc_trans_allocate): If expr3_not_explicit is
1326 set, do not deallocate expr3.
1327
1328 2023-04-13 Harald Anlauf <anlauf@gmx.de>
1329
1330 PR fortran/109492
1331 * trans-expr.cc (gfc_conv_power_op): Use absu_hwi and
1332 unsigned HOST_WIDE_INT for portability.
1333
1334 2023-04-12 Harald Anlauf <anlauf@gmx.de>
1335
1336 PR fortran/104312
1337 * resolve.cc (resolve_entries): Handle functions with ENTRY and
1338 ALLOCATABLE results.
1339 * trans-expr.cc (gfc_conv_procedure_call): Functions with a result
1340 with the POINTER or ALLOCATABLE attribute shall not get any special
1341 treatment with -ff2c, as they cannot be written in Fortran 77.
1342 * trans-types.cc (gfc_return_by_reference): Likewise.
1343 (gfc_get_function_type): Likewise.
1344
1345 2023-04-12 Harald Anlauf <anlauf@gmx.de>
1346
1347 PR fortran/61615
1348 PR fortran/99982
1349 * interface.cc (compare_parameter): Enable type and rank checks for
1350 arguments of derived type from the intrinsic module ISO_C_BINDING.
1351
1352 2023-04-08 Paul Thomas <pault@gcc.gnu.org>
1353
1354 PR fortran/87477
1355 * iresolve.cc (gfc_resolve_adjustl, gfc_resolve_adjustr): if
1356 string length is deferred use the string typespec for result.
1357 * resolve.cc (resolve_assoc_var): Handle parentheses around the
1358 target expression.
1359 (resolve_block_construct): Remove unnecessary static decls.
1360 * trans-array.cc (gfc_conv_expr_descriptor): Guard string len
1361 expression in condition. Improve handling of string length and
1362 span, especially for substrings of the descriptor.
1363 (duplicate_allocatable): Make element type more explicit with
1364 'eltype'.
1365 * trans-decl.cc (gfc_get_symbol_decl): Emit a fatal error with
1366 appropriate message instead of ICE if symbol type is unknown.
1367 (gfc_generate_function_code): Set current locus to proc_sym
1368 declared_at.
1369 * trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in
1370 'previous' and use if end expression in substring reference is
1371 null.
1372 (gfc_conv_string_length): Use gfc_conv_expr_descriptor if
1373 'expr_flat' is an array. Add post block to catch deallocation
1374 of temporaries.
1375 (gfc_conv_procedure_call): Assign the parmse string length to
1376 the expression string length, if it is deferred.
1377 (gfc_trans_alloc_subarray_assign): If this is a deferred string
1378 length component, store the string length in the hidden comp.
1379 Update the typespec length accordingly. Generate a new type
1380 spec for the call to gfc_duplicate-allocatable in this case.
1381 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
1382 deferred character array components.
1383
1384 2023-04-04 Harald Anlauf <anlauf@gmx.de>
1385
1386 PR fortran/104349
1387 * expr.cc (check_restricted): Adjust check for valid variables in
1388 restricted expressions: make no exception for module variables.
1389
1390 2023-04-01 Thomas Koenig <tkoenig@gcc.gnu.org>
1391
1392 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
1393 type name to be "long long".
1394
1395 2023-03-30 Andrew Pinski <apinski@marvell.com>
1396
1397 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
1398 type name to be "long long". Add a comment on why adding
1399 2 to the name too.
1400
1401 2023-03-28 Jakub Jelinek <jakub@redhat.com>
1402
1403 PR fortran/109314
1404 * openmp.cc (gfc_omp_absent_contains_clause): Fix typo in diagnostics
1405 - composit -> composite.
1406
1407 2023-03-25 Harald Anlauf <anlauf@gmx.de>
1408
1409 PR fortran/104321
1410 * trans-decl.cc (gfc_conv_cfi_to_gfc): Remove dead code.
1411
1412 2023-03-24 Harald Anlauf <anlauf@gmx.de>
1413
1414 * expr.cc (free_expr0): Free also BOZ strings as part of an expression.
1415
1416 2023-03-24 Haochen Gui <guihaoc@gcc.gnu.org>
1417 Tobias Burnus <tobias@codesourcery.com>
1418
1419 PR target/103628
1420 * target-memory.cc (gfc_interpret_float): Return FAIL when
1421 native_interpret_expr gets a NULL tree.
1422 * arith.cc (gfc_hollerith2real): Return NULL when
1423 gfc_interpret_float fails.
1424 * error.cc (gfc_buffered_p): Define.
1425 * gfortran.h (gfc_buffered_p): Declare.
1426 * intrinsic.cc: Add diagnostic.h to include list.
1427 (do_simplify): Save errorcount and check it at finish. Report a
1428 "Cannot simplify expression" error on a bad result if error count
1429 doesn't change and no other errors buffered.
1430
1431 2023-03-22 Harald Anlauf <anlauf@gmx.de>
1432 Steven G. Kargl <kargl@gcc.gnu.org>
1433
1434 PR fortran/104572
1435 * resolve.cc (gfc_resolve_finalizers): Argument of a FINAL subroutine
1436 cannot be an alternate return.
1437
1438 2023-03-21 Harald Anlauf <anlauf@gmx.de>
1439
1440 PR fortran/99036
1441 * decl.cc (gfc_match_modproc): Reject MODULE PROCEDURE if not in a
1442 generic module interface.
1443
1444 2023-03-21 Arsen Arsenović <arsen@aarsen.me>
1445
1446 * invoke.texi: Remove usages of @gol.
1447 * intrinsic.texi: Ditto.
1448
1449 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
1450
1451 PR fortran/109206
1452 * trans-array.cc (gfc_trans_array_constructor_value): Correct
1453 incorrect setting of typespec.
1454
1455 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
1456
1457 PR fortran/109209
1458 * resolve.cc (generate_component_assignments): Restore the
1459 exclusion of allocatable components from the loop.
1460
1461 2023-03-20 Harald Anlauf <anlauf@gmx.de>
1462
1463 PR fortran/109216
1464 * invoke.texi: Correct documentation of how underscores are appended
1465 to external names.
1466
1467 2023-03-20 Harald Anlauf <anlauf@gmx.de>
1468
1469 PR fortran/109186
1470 * simplify.cc (gfc_simplify_nearest): Fix off-by-one error in setting
1471 up real kind-specific maximum exponent for mpfr.
1472
1473 2023-03-20 Paul Thomas <pault@gcc.gnu.org>
1474
1475 PR fortran/87127
1476 * resolve.cc (check_host_association): If an external function
1477 is typed but not declared explicitly to be external, change the
1478 old symbol from a variable to an external function.
1479
1480 2023-03-19 Harald Anlauf <anlauf@gmx.de>
1481
1482 PR fortran/85877
1483 * resolve.cc (resolve_fl_procedure): Check for an explicit interface
1484 of procedures with the BIND(C) attribute (F2018:15.4.2.2).
1485
1486 2023-03-19 Thomas Koenig <tkoenig@gcc.gnu.org>
1487
1488 * gfortran.texi: Mention behavior on overflow.
1489
1490 2023-03-18 Paul Thomas <pault@gcc.gnu.org>
1491
1492 PR fortran/103854
1493 PR fortran/96122
1494 PR fortran/37336
1495 * class.cc (finalize_component): Include the missing arguments
1496 in the call to the component's finalizer wrapper.
1497 (has_finalizer_component): Do not return true for procedure
1498 pointer components.
1499 (finalizer_insert_packed_call): Remove the redundant argument
1500 in the call to the final subroutine.
1501 (generate_finalization_wrapper): Add support for assumed rank
1502 finalizers.
1503 (gfc_may_be_finalized): New helper function.
1504 * dump-parse-tree.cc (write_proc): Whitespace.
1505 * gfortran.h : Add prototype for gfc_may_be_finalized.
1506 * resolve.cc (resolve_function): Correct derived types that
1507 have an incomplete namespace.
1508 (resolve_where, gfc_resolve_where_code_in_forall,
1509 gfc_resolve_forall_body, gfc_resolve_code): Check that the op
1510 code is still EXEC_ASSIGN. If it is set lhs to must finalize.
1511 (is_finalizable_type): New function.
1512 (generate_component_assignments): Set must_finalize if needed.
1513 (gfc_resolve_finalizers): Error if assumed rank finalizer is
1514 not the only one. Warning on lack of scalar finalizer modified
1515 to account for assumed rank finalizers.
1516 (generate_final_call): New function.
1517 (generate_component_assignments): Enclose the outermost call in
1518 a block to capture automatic deallocation and final calls.
1519 Set must_finalize as required to satisfy the standards. Use an
1520 explicit pointer assignment for pointer components to capture
1521 finalization of the target. Likewise use explicit assignment
1522 for allocatable components. Do not use the temporary copy of
1523 the lhs in defined assignment if the component is allocatable.
1524 Put the temporary in the same namespace as the lhs symbol if
1525 the component may be finalized. Remove the leading assignment
1526 from the expansion of assignment of components that have their
1527 own defined assignment components. Suppress finalization of
1528 assignment of temporary components to the lhs. Make an explicit
1529 final call for the rhs function temporary if it exists.
1530 (gfc_resolve_code): Set must_finalize for assignments with an
1531 array constructor on the rhs.
1532 (gfc_resolve_finalizers): Ensure that an assumed rank finalizer
1533 is the only finalizer for that type and correct the surprising
1534 warning for the lack of a scalar finalizer.
1535 (check_defined_assignments): Handle allocatable components.
1536 (resolve_fl_derived): Set referenced the vtab for use
1537 associated symbols.
1538 (resolve_symbol): Set referenced an unreferenced symbol that
1539 will be finalized.
1540 * trans-array.cc (gfc_trans_array_constructor_value): Add code
1541 to finalize the constructor result. Warn that this feature was
1542 removed in F2018 and that it is suppressed by -std=2018.
1543 (trans_array_constructor): Add finalblock, pass to previous
1544 and apply to loop->post if filled.
1545 (gfc_add_loop_ss_code): Add se finalblock to outer loop post.
1546 (gfc_trans_array_cobounds, gfc_trans_array_bounds): Add any
1547 generated finalization code to the main block.
1548 (structure_alloc_comps): Add boolean argument to suppress
1549 finalization and use it for calls from
1550 gfc_deallocate_alloc_comp_no_caf. Otherwise it defaults to
1551 false.
1552 (gfc_copy_alloc_comp_no_fini): New wrapper for
1553 structure_alloc_comps.
1554 (gfc_alloc_allocatable_for_assignment): Suppress finalization
1555 by setting new arg in call to gfc_deallocate_alloc_comp_no_caf.
1556 (gfc_trans_deferred_array): Use gfc_may_be_finalized and do not
1557 deallocate the components of entities with a leading '_' in the
1558 name that are also marked as artificial.
1559 * trans-array.h : Add the new boolean argument to the prototype
1560 of gfc_deallocate_alloc_comp_no_caf with a default of false.
1561 Add prototype for gfc_copy_alloc_comp_no_fini.
1562 * trans-decl.cc(init_intent_out_dt): Tidy up the code.
1563 * trans-expr.cc (gfc_init_se): Initialize finalblock.
1564 (gfc_conv_procedure_call): Use gfc_finalize_tree_expr to
1565 finalize function results. Replace in-line block for class
1566 results with call to new function.
1567 (gfc_conv_expr): Finalize structure constructors for F2003 and
1568 F2008. Warn that this feature was deleted in F2018 and, unlike
1569 array constructors, is not default. Add array constructor
1570 finalblock to the post block.
1571 (gfc_trans_scalar_assign): Suppress finalization by setting new
1572 argument in call to gfc_deallocate_alloc_comp_no_caf. Add the
1573 finalization blocks to the main block.
1574 (gfc_trans_arrayfunc_assign): Use gfc_assignment_finalizer_call
1575 and ensure that finalization occurs after the evaluation of the
1576 rhs but using the initial value for the lhs. Finalize rhs
1577 function results using gfc_finalize_tree_expr.
1578 (trans_class_assignment, gfc_trans_assignment_1): As previous
1579 function, taking care to order evaluation, assignment and
1580 finalization correctly.
1581 * trans-io.cc (gfc_trans_transfer): Add the final block.
1582 * trans-stmt.cc (gfc_trans_call, gfc_trans_allocate): likewise.
1583 (trans_associate_var): Nullify derived allocatable components
1584 and finalize function targets with defined assignment
1585 components on leaving the block scope.
1586 (trans_allocate): Finalize source expressions, if required,
1587 and set init_expr artificial temporarily to suppress the
1588 finalization in gfc_trans_assignment.
1589 * trans.cc (gfc_add_finalizer_call): Do not finalize the
1590 temporaries generated in type assignment with defined
1591 assignment components.
1592 (gfc_assignment_finalizer_call): New function.
1593 (gfc_finalize_tree_expr): New function.
1594 * trans.h: Add finalblock to gfc_se. Add the prototypes for
1595 gfc_finalize_tree_expr and gfc_assignment_finalizer_call.
1596
1597 2023-03-15 Harald Anlauf <anlauf@gmx.de>
1598 Tobias Burnus <tobias@codesourcery.com>
1599
1600 PR fortran/58331
1601 * interface.cc (compare_parameter): Adjust check of array dummy
1602 arguments to handle the case of CLASS variables.
1603
1604 2023-03-11 Harald Anlauf <anlauf@gmx.de>
1605
1606 PR fortran/106945
1607 * trans-expr.cc (gfc_copy_class_to_class): Convert element counts in
1608 bounds check to common type for comparison.
1609
1610 2023-03-10 Harald Anlauf <anlauf@gmx.de>
1611
1612 PR fortran/104332
1613 * resolve.cc (resolve_symbol): Avoid NULL pointer dereference while
1614 checking a symbol with the BIND(C) attribute.
1615
1616 2023-03-05 Harald Anlauf <anlauf@gmx.de>
1617 Tobias Burnus <tobias@codesourcery.com>
1618
1619 PR fortran/106856
1620 * class.cc (gfc_build_class_symbol): Handle update of attributes of
1621 existing class container.
1622 (gfc_find_derived_vtab): Fix several memory leaks.
1623 (find_intrinsic_vtab): Ditto.
1624 * decl.cc (attr_decl1): Manage update of symbol attributes from
1625 CLASS attributes.
1626 * primary.cc (gfc_variable_attr): OPTIONAL shall not be taken or
1627 updated from the class container.
1628 * symbol.cc (free_old_symbol): Adjust management of symbol versions
1629 to not prematurely free array specs while working on the declation
1630 of CLASS variables.
1631
1632 2023-03-01 Tobias Burnus <tobias@codesourcery.com>
1633
1634 PR middle-end/108546
1635 * trans-openmp.cc (gfc_trans_omp_clauses): Fix mapping of
1636 type(C_ptr) variables.
1637
1638 2023-02-27 Harald Anlauf <anlauf@gmx.de>
1639
1640 PR fortran/108937
1641 * trans-intrinsic.cc (gfc_conv_intrinsic_ibits): Handle corner case
1642 LEN argument of IBITS equal to BITSIZE(I).
1643
1644 2023-02-25 Mikael Morin <mikael@gcc.gnu.org>
1645
1646 PR fortran/108923
1647 * intrinsic.cc (get_intrinsic_dummy_arg,
1648 set_intrinsic_dummy_arg): Rename the former to the latter.
1649 Remove the return value, add a reference to the lhs as argument,
1650 and do the pointer assignment inside the function. Don't do
1651 it if the pointer is already non-NULL.
1652 (sort_actual): Update caller.
1653
1654 2023-02-25 Harald Anlauf <anlauf@gmx.de>
1655
1656 * arith.cc (gfc_real2int): Clear mpfr variable after use.
1657
1658 2023-02-25 Tobias Burnus <tobias@codesourcery.com>
1659
1660 PR fortran/108621
1661 * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Skip setting of
1662 bounds of CFI desc for 'pointer,intent(out)'.
1663
1664 2023-02-24 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
1665
1666 * trans-decl.cc (gfc_finish_var_decl): Apply attribute.
1667 (generate_local_decl): Add diagnostic for dummy and local variables.
1668
1669 2023-02-24 Mikael Morin <mikael@gcc.gnu.org>
1670
1671 PR fortran/108923
1672 * expr.cc (gfc_free_actual_arglist): Free associated_dummy
1673 memory.
1674 (gfc_copy_actual_arglist): Make a copy of the associated_dummy
1675 field if it is set in the original element.
1676
1677 2023-02-24 Harald Anlauf <anlauf@gmx.de>
1678
1679 PR fortran/108924
1680 * frontend-passes.cc (do_subscript): Clear used gmp variable.
1681
1682 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
1683
1684 * invoke.texi: Reorder index entries around @items.
1685
1686 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
1687
1688 * invoke.texi: Reorder @opindex commands to precede @items they
1689 relate to.
1690
1691 2023-02-22 Harald Anlauf <anlauf@gmx.de>
1692
1693 PR fortran/96024
1694 * resolve.cc (resolve_component): The type of a CHARACTER length
1695 expression must be INTEGER.
1696
1697 2023-02-21 Harald Anlauf <anlauf@gmx.de>
1698
1699 PR fortran/96025
1700 * parse.cc (check_function_result_typed): Improve type check of
1701 specification expression for character length and return status.
1702 (parse_spec): Use status from above.
1703 * resolve.cc (resolve_fntype): Prevent use of invalid specification
1704 expression for character length.
1705
1706 2023-02-16 Patrick Palka <ppalka@redhat.com>
1707
1708 * gfortran.h: Mechanically drop static from static inline
1709 functions via s/^static inline/inline/g.
1710
1711 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
1712
1713 PR fortran/103608
1714 * frontend-passes.cc (do_intent): Catch NULL pointer dereference on
1715 reference to invalid formal argument.
1716
1717 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
1718
1719 PR fortran/104554
1720 * resolve.cc (check_assumed_size_reference): Avoid NULL pointer
1721 dereference.
1722
1723 2023-02-15 Tobias Burnus <tobias@codesourcery.com>
1724
1725 PR fortran/108512
1726 * openmp.cc (gfc_resolve_omp_parallel_blocks): Handle combined 'loop'
1727 directives.
1728 (gfc_resolve_do_iterator): Set a source location for added
1729 'private'-clause arguments.
1730 * resolve.cc (gfc_resolve_code): Call gfc_resolve_omp_do_blocks
1731 also for EXEC_OMP_LOOP and gfc_resolve_omp_parallel_blocks for
1732 combined directives with loop + '{masked,master} taskloop (simd)'.
1733
1734 2023-02-13 Harald Anlauf <anlauf@gmx.de>
1735
1736 PR fortran/103475
1737 * primary.cc (gfc_expr_attr): Avoid NULL pointer dereference for
1738 invalid use of CLASS variable.
1739
1740 2023-02-13 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
1741
1742 * decl.cc: Add EXT_ATTR_NOINLINE, EXT_ATTR_NORETURN, EXT_ATTR_WEAK.
1743 * gfortran.h (ext_attr_id_t): Ditto.
1744 * gfortran.texi (GCC$ ATTRIBUTES): Document them.
1745 * trans-decl.cc (build_function_decl): Apply them.
1746
1747 2023-02-09 Harald Anlauf <anlauf@gmx.de>
1748 Steven G. Kargl <kargl@gcc.gnu.org>
1749
1750 PR fortran/69636
1751 PR fortran/103779
1752 * intrinsic.cc (gfc_convert_chartype): Recover on invalid character
1753 kind in conversion instead of generating an internal error.
1754
1755 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
1756
1757 PR fortran/107424
1758 * trans-openmp.cc (struct dovar_init_d): Add 'sym' and
1759 'non_unit_incr' members.
1760 (gfc_nonrect_loop_expr): New.
1761 (gfc_trans_omp_do): Call it; use normal loop bounds
1762 for unit stride - and only create local loop var.
1763
1764 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
1765
1766 * parse.cc (decode_omp_directive): Really ignore 'assumes' with
1767 -fopenmp-simd.
1768
1769 2023-02-08 Steve Kargl <kargl@gcc.gnu.org>
1770
1771 PR fortran/103259
1772 * resolve.cc (resolve_common_vars): Avoid NULL pointer dereference
1773 when a symbol's location is not set.
1774
1775 2023-02-07 Harald Anlauf <anlauf@gmx.de>
1776
1777 PR fortran/95107
1778 * trans-decl.cc (gfc_finish_var_decl): With -fno-automatic, do not
1779 make ASSOCIATE variables TREE_STATIC.
1780
1781 2023-02-05 Harald Anlauf <anlauf@gmx.de>
1782
1783 PR fortran/108592
1784 * arith.cc (gfc_arith_divide): Emit integer division truncation
1785 warnings using gfc_warning instead of gfc_warning_now to prevent
1786 redundant messages.
1787
1788 2023-02-03 Jakub Jelinek <jakub@redhat.com>
1789
1790 PR fortran/108451
1791 * trans-decl.cc (gfc_trans_use_stmts): Call clear_slot before
1792 doing continue.
1793
1794 2023-02-01 Harald Anlauf <anlauf@gmx.de>
1795
1796 PR fortran/108609
1797 * expr.cc (find_array_section): Add check to prevent interpreting an
1798 mpz non-integer constant as an integer.
1799
1800 2023-02-01 Tobias Burnus <tobias@codesourcery.com>
1801
1802 * openmp.cc (resolve_omp_clauses): Check also for
1803 power of two.
1804
1805 2023-01-29 Mikael Morin <mikael@gcc.gnu.org>
1806
1807 PR fortran/108450
1808 * check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
1809 (gfc_check_findloc): Ditto.
1810
1811 2023-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1812
1813 PR fortran/103506
1814 * parse.cc (parse_module): Remove use of a bool error value
1815 that prevented proper setting of the namespace pointer.
1816
1817 2023-01-28 Harald Anlauf <anlauf@gmx.de>
1818 Steven G. Kargl <kargl@gcc.gnu.org>
1819
1820 PR fortran/108527
1821 * resolve.cc (compare_bound_int): Expression to compare must be of
1822 type INTEGER.
1823 (compare_bound_mpz_t): Likewise.
1824 (check_dimension): Fix comment on checks applied to array section
1825 and clean up associated logic.
1826
1827 2023-01-28 Harald Anlauf <anlauf@gmx.de>
1828
1829 PR fortran/108453
1830 * match.cc (gfc_match_common): A USE associated name shall not appear
1831 in a COMMON block (F2018:C8121).
1832
1833 2023-01-27 Tobias Burnus <tobias@codesourcery.com>
1834
1835 PR fortran/108558
1836 * trans-openmp.cc (gfc_split_omp_clauses): Handle has_device_addr.
1837
1838 2023-01-26 Harald Anlauf <anlauf@gmx.de>
1839
1840 PR fortran/108544
1841 * resolve.cc (check_host_association): Extend host association check
1842 so that it is not restricted to functions. Also prevent NULL pointer
1843 dereference.
1844
1845 2023-01-25 Steve Kargl <kargl@gcc.gnu.org>
1846
1847 PR fortran/108528
1848 * array.cc (compare_bounds): Return false instead of generating an
1849 internal error on an invalid argument type.
1850
1851 2023-01-24 Harald Anlauf <anlauf@gmx.de>
1852
1853 PR fortran/108529
1854 * simplify.cc (simplify_transformation): Do not try to simplify
1855 transformational intrinsic when the ARRAY argument has a NULL shape.
1856
1857 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1858
1859 PR fortran/108502
1860 * dependency.cc (gfc_check_dependency): Prevent NULL pointer
1861 dereference while recursively checking expressions.
1862
1863 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1864
1865 PR fortran/108501
1866 * interface.cc (get_expr_storage_size): Check array subscript triplets
1867 that we actually have integer values before trying to extract with
1868 mpz_get_si.
1869
1870 2023-01-23 Harald Anlauf <anlauf@gmx.de>
1871
1872 PR fortran/108420
1873 * iresolve.cc (check_charlen_present): Preserve character length if
1874 there is no array constructor.
1875
1876 2023-01-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1877
1878 PR fortran/102595
1879 * data.cc (gfc_assign_data_value): Remove check for PARAMETER in DATA.
1880 * primary.cc (match_variable): Add check for PARAMETER in DATA.
1881
1882 2023-01-19 Harald Anlauf <anlauf@gmx.de>
1883
1884 PR fortran/108434
1885 * expr.cc (class_allocatable): Prevent NULL pointer dereference
1886 or invalid read.
1887 (class_pointer): Likewise.
1888
1889 2023-01-17 Harald Anlauf <anlauf@gmx.de>
1890
1891 PR fortran/108421
1892 * interface.cc (get_expr_storage_size): Check that we actually have
1893 an integer value before trying to extract it with mpz_get_si.
1894
1895 2023-01-12 Tobias Burnus <tobias@codesourcery.com>
1896
1897 PR fortran/107706
1898 * openmp.cc (gfc_resolve_omp_assumptions): Reject nonscalars.
1899
1900 2023-01-11 Jakub Jelinek <jakub@redhat.com>
1901
1902 PR fortran/108349
1903 * f95-lang.cc (gfc_init_builtin_function): Fix up function types
1904 for BUILT_IN_REALLOC and BUILT_IN_SINCOS{F,,L}. Formatting fixes.
1905
1906 2023-01-10 Harald Anlauf <anlauf@gmx.de>
1907
1908 PR fortran/97345
1909 * frontend-passes.cc (do_subscript): Clear used gmp variables.
1910
1911 2023-01-02 Jakub Jelinek <jakub@redhat.com>
1912
1913 * gfortranspec.cc (lang_specific_driver): Update copyright notice
1914 dates.
1915 * gfc-internals.texi: Bump @copying's copyright year.
1916 * gfortran.texi: Ditto.
1917 * intrinsic.texi: Ditto.
1918 * invoke.texi: Ditto.
1919
1920 \f
1921 Copyright (C) 2023 Free Software Foundation, Inc.
1922
1923 Copying and distribution of this file, with or without modification,
1924 are permitted in any medium without royalty provided the copyright
1925 notice and this notice are preserved.