2011-01-31 Tobias Burnus <burnus@net-b.de>
[official-gcc.git] / gcc / fortran / ChangeLog
blobecdf2defe16d943e0731e8c0dcde1c7122705906
1 2011-01-31  Tobias Burnus  <burnus@net-b.de>
3         PR fortran/47042
4         * resolve.c (resolve_fl_procedure): Reject stmt functions
5         with pointer/allocatable attribute.
7 2011-01-31  Tobias Burnus  <burnus@net-b.de>
9         PR fortran/47042
10         * interface.c (gfc_procedure_use): Add explicit interface check for
11         pointer/allocatable functions.
13 2011-01-30  Paul Thomas  <pault@gcc.gnu.org>
15         PR fortran/47523
16         * trans-expr.c (gfc_trans_assignment_1): If the rhs is an op
17         expr and is assigned to a deferred character length scalar,
18         make sure that the function is called before reallocation,
19         so that the length is available. Include procedure pointer
20         and procedure pointer component rhs as well.
22         PR fortran/45170
23         PR fortran/35810
24         PR fortran/47350
25         * gfortran.dg/allocatable_function_5.f90: New test not added by
26         mistake on 2011-01-28.
28 2011-01-29  Tobias Burnus  <burnus@net-b.de>
30         PR fortran/47531
31         * check.c (gfc_check_shape): Support kind argument in SHAPE.
32         * intrinsic.c (add_functions): Ditto.
33         * resolve.c (gfc_resolve_shape): Ditto.
34         * simplify.c (gfc_simplify_shape): Ditto.
35         * intrinsic.h (gfc_check_shape, gfc_resolve_shape,
36         gfc_simplify_shape): Update prototypes.
37         * intrinisc.text (SHAPE): Document kind argument.
39 2011-01-28  Tobias Burnus  <burnus@net-b.de>
41         PR fortran/47507
42         * resolve.c (resolve_formal_arglist): Allow arguments with VALUE
43         attribute also without INTENT.
45 2011-01-28  Tobias Burnus  <burnus@net-b.de>
47         * gfortran.texi (Fortran 2003 status): Mention support for
48         nonconstant namelist variables.
50 2011-01-28  Paul Thomas  <pault@gcc.gnu.org>
51             Tobias Burnus  <burnus@gcc.gnu.org>
53         PR fortran/45170
54         PR fortran/35810
55         PR fortran/47350
56         * interface.c (compare_actual_formal): An allocatable or pointer
57         deferred length actual is only allowed if the formal argument
58         is also deferred length. Clean up whitespace.
59         * trans-expr.c (gfc_conv_procedure_call): Pass string length for
60         deferred character length formal arguments by reference. Do the
61         same for function results.
62         (gfc_trans_pointer_assignment): Do not do runtime check of lhs
63         and rhs character lengths, if deferred length lhs.  In this case
64         set the lhs character length to that of the rhs.
65         (gfc_conv_string_parameter): Remove assert that string length is
66         an integer type.
67         (is_scalar_reallocatable_lhs): New function.
68         (alloc_scalar_allocatable_for_assignment): New function.
69         (gfc_trans_assignment_1): Call above new function. If the rhs is
70         a deferred character length itself, makes ure that the function
71         is called before reallocation, so that the length is available.
72         (gfc_trans_asssignment): Remove error about assignment to
73         deferred length character variables.
74         * gfortran.texi : Update entry about (re)allocation on
75         assignment.
76         * trans-stmt.c (gfc_trans_allocate): Add code to handle deferred
77         length character variables.
78         * module.c (mio_typespec): Transfer deferred characteristic.
79         * trans-types.c (gfc_get_function_type): New code to generate
80         hidden typelist, so that those character lengths that are
81         passed by reference get the right type.
82         * resolve.c (resolve_contained_fntype): Supress error for
83         deferred character length functions.
84         (resolve_function, resolve_fl_procedure) The same.
85         (check_symbols): Remove the error that support for
86         entity with deferred type parameter is not yet implemented.
87         (resolve_fl_derived): The same.
88         match.c (alloc_opt_list): Allow MOLD for deferred length object.
89         * trans-decl.c (gfc_get_symbol_decl): For deferred character
90         length dummies, generate a local variable for string length.
91         (create_function_arglist): Hidden length can be a pointer.
92         (gfc_trans_deferred_vars): For deferred character length
93         results and dummies, assign the string length to the local
94         variable from the hidden argument on entry and the other way
95         round on exit, as appropriate.
97 2011-01-27  Tobias Burnus  <burnus@net-b.de>
99         PR fortran/47474
100         * trans-decl.c (gfc_generate_function_code): Fix init
101         of allocatable result variable with allocatable components.
103 2011-01-27  Tobias Burnus  <burnus@net-b.de>
105         PR fortran/47472
106         * options.c (gfc_handle_module_path_options): Save
107         module path without trailing slash as include path.
109 2011-01-25  Tobias Burnus  <burnus@net-b.de>
111         PR fortran/47448
112         * interface.c (gfc_check_operator_interface): Fix
113         defined-assignment check.
115 2011-01-23  Tobias Burnus  <burnus@net-b.de>
117         PR fortran/47421
118         * trans-decl.c (gfc_trans_deferred_vars): Do not nullify
119         scalar allocatable dummy arguments.
121 2011-01-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
123         PR fortran/38536
124         * resolve.c (gfc_iso_c_func_interface):  For C_LOC,
125         check for array sections followed by component references
126         which are illegal.  Also check for coindexed arguments.
128 2011-01-22  Tobias Burnus  <burnus@net-b.de>
130         PR fortran/47399
131         * primary.c (gfc_match_varspec): Relax gcc_assert to allow for
132         PARAMETER TBP.
134 2011-01-21  Tobias Burnus  <burnus@net-b.de>
136         PR fortran/47394
137         * error.c (gfc_error_now, gfc_fatal_error, gfc_error_check):
138         Use defined instead of magic number exit status codes.
139         * scanner.c (include_line, gfc_new_file): Ditto.
141 2011-01-21  Tobias Burnus  <burnus@net-b.de>
143         PR fortran/47377
144         * expr.c (gfc_check_pointer_assign): Reject expr data-targets
145         without pointer attribute.
147 2011-01-18  Janus Weil  <janus@gcc.gnu.org>
149         PR fortran/47240
150         * resolve.c (expression_rank): Fix rank of procedure poiner components.
151         * trans-expr.c (gfc_conv_procedure_call): Take care of procedure
152         pointer components as actual arguments.
154 2011-01-17  Jakub Jelinek  <jakub@redhat.com>
156         PR fortran/47331
157         * gfortran.h (struct gfc_omp_saved_state): New type.
158         (gfc_omp_save_and_clear_state, gfc_omp_restore_state): New prototypes.
159         * resolve.c (resolve_global_procedure): Call it around gfc_resolve
160         call.
161         * openmp.c (gfc_omp_save_and_clear_state, gfc_omp_restore_state): New
162         functions.
164 2011-01-17  Tobias Burnus  <burnus@net-b.de>
166         PR fortran/47327
167         * invoke.texi (Options to request or suppress errors
168         and warnings): Fix cross link.
170 2011-01-15  Tobias Burnus  <burnus@net-b.de>
172         * gfortran.texi: Update Fortran 2003 Status section.
174         PR fortran/47177
175         * invoke.texi: Add missing "-E" to the -dM example.
177 2011-01-13  Tobias Burnus  <burnus@net-b.de>
179         PR fortran/47268
180         * intrinsic.texi (get_command_argument, get_environment_variable):
181         Mark arguments as optional in the Arguments section.
183 2011-01-13  Kai Tietz  <kai.tietz@onevision.com>
184             Tobias Burnus  <burnus@net-b.de>
186         PR fortran/47260
187         * trans-decl.c (gfc_get_extern_function_decl,
188         build_function_decl): Set TREE_PUBLIC/TREE_EXTERNAL before
189         calling decl_attributes.
191 2011-01-13  Tobias Burnus  <burnus@net-b.de>
192             Mikael Morin  <mikael@gcc.gnu.org>
194         PR fortran/45848
195         PR fortran/47204
196         * gfortran.h (gfc_code): Move union ext's case_list into
197         the struct block.
198         * dump-parse-tree.c (show_code_node): Adapt by prefixing case_list
199         by "block.".
200         * frontend-passes.c (gfc_code_walker): Ditto.
201         * match.c (gfc_match_goto, gfc_match_call, gfc_match_case,
202         gfc_match_type_is, gfc_match_class_is): Ditto.
203         * resolve.c (resolve_select, resolve_select_type): Ditto.
204         * st.c (gfc_free_statement): Ditto.
205         * trans-stmt.c (gfc_trans_integer_select, gfc_trans_logical_select,
206         gfc_trans_character_select): Ditto.
207         * parse.c (resolve_all_program_units): For error recovery, avoid
208         segfault is proc_name is NULL.
210 2011-01-11  Paul Thomas  <pault@gcc.gnu.org>
212         PR fortran/47051
213         * trans-array.c (gfc_alloc_allocatable_for_assignment): Change
214         to be standard compliant by testing for shape rather than size
215         before skipping reallocation. Improve comments.
217 2011-01-09  Janus Weil  <janus@gcc.gnu.org>
219         PR fortran/47224
220         * resolve.c (resolve_actual_arglist): Remove unneeded and buggy piece
221         of code.
223 2011-01-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
225         PR fortran/38536
226         * resolve.c (is_scalar_expr_ptr):  For a substring reference,
227         use gfc_dep_compare_expr to compare start and end expession.
228         Add FIXME for using gfc_deb_compare_expr elsewhere.
230 2011-01-09  Janus Weil  <janus@gcc.gnu.org>
232         PR fortran/46313
233         * class.c (get_unique_type_string): Make type name start with upper
234         case letter.
236 2011-01-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
238         PR fortran/46405
239         * invoke.texi:  Mention -ffree-line-length-none and
240         -ffixed-line-length-none for preprocessing.
242 2011-01-08  Paul Thomas  <pault@gcc.gnu.org>
244         PR fortran/46896
245         * trans-expr.c (gfc_conv_procedure_call): With a non-copying
246         procedure argument (eg TRANSPOSE) use a temporary if there is
247         any chance of aliasing due to host or use association.
248         (arrayfunc_assign_needs_temporary): Correct logic for function
249         results and do not use a temporary for implicitly PURE
250         variables.  Use a temporary for Cray pointees.
251         * symbol.c (gfc_add_save): Explicit SAVE not compatible with
252         implicit pureness of containing procedure.
253         * decl.c (match_old_style_init, gfc_match_data): Where decl
254         would fail in PURE procedure, set implicit_pure to zero.
255         * gfortran.h : Add implicit_pure to structure symbol_attr and
256         add prototype for function gfc_implicit_pure.
257         * expr.c (gfc_check_pointer_assign, gfc_check_vardef_context):
258         Where decl would fail in PURE procedure, reset implicit_pure.
259         * io.c (match_vtag, gfc_match_open, gfc_match_close,
260         gfc_match_print, gfc_match_inquire, gfc_match_wait): The same.
261         * match.c (gfc_match_critical, gfc_match_stopcode,
262         sync_statement, gfc_match_allocate, gfc_match_deallocate): The
263         same.
264         * parse.c (decode_omp_directive): The same.
265         (parse_contained): If not PURE, set implicit pure attribute.
266         * resolve.c (resolve_formal_arglist, resolve_structure_cons,
267         resolve_function, resolve_ordinary_assign) : The same.
268         (gfc_implicit_pure): New function.
269         * module.c (mio_symbol_attribute): Introduce AB_IMPLICIT_PURE
270         to ab_attribute enum and use it in this function.
272 2011-01-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
274         PR fortran/45777
275         * symbol.c (gfc_symbols_could_alias):  Strip gfc_ prefix,
276         make static and move in front of its only caller, to ...
277         * trans-array.c (symbols_could_alias): ... here.
278         Pass information about pointer and target status as
279         arguments.  Allocatable arrays don't alias anything
280         unless they have the POINTER attribute.
281         (gfc_could_be_alias):  Keep track of pointer and target
282         status when following references.  Also check if typespecs
283         of components match those of other components or symbols.
285 2011-01-07  Tobias Burnus  <burnus@net-b.de>
287         PR fortran/41580
288         * class.c (gfc_build_class_symbol): Mark __vtab as attr.vtab.
289         * intrinsic.c (add_functions): Use simplify functions for
290         EXTENDS_TYPE_OF and SAME_TYPE_AS.
291         * intrinsic.h (gfc_simplify_extends_type_of,
292         gfc_simplify_same_type_as): New prototypes.
293         * simplify.c (is_last_ref_vtab, gfc_simplify_extends_type_of,
294         gfc_simplify_same_type_as): New functions.
296 2011-01-07  Janus Weil  <janus@gcc.gnu.org>
298         PR fortran/47189
299         PR fortran/47194
300         * gfortran.h (gfc_lval_expr_from_sym): Moved prototype.
301         * class.c (gfc_class_null_initializer): Initialize _vptr to declared
302         type.
303         * expr.c (gfc_lval_expr_from_sym): Moved here from symbol.c.
304         * resolve.c (resolve_deallocate_expr): _data component will be added
305         at translation stage.
306         * symbol.c (gfc_lval_expr_from_sym): Moved to expr.c.
307         * trans-stmt.c (gfc_trans_deallocate): Reset _vptr to declared type.
309 2011-01-06  Daniel Franke  <franke.daniel@gmail.com>
311         PR fortran/33117
312         PR fortran/46478
313         * parse.c (parse_interface): Remove check for procedure types.
314         * interface.c (check_interface0): Verify that procedures are
315         either all SUBROUTINEs or all FUNCTIONs.
317 2011-01-05  Janus Weil  <janus@gcc.gnu.org>
319         PR fortran/47180
320         * trans-expr.c (gfc_trans_class_assign): Bugfix for r168524 (make sure
321         'vtab' is initialized).
323 2011-01-05  Janus Weil  <janus@gcc.gnu.org>
325         PR fortran/47180
326         * trans-expr.c (gfc_trans_class_assign): For a polymorphic NULL pointer
327         assignment, set the _vptr component to the declared type.
329 2011-01-05  Thomas Koenig  <tkoenig@gcc.gnu.org>
331         PR fortran/46017
332         * resolve.c (resolve_allocate_deallocate): Follow references to
333         check for duplicate occurence of allocation/deallocation objects.
335 2011-01-05  Janus Weil  <janus@gcc.gnu.org>
337         PR fortran/47024
338         * trans-decl.c (gfc_trans_deferred_vars): Initialize the _vpr component
339         of polymorphic allocatables according to their declared type.
341 2011-01-04  Janus Weil  <janus@gcc.gnu.org>
343         PR fortran/46448
344         * class.c (gfc_find_derived_vtab): Set the module field for the copying
345         routine to make sure it receives module name mangling.
347 2011-01-03  Jakub Jelinek  <jakub@redhat.com>
349         * gfortranspec.c (lang_specific_driver): Update copyright notice
350         dates.
352 2011-01-03  Janus Weil  <janus@gcc.gnu.org>
354         * intrinsic.texi (LEADZ): Fix example.
356 2011-01-02  Janus Weil  <janus@gcc.gnu.org>
358         PR fortran/46408
359         * class.c (gfc_find_derived_vtab): Use EXEC_INIT_ASSIGN for __copy_
360         routine.
363 Copyright (C) 2011 Free Software Foundation, Inc.
365 Copying and distribution of this file, with or without modification,
366 are permitted in any medium without royalty provided the copyright
367 notice and this notice are preserved.