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