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