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