2018-01-29 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / fortran / ChangeLog
blob96e6fb214029ad054a48fbdc9e82105fce553e45
1 2017-01-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
3         PR fortran/84073
4         * resolve.c (resolve_component): Ensure BIND(C) character
5         components have length one.
6         (resolve_symbol): Likewise for variables.
8 2018-01-27  Jakub Jelinek  <jakub@redhat.com>
10         PR fortran/84065
11         * decl.c (add_init_expr_to_sym): Ignore initializers for too large
12         lengths.
14 2018-01-26  Damian Rouson  <damian@sourceryinstitute.org>
15             Alessandro Fanfarillo  <fanfarillo.gcc@gmail.com>
16             Soren Rasmussen  <s.c.rasmussen@gmail.com>
18         Partial support for Fortran 2018 teams features.
20         * array.c (gfc_match_array_ref): add team attribute in coarray
21         transfers.
22         * check.c (gfc_check_get_team, gfc_check_team_number): add new
23         functions for get_team and team_number.
24         * dump-parse-tree.c (show_code_node): add new statements: form team,
25         change team, end team, and sync team.
26         * expr.c (gfc_find_team_co): add new function.
27         * gfortran.h: add new statements.
28         * intrinsic.c (add_functions): add get_team and team_number functions.
29         * intrinsic.h: add get_team and team_number prototypes for check,
30         simplify, and resolve.
31         * iresolve.c (gfc_resolve_get_team, gfc_resolve_team_number): add new
32         functions.
33         * iso-fortran-env.def: add the team_type derived type.
34         * match.c (gfc_match_if, gfc_match_form_team, gfc_match_team_number)
35         (gfc_match_end_team, gfc_match_sync_team, gfc_match_change_team):
36         add change team, end team, form team, sync team match and functions.
37         * match.h: add new prototypes for change team, end team, form team,
38         and sync team.
39         * parse.c (decode_statement): add cases for change team, end team,
40         form team, and sync team.
41         * resolve.c: add cases for exec form team, change team, end team, and
42         sync team.
43         * simplify.c (gfc_simplify_get_team): add new function for get team.
44         * st.c (gfc_free_statement): add cases exec for change team, end team,
45         form team, sync team.
46         * trans-decl.c (gfor_fndecl_caf_form_team)
47         (gfor_fndecl_caf_change_team, gfor_fndecl_caf_end_team)
48         (gfor_fndecl_caf_sync_team, gfor_fndecl_caf_get_team)
49         (gfor_fndecl_caf_team_number): add functions and definitions.
50         * trans-intrinsic.c (conv_caf_send, conv_intrinsic_team_number): add
51         new function and team_type argument support.
52         * trans-stmt.c (gfc_trans_form_team, gfc_trans_change_team)
53         (gfc_trans_end_team, gfc_trans_sync_team): add new functions.
54         * trans-stmt.h: add new prototypes.
55         * trans-types.c (gfc_get_derived_type): check condition for team_type.
56         * trans.c (trans_code): new exec cases for form team, change team, end
57         team, and sync team.
58         * trans.h: add new prototypes.
60 2018-01-26  Steven G. Kargl  <kargl@gcc.gnu.org>
62         PR fortran/83998
63         * simplify.c (compute_dot_product):  Initialize result to INTEGER(1) 0
64         or .false.  The summation does the correct type conversion.
65         (gfc_simplify_dot_product): Special case zero-sized arrays.
67 2018-25-01  Paul Thomas  <pault@gcc.gnu.org>
69         PR fortran/37577
70         * array.c (gfc_match_array_ref): If standard earlier than F2008
71         it is an error if the reference dimension is greater than 7.
72         libgfortran.h : Increase GFC_MAX_DIMENSIONS to 15. Change the
73         dtype masks and shifts accordingly.
74         * trans-array.c (gfc_conv_descriptor_dtype): Use the dtype
75         type node to check the field.
76         (gfc_conv_descriptor_dtype): Access the rank field of dtype.
77         (duplicate_allocatable_coarray): Access the rank field of the
78         dtype descriptor rather than the dtype itself.
79         * trans-expr.c (get_scalar_to_descriptor_type): Store the type
80         of 'scalar' on entry and use its TREE_TYPE if it is ARRAY_TYPE
81         (ie. a character).
82         (gfc_conv_procedure_call): Pass TREE_OPERAND (tmp,0) to
83         get_scalar_to_descriptor_type if the actual expression is a
84         constant.
85         (gfc_trans_structure_assign): Assign the rank directly to the
86         dtype rank field.
87         * trans-intrinsic.c (gfc_conv_intrinsic_rank): Cast the result
88         to default integer kind.
89         (gfc_conv_intrinsic_sizeof): Obtain the element size from the
90         'elem_len' field of the dtype.
91         * trans-io.c (gfc_build_io_library_fndecls): Replace
92         gfc_int4_type_node with dtype_type_node where necessary.
93         (transfer_namelist_element): Use gfc_get_dtype_rank_type for
94         scalars.
95         * trans-types.c : Provide 'get_dtype_type_node' to acces the
96         dtype_type_node and, if necessary, build it.
97         The maximum size of an array element is now determined by the
98         maximum value of size_t.
99         Update the description of the array descriptor, including the
100         type def for the dtype_type.
101         (gfc_get_dtype_rank_type): Build a constructor for the dtype.
102         Distinguish RECORD_TYPEs that are BT_DERIVED or BT_CLASS.
103         (gfc_get_array_descriptor_base): Change the type of the dtype
104         field to dtype_type_node.
105         (gfc_get_array_descr_info): Get the offset to the rank field of
106         the dtype.
107         * trans-types.h : Add a prototype for 'get_dtype_type_node ()'.
108         * trans.h : Define the indices of the dtype fields.
110 2018-23-01  Paul Thomas  <pault@gcc.gnu.org>
112         PR fortran/83866
113         * decl.c (gfc_match_derived_decl): If eos not matched, recover
114         and emit error about garbage after declaration.
116 2018-23-01  Paul Thomas  <pault@gcc.gnu.org>
118         PR fortran/83898
119         * trans-stmt.c (trans_associate_var): Do not set cst_array_ctor
120         for characters.
122 2018-01-22  Janne Blomqvist  <jb@gcc.gnu.org>
124         PR 78534
125         PR 83704
126         * arith.c (gfc_arith_concat): Use size_t for string length.
127         (gfc_compare_string): Likewise.
128         (gfc_compare_with_Cstring): Likewise.
129         * array.c (gfc_resolve_character_array_constructor): Use
130         HOST_WIDE_INT, gfc_mpz_get_hwi.
131         * check.c (gfc_check_fe_runtime_error): Use size_t.
132         * data.c (create_character_initializer): Use HOST_WIDE_INT,
133         gfc_extract_hwi.
134         * decl.c (gfc_set_constant_character_len): Use gfc_charlen_t.
135         (add_init_expr_to_sym): Use HOST_WIDE_INT.
136         * expr.c (gfc_build_init_expr): Use HOST_WIDE_INT,
137         gfc_extract_hwi.
138         (gfc_apply_init): Likewise.
139         * match.h (gfc_set_constant_character_len): Update prototype.
140         * primary.c (match_string_constant): Use size_t.
141         * resolve.c (resolve_ordinary_assign): Use HOST_WIDE_INT,
142         gfc_mpz_get_hwi.
143         * simplify.c (init_result_expr): Likewise.
144         (gfc_simplify_len_trim): Use size_t.
145         * target-memory.c (gfc_encode_character): Use size_t.
146         (gfc_target_encode_expr): Use HOST_WIDE_INT, gfc_mpz_get_hwi.
147         (interpret_array): Use size_t.
148         (gfc_interpret_character): Likewise.
149         * target-memory.h (gfc_encode_character): Update prototype.
150         (gfc_interpret_character): Likewise.
151         (gfc_target_interpret_expr): Likewise.
152         * trans-const.c (gfc_build_string_const): Use size_t for length
153         argument.
154         (gfc_build_wide_string_const): Likewise.
155         * trans-const.h (gfc_build_string_const): Likewise.
156         (gfc_build_wide_string_const): Likewise.
158 2018-01-20  Steven G. Kargl  <kargl@gcc.gnu.org>
160         PR fortran/83900
161     * simplify.c (gfc_simplify_matmul): Set return type correctly.
163 2018-01-19  Steven G. Kargl  <kargl@gcc.gnu.org>
165         PR fortran/83900
166         * simplify.c (gfc_simplify_matmul): Delete bogus assertion.
168 2018-01-17  Harald Anlauf  <anlauf@gmx.de>
170         PR fortran/83864
171         * expr.c (add_init_expr_to_sym): Do not dereference NULL pointer.
173 2018-01-17  Harald Anlauf  <anlauf@gmx.de>
175         PR fortran/83874
176         * decl.c (add_init_expr_to_sym): Do not dereference NULL pointer.
178 2018-01-15  Louis Krupp  <louis.krupp@zoho.com>
180         PR fortran/82257
181         * interface.c (compare_rank): Don't try to retrieve CLASS_DATA
182         from symbol marked unlimited polymorphic.
183         * resolve.c (resolve_structure_cons): Likewise.
184         * misc.c (gfc_typename): Don't dereference derived->components
185         if it's NULL.
187 2018-01-15  Thomas Koenig  <tkoenig@gcc.gnu.org>
189         PR fortran/54613
190         * gfortran.h (gfc_check_f): Rename f4ml to f5ml.
191         (gfc_logical_4_kind): New macro
192         * intrinsic.h (gfc_simplify_minloc): Add a gfc_expr *argument.
193         (gfc_simplify_maxloc): Likewise.
194         (gfc_resolve_maxloc): Likewise.
195         (gfc_resolve_minloc): Likewise.
196         * check.c (gfc_check_minloc_maxloc): Add checking for "back"
197         argument; also raise error if it is used (for now). Add it
198         if it isn't present.
199         * intrinsic.c (add_sym_4ml): Rename to
200         (add_sym_5ml), adjust for extra argument.
201         (add_functions): Add "back" constant. Adjust maxloc and minloc
202         for back argument.
203         * iresolve.c (gfc_resolve_maxloc): Add back argument. If back is
204         not of gfc_logical_4_kind, convert.
205         (gfc_resolve_minloc): Likewise.
206         * simplify.c (gfc_simplify_minloc): Add back argument.
207         (gfc_simplify_maxloc): Likewise.
208         * trans-intinsic.c (gfc_conv_intrinsic_minmaxloc): Rename last
209         argument to %VAL to ensure passing by value.
210         (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_minmaxloc
211         also for library calls.
213 2018-01-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
215         PR fortran/82007
216         * resolve.c (resolve_transfer): Delete code looking for 'DT'
217         format specifiers in format strings. Set formatted to true if a
218         format string or format label is present.
219         * trans-io.c (get_dtio_proc): Likewise. (transfer_expr): Fix
220         whitespace.
222 2018-01-13  Thomas Koenig <tkoenig@gcc.gnu.org>
224         PR fortran/83744
225         * dump-parse-tree.c (get_c_type_name): Remove extra line.
226         Change for loop to use declaration in for loop. Handle BT_LOGICAL
227         and BT_CHARACTER.
228         (write_decl): Add where argument. Fix indentation. Replace
229         assert with error message. Add typename to warning
230         in comment.
231         (write_type): Adjust locus to call of write_decl.
232         (write_variable): Likewise.
233         (write_proc): Likewise. Replace assert with error message.
235 2018-01-13  Paul Thomas  <pault@gcc.gnu.org>
237         PR fortran/52162
238         * trans-expr.c (gfc_trans_scalar_assign): Flag is_alloc_lhs if
239         the rhs expression is neither an elemental nor a conversion
240         function.
242         PR fortran/83622
243         * trans-array.c (is_pointer_array): Remove unconditional return
244         of false for -fopenmp.
246 2018-01-13  Thomas Koenig <tkoenig@gcc.gnu.org>
247         <emsr@gcc.gnu.org>
249         PR fortran/83803
250         * dump-parse-tree.c (write_proc): Always emit closing parenthesis
251         for functions.
253 2018-01-10  Steven G. Kargl  <kargl@gcc.gnu.org>
255         PR fortran/82367
256         * resolve.c (resolve_allocate_expr): Check for NULL pointer.
258 2018-01-10  Steven G. Kargl  <kargl@gcc.gnu.org>
260         PR fortran/83093
261         * resolve.c (resolve_charlen): Check the type of cl->length
262         after resolution.
264 2018-01-10  Janne Blomqvist  <jb@gcc.gnu.org>
266         PR fortran/83740
267         * trans-array.c (gfc_trans_array_ctor_element): Fix formatting.
269 2018-01-10  Janne Blomqvist  <jb@gcc.gnu.org>
271         PR fortran/83740
272         * trans-array.c (gfc_trans_array_ctor_element): Convert RHS to the
273         LHS type when assigning.
275 2018-01-09  Steven G. Kargl  <kargl@gcc.gnu.org>
277         PR fortran/83742
278         * expr.c (gfc_is_simply_contiguous): Check for NULL pointer.
280 2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>
282         * match.c (gfc_match_allocate): Check for NULL pointer.
284 2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>
286         * expr.c (gfc_check_pointer_assign): Fix typo in comment.
288 2018-01-08  Paul Thomas  <pault@gcc.gnu.org>
290         PR fortran/83611
291         * decl.c (gfc_get_pdt_instance): If parameterized arrays have
292         an initializer, convert the kind parameters and add to the
293         component if the instance.
294         * trans-array.c (structure_alloc_comps): Add 'is_pdt_type' and
295         use it with case COPY_ALLOC_COMP. Call 'duplicate_allocatable'
296         for parameterized arrays. Clean up typos in comments. Convert
297         parameterized array initializers and copy into the array.
298         * trans-expr.c (gfc_trans_scalar_assign): Do a deep copy for
299         parameterized types.
300         *trans-stmt.c (trans_associate_var): Deallocate associate vars
301         as necessary, when they are PDT function results for example.
303         PR fortran/83731
304         * trans-array.c (structure_alloc_comps): Only compare len parms
305         when they are declared explicitly.
307 2018-01-06  Janne Blomqvist  <jb@gcc.gnu.org>
309         PR fortran/50892
310         * trans-expr.c (gfc_trans_pointer_assignment): fold_convert rhs to
311         lhs type.
313 2018-01-05  Janne Blomqvist  <jb@gcc.gnu.org>
315         PR fortran/78534
316         PR fortran/66310
317         * array.c (got_charlen): Use gfc_charlen_int_kind.
318         * class.c (gfc_find_derived_vtab): Use gfc_size_kind instead of
319         hardcoded kind.
320         (find_intrinsic_vtab): Likewise.
321         * decl.c (match_char_length): Use gfc_charlen_int_kind.
322         (add_init_expr_to_sym): Use gfc_charlen_t and gfc_charlen_int_kind.
323         (gfc_match_implicit): Use gfc_charlen_int_kind.
324         * dump-parse-tree.c (show_char_const): Use gfc_charlen_t and size_t.
325         (show_expr): Use HOST_WIDE_INT_PRINT_DEC.
326         * expr.c (gfc_get_character_expr): Length parameter of type
327         gfc_charlen_t.
328         (gfc_get_int_expr): Value argument of type HOST_WIDE_INT.
329         (gfc_extract_hwi): New function.
330         (simplify_const_ref): Make string_len of type gfc_charlen_t.
331         (gfc_simplify_expr): Use HOST_WIDE_INT for substring refs.
332         * frontend-passes.c (optimize_trim): Use gfc_charlen_int_kind.
333         * gfortran.h (gfc_mpz_get_hwi): New prototype.
334         (gfc_mpz_set_hwi): Likewise.
335         (gfc_charlen_t): New typedef.
336         (gfc_expr): Use gfc_charlen_t for character lengths.
337         (gfc_size_kind): New extern variable.
338         (gfc_extract_hwi): New prototype.
339         (gfc_get_character_expr): Use gfc_charlen_t for character length.
340         (gfc_get_int_expr): Use HOST_WIDE_INT type for value argument.
341         * gfortran.texi: Update description of hidden string length argument.
342         * iresolve.c (check_charlen_present): Use gfc_charlen_int_kind.
343         (gfc_resolve_char_achar): Likewise.
344         (gfc_resolve_repeat): Pass string length directly without
345         temporary, use gfc_charlen_int_kind.
346         (gfc_resolve_transfer): Use gfc_charlen_int_kind.
347         * match.c (select_intrinsic_set_tmp): Use HOST_WIDE_INT for charlen.
348         * misc.c (gfc_mpz_get_hwi): New function.
349         (gfc_mpz_set_hwi): New function.
350         * module.c (atom_int): Change type from int to HOST_WIDE_INT.
351         (parse_integer): Don't complain about large integers.
352         (write_atom): Use HOST_WIDE_INT for integers.
353         (mio_integer): Handle integer type mismatch.
354         (mio_hwi): New function.
355         (mio_intrinsic_op): Use HOST_WIDE_INT.
356         (mio_array_ref): Likewise.
357         (mio_expr): Likewise.
358         * primary.c (match_substring): Use gfc_charlen_int_kind.
359         * resolve.c (resolve_substring_charlen): Use gfc_charlen_int_kind.
360         (resolve_character_operator): Likewise.
361         (resolve_assoc_var): Likewise.
362         (resolve_select_type): Use HOST_WIDE_INT for charlen, use snprintf.
363         (resolve_charlen): Use mpz_sgn to determine sign.
364         * simplify.c (gfc_simplify_repeat): Use HOST_WIDE_INT/gfc_charlen_t
365         instead of long.
366         * symbol.c (generate_isocbinding_symbol): Use gfc_charlen_int_kind.
367         * target-memory.c (size_character): Length argument of type
368         gfc_charlen_t.
369         (gfc_encode_character): Likewise.
370         (gfc_interpret_character): Use gfc_charlen_t.
371         * target-memory.h (gfc_encode_character): Modify prototype.
372         * trans-array.c (gfc_trans_array_ctor_element): Use existing type.
373         (get_array_ctor_var_strlen): Use gfc_conv_mpz_to_tree_type.
374         (trans_array_constructor): Use existing type.
375         (get_array_charlen): Likewise.
376         * trans-const.c (gfc_conv_mpz_to_tree_type): New function.
377         * trans-const.h (gfc_conv_mpz_to_tree_type): New prototype.
378         * trans-decl.c (gfc_trans_deferred_vars): Use existing type.
379         (add_argument_checking): Likewise.
380         * trans-expr.c (gfc_class_len_or_zero_get): Build const of type
381         gfc_charlen_type_node.
382         (gfc_conv_intrinsic_to_class): Use gfc_charlen_int_kind instead of
383         4, fold_convert to correct type.
384         (gfc_conv_class_to_class): Build const of type size_type_node for
385         size.
386         (gfc_copy_class_to_class): Likewise.
387         (gfc_conv_string_length): Use same type in expression.
388         (gfc_conv_substring): Likewise, use HOST_WIDE_INT for charlen.
389         (gfc_conv_string_tmp): Make sure len is of the right type.
390         (gfc_conv_concat_op): Use same type in expression.
391         (gfc_conv_procedure_call): Likewise.
392         (fill_with_spaces): Comment out memset() block due to spurious
393         -Wstringop-overflow warnings.
394         (gfc_trans_string_copy): Use gfc_charlen_type_node.
395         (alloc_scalar_allocatable_for_subcomponent_assignment):
396         fold_convert to right type.
397         (gfc_trans_subcomponent_assign): Likewise.
398         (trans_class_vptr_len_assignment): Build const of correct type.
399         (gfc_trans_pointer_assignment): Likewise.
400         (alloc_scalar_allocatable_for_assignment): fold_convert to right
401         type in expr.
402         (trans_class_assignment): Build const of correct type.
403         * trans-intrinsic.c (gfc_conv_associated): Likewise.
404         (gfc_conv_intrinsic_repeat): Do calculation in sizetype.
405         * trans-io.c (gfc_build_io_library_fndecls): Use
406         gfc_charlen_type_node for character lengths.
407         (set_string): Convert to right type in assignment.
408         * trans-stmt.c (gfc_trans_label_assign): Build const of
409         gfc_charlen_type_node.
410         (trans_associate_var): Likewise.
411         (gfc_trans_character_select): Likewise.
412         (gfc_trans_allocate): Likewise, don't typecast strlen result.
413         (gfc_trans_deallocate): Don't typecast strlen result.
414         * trans-types.c (gfc_size_kind): New variable.
415         (gfc_init_types): Determine gfc_charlen_int_kind and gfc_size_kind
416         from size_type_node.
417         * trans-types.h: Fix comment.
419 2018-01-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
421         PR fortran/83683
422         PR fortran/45689
423         * check.c (gfc_check_eoshift): Check for string length and
424         for conformance of boundary.
425         * intrinsic.c (add_functions): Add gfc_simplify_eoshift.
426         * intrinsic.h: Add prototype for gfc_simplify_eoshift.
427         * simplify.c (gfc_simplify_eoshift): New function.
429 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
430             Alan Hayward  <alan.hayward@arm.com>
431             David Sherwood  <david.sherwood@arm.com>
433         * trans-types.c (gfc_type_for_mode): Handle MODE_VECTOR_BOOL.
435 2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
436             Alan Hayward  <alan.hayward@arm.com>
437             David Sherwood  <david.sherwood@arm.com>
439         * trans-types.c (gfc_type_for_mode): Check valid_vector_subparts_p.
441 2018-01-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
443         PR fortran/83664
444         * check.c (gfc_check_eoshift): Error for missing boundary if array
445         is not one of the standard types.
447 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
449         Update copyright years.
451         * gfortranspec.c (lang_specific_driver): Update copyright notice
452         dates.
453         * gfc-internals.texi: Bump @copying's copyright year.
454         * gfortran.texi: Ditto.
455         * intrinsic.texi: Ditto.
456         * invoke.texi: Ditto.
458 2017-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
460         PR fortran/45689
461         * intrinsic.c (add_function): Add gfc_simplify_maxloc and
462         gfc_simplify_minloc to maxloc and minloc, respectively.
463         * intrinsic.h: Add prototypes for gfc_simplify_minloc
464         and gfc_simplify_maxloc.
465         * simplify.c (min_max_chose): Adjust prototype.  Modify function
466         to have a return value which indicates if the extremum was found.
467         (is_constant_array_expr): Fix typo in comment.
468         (simplify_minmaxloc_to_scalar): New function.
469         (simplify_minmaxloc_nodim): New function.
470         (new_array): New function.
471         (simplify_minmaxloc_to_array): New function.
472         (gfc_simplify_minmaxloc): New function.
473         (simplify_minloc): New function.
474         (simplify_maxloc): New function.
476 2018-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
478         PR fortran/45689
479         PR fortran/83650
480         * simplify.c (gfc_simplify_cshift): Re-implement to allow full
481         range of arguments.
483 2018-01-01  Paul Thomas  <pault@gcc.gnu.org>
485         PR fortran/83076
486         * resolve.c (resolve_fl_derived0): Add caf_token fields for
487         allocatable and pointer scalars, when -fcoarray selected.
488         * trans-types.c (gfc_copy_dt_decls_ifequal): Copy the token
489         field as well as the backend_decl.
490         (gfc_get_derived_type): Flag GFC_FCOARRAY_LIB for module
491         derived types that are not vtypes. Components with caf_token
492         attribute are pvoid types. For a component requiring it, find
493         the caf_token field and have the component token field point to
494         its backend_decl.
496         PR fortran/83319
497         *trans-types.c (gfc_get_array_descriptor_base): Add the token
498         field to the descriptor even when codimen not set.
500 Copyright (C) 2018 Free Software Foundation, Inc.
502 Copying and distribution of this file, with or without modification,
503 are permitted in any medium without royalty provided the copyright
504 notice and this notice are preserved.