Daily bump.
[official-gcc.git] / gcc / fortran / ChangeLog
blob7781daf40d2d17ad4e30da1f5dfde8608e868344
1 2024-03-15  Paul Thomas  <pault@gcc.gnu.org>
3         PR fortran/87477
4         PR fortran/89645
5         PR fortran/99065
6         PR fortran/114141
7         PR fortran/114280
8         * class.cc (gfc_change_class): New function needed for
9         associate names, when rank changes or a derived type is
10         produced by resolution
11         * dump-parse-tree.cc (show_code_node): Make output for SELECT
12         TYPE more comprehensible.
13         * expr.cc (find_inquiry_ref): Do not simplify expressions of
14         an inferred type.
15         * gfortran.h : Add 'gfc_association_list' to structure
16         'gfc_association_list'. Add prototypes for
17         'gfc_find_derived_types', 'gfc_fixup_inferred_type_refs' and
18         'gfc_change_class'. Add macro IS_INFERRED_TYPE.
19         * match.cc (copy_ts_from_selector_to_associate): Add bolean arg
20         'select_type' with default false. If this is a select type name
21         and the selector is a inferred type, build the class type and
22         apply it to the associate name.
23         (build_associate_name): Pass true to 'select_type' in call to
24         previous.
25         * parse.cc (parse_associate): If the selector is inferred type
26         the associate name is too. Make sure that function selector
27         class and rank, if known, are passed to the associate name. If
28         a function result exists, pass its typespec to the associate
29         name.
30         * primary.cc (resolvable_fcns): New function to check that all
31         the function references are resolvable.
32         (gfc_match_varspec): If a scalar derived type select type
33         temporary has an array reference, match the array reference,
34         treating this in the same way as an equivalence member. Do not
35         set 'inquiry' if applied to an unknown type the inquiry name
36         is ambiguous with the component of an accessible derived type.
37         Check that resolution of the target expression is OK by testing
38         if the symbol is declared or is an operator expression, then
39         using 'resolvable_fcns' recursively. If all is well, resolve
40         the expression. If this is an inferred type with a component
41         reference, call 'gfc_find_derived_types' to find a suitable
42         derived type. If there is an inquiry ref and the symbol either
43         is of unknown type or is inferred to be a derived type, set the
44         primary and symbol TKR appropriately.
45         * resolve.cc (resolve_variable): Call new function below.
46         (gfc_fixup_inferred_type_refs): New function to ensure that the
47         expression references for a inferred type are consistent with
48         the now fixed up selector.
49         (resolve_assoc_var): Ensure that derived type or class function
50         selectors transmit the correct arrayspec to the associate name.
51         (resolve_select_type): If the selector is an associate name of
52         inferred type and has no component references, the associate
53         name should have its typespec. Simplify the conversion of a
54         class array to class scalar by calling 'gfc_change_class'.
55         Make sure that a class, inferred type selector with an array
56         ref transfers the typespec from the symbol to the expression.
57         * symbol.cc (gfc_set_default_type): If an associate name with
58         unknown type has a selector expression, try resolving the expr.
59         (find_derived_types, gfc_find_derived_types): New functions
60         that search for a derived type with a given name.
61         * trans-expr.cc (gfc_conv_variable): Some inferred type exprs
62         escape resolution so call 'gfc_fixup_inferred_type_refs'.
63         * trans-stmt.cc (trans_associate_var): Tidy up expression for
64         'class_target'. Finalize and free class function results.
65         Correctly handle selectors that are class functions and class
66         array references, passed as derived types.
68 2024-03-14  Thomas Schwinge  <thomas@codesourcery.com>
70         * dump-parse-tree.cc (show_omp_clauses): Handle 'self_expr'.
71         * openmp.cc (gfc_free_omp_clauses): Likewise.
72         * trans-openmp.cc (gfc_split_omp_clauses): Don't handle 'self_expr'.
74 2024-03-14  Chung-Lin Tang  <cltang@baylibre.com>
76         * dump-parse-tree.cc (show_omp_namelist): Print "readonly," for
77         OMP_LIST_MAP and OMP_LIST_CACHE if n->u.map.readonly is set.
78         Adjust 'n->u.map_op' to 'n->u.map.op'.
79         * gfortran.h (typedef struct gfc_omp_namelist): Adjust map_op as
80         'ENUM_BITFIELD (gfc_omp_map_op) op:8', add 'bool readonly' field,
81         change to named struct field 'map'.
82         * openmp.cc (gfc_match_omp_map_clause): Adjust 'n->u.map_op' to
83         'n->u.map.op'.
84         (gfc_match_omp_clause_reduction): Likewise.
85         (gfc_match_omp_clauses): Add readonly modifier parsing for OpenACC
86         copyin clause, set 'n->u.map.op' and 'n->u.map.readonly' for parsed
87         clause. Adjust 'n->u.map_op' to 'n->u.map.op'.
88         (gfc_match_oacc_declare): Adjust 'n->u.map_op' to 'n->u.map.op'.
89         (gfc_match_oacc_cache): Add readonly modifier parsing for OpenACC
90         cache directive.
91         (resolve_omp_clauses): Adjust 'n->u.map_op' to 'n->u.map.op'.
92         * trans-decl.cc (add_clause): Adjust 'n->u.map_op' to 'n->u.map.op'.
93         (finish_oacc_declare): Likewise.
94         * trans-openmp.cc (gfc_trans_omp_clauses): Set OMP_CLAUSE_MAP_READONLY,
95         OMP_CLAUSE__CACHE__READONLY to 1 when readonly is set. Adjust
96         'n->u.map_op' to 'n->u.map.op'.
97         (gfc_add_clause_implicitly): Adjust 'n->u.map_op' to 'n->u.map.op'.
99 2024-03-13  Harald Anlauf  <anlauf@gmx.de>
101         PR fortran/114001
102         * expr.cc (gfc_is_simply_contiguous): Adjust logic so that CLASS
103         symbols are also handled.
105 2024-03-13  Tobias Burnus  <tburnus@baylibre.com>
107         PR fortran/114283
108         * trans-openmp.cc (gfc_omp_predetermined_mapping): Map dummy
109         procedures as firstprivate.
111 2024-03-12  Harald Anlauf  <anlauf@gmx.de>
113         PR fortran/110826
114         * array.cc (gfc_array_dimen_size): When walking the ref chain of an
115         array and the ultimate component is a procedure pointer, do not try
116         to figure out its dimension even if it is a array-valued function.
118 2024-03-06  Harald Anlauf  <anlauf@gmx.de>
120         PR fortran/103707
121         PR fortran/106987
122         * arith.cc (is_hard_arith_error): New helper function to determine
123         whether an arithmetic error is "hard" or not.
124         (check_result): Use it.
125         (gfc_arith_divide): Set "Division by zero" only for regular
126         numerators of real and complex divisions.
127         (reduce_unary): Use is_hard_arith_error to determine whether a hard
128         or (recoverable) soft error was encountered.  Terminate immediately
129         on hard error, otherwise remember code of first soft error.
130         (reduce_binary_ac): Likewise.
131         (reduce_binary_ca): Likewise.
132         (reduce_binary_aa): Likewise.
134 2024-03-01  Harald Anlauf  <anlauf@gmx.de>
136         PR fortran/104819
137         * check.cc (gfc_check_null): Handle nested NULL()s.
138         (is_c_interoperable): Check for MOLD argument of NULL() as part of
139         the interoperability check.
140         * interface.cc (gfc_compare_actual_formal): Extend checks for NULL()
141         actual arguments for presence of MOLD argument when required by
142         Interp J3/22-146.
144 2024-02-29  Alexander Westbrooks  <alexanderw@gcc.gnu.org>
146         PR fortran/82943
147         PR fortran/86148
148         PR fortran/86268
149         * decl.cc (gfc_get_pdt_instance): Set the PDT instance field
150         'f2k_derived', if not set already, to point to the given
151         PDT template 'f2k_derived' namespace in order to give the
152         PDT instance referential access to the typebound procedures
153         of the template.
154         * gfortran.h (gfc_pdt_is_instance_of): Add prototype.
155         * resolve.cc (resolve_typebound_procedure): If the derived type
156         does not have the attribute 'pdt_template' set, compare the
157         dummy argument to the 'resolve_bindings_derived' type like usual.
158         If the derived type is a 'pdt_template', then check if the
159         dummy argument is an instance of the PDT template. If the derived
160         type is a PDT template, and the dummy argument is an instance of
161         that template, but the dummy argument 'param_list' is not
162         SPEC_ASSUMED, check if there are any LEN parameters in the
163         dummy argument. If there are no LEN parameters, then this implies
164         that there are only KIND parameters in the dummy argument.
165         If there are LEN parameters, this would be an error, for all
166         LEN parameters for the dummy argument MUST be assumed for
167         typebound procedures of PDTs.
168         (resolve_pdt): Add a check for ALLOCATABLE and POINTER attributes for
169         SPEC_DEFERRED parameters of PDT class symbols.  ALLOCATABLE and
170         POINTER attributes for a PDT class symbol are stored in the
171         'class_pointer' and 'allocatable' attributes of the '_data'
172         component respectively.
173         * symbol.cc (gfc_pdt_is_instance_of): New function.
175 2024-02-26  Harald Anlauf  <anlauf@gmx.de>
177         PR fortran/114012
178         * trans-expr.cc (gfc_conv_procedure_call): Evaluate non-trivial
179         arguments just once before assigning to an unlimited polymorphic
180         dummy variable.
182 2024-02-23  Steve Kargl  <kargl@gcc.gnu.org>
183             Harald Anlauf  <anlauf@gmx.de>
185         PR fortran/114024
186         * trans-stmt.cc (gfc_trans_allocate): When a source expression has
187         substring references, part-refs, or %re/%im inquiries, wrap the
188         entity in parentheses to force evaluation of the expression.
190 2024-02-23  Tobias Burnus  <tburnus@baylibre.com>
192         * openmp.cc (gfc_match_omp_depobj): Use OPT_Wopenmp
193         as warning category in gfc_warning.
195 2024-02-20  Peter Hill  <peter.hill@york.ac.uk>
197         PR fortran/105658
198         * trans-expr.cc (gfc_conv_intrinsic_to_class): When passing an
199         array component reference of intrinsic type to a procedure
200         with an unlimited polymorphic dummy argument, a temporary
201         should be created.
203 2024-02-17  Jakub Jelinek  <jakub@redhat.com>
205         PR fortran/113503
206         * trans-expr.cc (alloc_scalar_allocatable_subcomponent): Don't
207         overwrite expr2->ts.u.cl->backend_decl, instead set size to
208         expr2->ts.u.cl->backend_decl first and use size instead of
209         expr2->ts.u.cl->backend_decl.
210         (gfc_trans_subcomponent_assign): Emit se.pre into block
211         before calling alloc_scalar_allocatable_subcomponent instead of
212         after it.
214 2024-02-17  Harald Anlauf  <anlauf@gmx.de>
216         PR fortran/113911
217         * trans-array.cc (gfc_trans_deferred_array): Do not clobber
218         deferred length for a character variable passed as dummy argument.
220 2024-02-15  Kwok Cheung Yeung  <kcyeung@baylibre.com>
222         * dump-parse-tree.cc (show_attr): Handle omp_declare_target_indirect
223         attribute.
224         * f95-lang.cc (gfc_gnu_attributes): Add entry for 'omp declare
225         target indirect'.
226         * gfortran.h (symbol_attribute): Add omp_declare_target_indirect
227         field.
228         (struct gfc_omp_clauses): Add indirect field.
229         * openmp.cc (omp_mask2): Add OMP_CLAUSE_INDIRECT.
230         (gfc_match_omp_clauses): Match indirect clause.
231         (OMP_DECLARE_TARGET_CLAUSES): Add OMP_CLAUSE_INDIRECT.
232         (gfc_match_omp_declare_target): Check omp_device_type and apply
233         omp_declare_target_indirect attribute to symbol if indirect clause
234         active.  Show warning if there are only device_type and/or indirect
235         clauses on the directive.
236         * trans-decl.cc (add_attributes_to_decl): Add 'omp declare target
237         indirect' attribute if symbol has indirect attribute set.
239 2024-02-14  Steve Kargl  <kargl@gcc.gnu.org>
241         PR fortran/105847
242         * trans-io.cc (transfer_namelist_element): When building the
243         namelist object name, if the use rename attribute is set, use
244         the local name specified in the use statement.
246 2024-02-14  Jakub Jelinek  <jakub@redhat.com>
248         * error.cc (error_print): For u printing of ptrdiff_t,
249         print ptrdiff_t argument converted to unsigned long long and
250         masked with 2ULL * PTRDIFF_MAX + 1.
252 2024-02-13  Tobias Burnus  <tburnus@baylibre.com>
254         PR middle-end/113904
255         * trans-openmp.cc (gfc_trans_omp_declare_variant): Handle splitting of
256         OMP_TRAIT_PROPERTY_EXPR into OMP_TRAIT_PROPERTY_{DEV_NUM,BOOL}_EXPR.
257         * openmp.cc (gfc_match_omp_context_selector): Likewise; rejects
258         non-const device_num/condition; improve diagnostic.
260 2024-02-13  Harald Anlauf  <anlauf@gmx.de>
262         PR fortran/113866
263         * trans-expr.cc (gfc_conv_procedure_call): When passing an optional
264         dummy argument to an optional dummy argument of a bind(c) procedure
265         and the dummy argument is passed via a CFI descriptor, no special
266         presence check and passing of a default NULL pointer is needed.
268 2024-02-13  Steve Kargl  <kargl@gcc.gnu.org>
270         PR fortran/113883
271         * trans-array.cc (gfc_trans_deferred_array): Set length to zero,
272         avoiding extraneous diagnostics.
274 2024-02-10  Jakub Jelinek  <jakub@redhat.com>
276         * error.cc (error_print): Handle z and t modifiers on d, i and u.
277         * check.cc (gfc_check_transfer): Use %zd instead of %ld and casts to
278         long.
279         * primary.cc (gfc_convert_to_structure_constructor): Use %td instead
280         of %ld and casts to long.
282 2024-02-10  Jakub Jelinek  <jakub@redhat.com>
284         * trans-common.cc (build_common_decl): Use %wu instead of %lu and
285         casts to unsigned long.
286         * resolve.cc (resolve_ordinary_assign): Use %wd instead of %ld and
287         casts to long.
288         * array.cc (gfc_resolve_character_array_constructor): Likewise.
289         * data.cc (create_character_initializer): Likewise.
291 2024-02-09  Harald Anlauf  <anlauf@gmx.de>
293         PR fortran/113799
294         * arith.cc (reduce_unary): Remember any overflow encountered during
295         reduction of unary arithmetic operations on array constructors and
296         continue, and return error status, but terminate on serious errors.
298 2024-01-28  Harald Anlauf  <anlauf@gmx.de>
300         PR fortran/113377
301         * trans-expr.cc (conv_dummy_value): Treat NULL actual argument to
302         optional dummy with the VALUE attribute as not present.
303         (gfc_conv_procedure_call): Likewise.
305 2024-01-27  Harald Anlauf  <anlauf@gmx.de>
307         PR fortran/104908
308         * trans-array.cc (gfc_conv_array_ref): Restrict use of transformed
309         descriptor (sym->backend_decl) to the unlimited polymorphic case.
311 2024-01-24  Harald Anlauf  <anlauf@gmx.de>
313         PR fortran/113377
314         * trans-expr.cc (conv_dummy_value): New.
315         (gfc_conv_procedure_call): Factor code for handling dummy arguments
316         with the VALUE attribute in the scalar case into conv_dummy_value().
317         Reuse and adjust for calling elemental procedures.
319 2024-01-21  Harald Anlauf  <anlauf@gmx.de>
321         PR fortran/113377
322         * trans-expr.cc (gfc_conv_procedure_call): Fix handling of optional
323         scalar arguments of intrinsic type with the VALUE attribute.
325 2024-01-20  Mikael Morin  <mikael@gcc.gnu.org>
327         PR fortran/48776
328         PR fortran/111291
329         * parse.cc: Restore current interface to its previous value on error.
331 2024-01-19  Harald Anlauf  <anlauf@gmx.de>
333         PR fortran/113471
334         * trans-array.cc (array_bound_check_elemental): Array bounds check
335         shall apply here to elemental dimensions of an array section only.
337 2024-01-13  Harald Anlauf  <anlauf@gmx.de>
339         PR fortran/67277
340         * trans-intrinsic.cc (gfc_conv_intrinsic_ishftc): Handle optional
341         dummy argument for SIZE passed to ISHFTC.  Set default value to
342         BIT_SIZE(I) when missing.
344 2024-01-13  Harald Anlauf  <anlauf@gmx.de>
346         PR fortran/113305
347         * gfortran.h (gfc_loop_annot): New.
348         (gfc_iterator, gfc_forall_iterator): Use for annotation control.
349         * array.cc (gfc_copy_iterator): Adjust.
350         * gfortran.texi: Document annotations IVDEP, UNROLL n, VECTOR,
351         NOVECTOR as applied to DO CONCURRENT.
352         * parse.cc (parse_do_block): Parse annotations IVDEP, UNROLL n,
353         VECTOR, NOVECTOR as applied to DO CONCURRENT.  Apply UNROLL only to
354         first loop control variable.
355         * trans-stmt.cc (iter_info): Use gfc_loop_annot.
356         (gfc_trans_simple_do): Adjust.
357         (gfc_trans_forall_loop): Annotate loops with IVDEP, UNROLL n,
358         VECTOR, NOVECTOR as needed for DO CONCURRENT.
359         (gfc_trans_forall_1): Handle loop annotations.
361 2024-01-08  Harald Anlauf  <anlauf@gmx.de>
363         PR fortran/113245
364         * trans-intrinsic.cc (gfc_conv_intrinsic_size): Use
365         gfc_conv_expr_present() for proper check of optional DIM argument.
367 2024-01-06  Harald Anlauf  <anlauf@gmx.de>
368             José Rui Faustino de Sousa  <jrfsousa@gmail.com>
370         PR fortran/96724
371         * iresolve.cc (gfc_resolve_repeat): Force conversion to
372         gfc_charlen_int_kind before call to gfc_multiply.
374 2024-01-04  David Malcolm  <dmalcolm@redhat.com>
376         * lang.opt.urls: New file, autogenerated by
377         regenerate-opt-urls.py.
379 2024-01-03  Harald Anlauf  <anlauf@gmx.de>
381         * trans-types.cc (gfc_get_nodesc_array_type): Clear used gmp
382         variables.
384 2024-01-03  Jakub Jelinek  <jakub@redhat.com>
386         * gfortranspec.cc (lang_specific_driver): Update copyright notice
387         dates.
388         * gfc-internals.texi: Bump @copying's copyright year.
389         * gfortran.texi: Ditto.
390         * intrinsic.texi: Ditto.
391         * invoke.texi: Ditto.
394 Copyright (C) 2024 Free Software Foundation, Inc.
396 Copying and distribution of this file, with or without modification,
397 are permitted in any medium without royalty provided the copyright
398 notice and this notice are preserved.