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