2011-02-18 Janus Weil <janus@gcc.gnu.org>
[official-gcc.git] / gcc / fortran / ChangeLog
blob8d7614ad5109ad1f2b7d5274ad289df8e80a5333
1 2011-02-18  Janus Weil  <janus@gcc.gnu.org>
3         PR fortran/47767
4         * gfortran.h (gfc_check_access): Removed prototype.
5         (gfc_check_symbol_access): Added prototype.
6         * module.c (gfc_check_access): Renamed to 'check_access', made static.
7         (gfc_check_symbol_access): New function, basically a shortcut for
8         'check_access'.
9         (write_dt_extensions,write_symbol0,write_generic,write_symtree): Use
10         'gfc_check_symbol_access'.
11         (write_operator,write_module): Renamed 'gfc_check_access'.
12         * resolve.c (resolve_fl_procedure,resolve_fl_derived,
13         resolve_fl_namelist,resolve_symbol,resolve_fntype): Use
14         'gfc_check_symbol_access'.
16 2011-02-16  Janus Weil  <janus@gcc.gnu.org>
18         PR fortran/47745
19         * class.c (gfc_build_class_symbol): Set 'class_ok' attribute.
20         * decl.c (build_sym,attr_decl1): Move setting of 'class_ok' into
21         'gfc_build_class_symbol'.
22         (gfc_match_decl_type_spec): Reject unlimited polymorphism.
23         * interface.c (matching_typebound_op): Check for 'class_ok' attribute.
24         * match.c (select_type_set_tmp): Move setting of 'class_ok' into
25         'gfc_build_class_symbol'.
26         * primary.c (gfc_variable_attr): Check for 'class_ok' attribute.
28 2011-02-15  Steven G. Kargl  <kargl@gcc.gnu.org>
30         PR fortran/47633
31         . simplify.c (gfc_simplify_compiler_version): Fix off-by-one issue.
33 2011-02-14  Janus Weil  <janus@gcc.gnu.org>
35         PR fortran/47730
36         * parse.c (gfc_build_block_ns): Commit 'block@' symbol.
38 2011-02-14  Janus Weil  <janus@gcc.gnu.org>
40         PR fortran/47728
41         * class.c (gfc_build_class_symbol): Give a fatal error on polymorphic
42         arrays.
43         * primary.c (gfc_match_varspec): Avoid ICE for invalid class
44         declaration.
46 2011-02-14  Janus Weil  <janus@gcc.gnu.org>
48         PR fortran/47349
49         * interface.c (get_expr_storage_size): Handle derived-type components.
51 2011-02-13  Tobias Burnus  <burnus@net-b.de>
53         PR fortran/47569
54         * interface.c (compare_parameter): Avoid ICE with
55         character components.
57 2011-02-12  Janus Weil  <janus@gcc.gnu.org>
59         * class.c (gfc_build_class_symbol): Reject polymorphic arrays.
60         * decl.c (build_sym,build_struct,attr_decl1): Use return value of
61         'gfc_build_class_symbol'.
63 2011-02-12  Michael Matz  <matz@suse.de>
64             Janus Weil  <janus@gcc.gnu.org>
65             Tobias Burnus  <burnus@net-b.de>
67         PR fortran/45586
68         * trans-expr.c (conv_parent_component_references): Avoid unintendent
69         skipping of parent compounds.
71 2011-02-11  Tobias Burnus  <burnus@net-b.de>
73         PR fortran/47550
74         * resolve.c (resolve_formal_arglist): PURE with VALUE
75         and no INTENT: Add -std= diagnostics.
77 2011-02-09  Janus Weil  <janus@gcc.gnu.org>
79         PR fortran/47352
80         * resolve.c (resolve_procedure_interface): If interface has a result
81         variable, copy the typespec and set result pointer to self.
83 2011-02-09  Janus Weil  <janus@gcc.gnu.org>
85         PR fortran/47463
86         * resolve.c (resolve_typebound_subroutine): Remove erroneous line.
88 2011-02-09  Janus Weil  <janus@gcc.gnu.org>
90         PR fortran/47637
91         * trans-decl.c (init_intent_out_dt): Handle CLASS arguments.
93 2011-02-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
95         * io.c (match_io_element): Do not set dt if not inquire.
97 2011-02-08  Janus Weil  <janus@gcc.gnu.org>
99         PR fortran/45290
100         * expr.c (gfc_check_assign_symbol): Reject pointers as pointer
101         initialization target.
103 2011-02-07  Janne Blomqvist  <jb@gcc.gnu.org>
104             Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
106         * gfortran.texi (Thread-safety): texinfo styling fixes.
107         * intrinsic.texi: Likewise.
109 2011-02-06  Janne Blomqvist  <jb@gcc.gnu.org>
111         * gfortran.texi (Compiler Characteristics): Add reference to
112         thread-safety section.
114 2011-02-06  Janne Blomqvist  <jb@gcc.gnu.org>
116         * gfortran.texi (Thread-safety): New section.
117         * intrinsic.texi (EXECUTE_COMMAND_LINE): Mention thread-safety.
118         (GETENV): Likewise.
119         (GET_ENVIRONMENT_VARIABLE): Likewise.
120         (SYSTEM): Likewise.
122 2011-02-06  Paul Thomas  <pault@gcc.gnu.org>
124         PR fortran/47592
125         * trans-stmt.c (gfc_trans_allocate): For deferred character
126         length allocations with SOURCE, store to the values and string
127         length to avoid calculating twice.  Replace gfc_start_block
128         with gfc_init_block to avoid unnecessary contexts and to keep
129         declarations of temporaries where they should be. Tidy up the
130         code a bit.
132 2011-02-05  Janne Blomqvist  <jb@gcc.gnu.org>
134         PR fortran/42434
135         * intrinsic.texi (SYSTEM_CLOCK): Update documentation.
137 2011-02-02  Janus Weil  <janus@gcc.gnu.org>
138             Paul Thomas  <pault@gcc.gnu.org>
140         PR fortran/47082
141         * trans-expr.c (gfc_trans_class_init_assign): Add call to
142         gfc_get_derived_type.
143         * module.c (read_cleanup): Do not use unique_symtrees for vtabs
144         or vtypes.
146 2011-02-02  Janus Weil  <janus@gcc.gnu.org>
148         PR fortran/47572
149         * resolve.c (resolve_fl_variable): Handle polymorphic allocatables.
151 2011-02-01  Janus Weil  <janus@gcc.gnu.org>
153         PR fortran/47565
154         * trans-expr.c (gfc_conv_structure): Handle constructors for procedure
155         pointer components with allocatable result.
157 2011-01-31  Janus Weil  <janus@gcc.gnu.org>
159         PR fortran/47455
160         * trans-expr.c (gfc_conv_procedure_call): Handle procedure pointers
161         with pointer or allocatable result.
163 2011-01-31  Paul Thomas  <pault@gcc.gnu.org>
165         PR fortran/47519
166         * trans-stmt.c (gfc_trans_allocate): Improve handling of
167         deferred character lengths with SOURCE.
168         * iresolve.c (gfc_resolve_repeat): Calculate character
169         length from source length and ncopies.
170         * dump-parse-tree.c (show_code_node): Show MOLD and SOURCE
171         expressions for ALLOCATE.
173 2011-01-31  Janus Weil  <janus@gcc.gnu.org>
175         PR fortran/47463
176         * resolve.c (resolve_typebound_subroutine): Bug fix for the case of
177         an argument of a typebound assignment being a component.
179 2011-01-31  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
181         * gfortranspec.c (add_arg_libgfortran) [HAVE_LD_STATIC_DYNAMIC] Use
182         LD_STATIC_OPTION, LD_DYNAMIC_OPTION.
184 2011-01-31  Tobias Burnus  <burnus@net-b.de>
186         PR fortran/47042
187         * resolve.c (resolve_fl_procedure): Reject stmt functions
188         with pointer/allocatable attribute.
190 2011-01-31  Tobias Burnus  <burnus@net-b.de>
192         PR fortran/47042
193         * interface.c (gfc_procedure_use): Add explicit interface check for
194         pointer/allocatable functions.
196 2011-01-30  Paul Thomas  <pault@gcc.gnu.org>
198         PR fortran/47523
199         * trans-expr.c (gfc_trans_assignment_1): If the rhs is an op
200         expr and is assigned to a deferred character length scalar,
201         make sure that the function is called before reallocation,
202         so that the length is available. Include procedure pointer
203         and procedure pointer component rhs as well.
205         PR fortran/45170
206         PR fortran/35810
207         PR fortran/47350
208         * gfortran.dg/allocatable_function_5.f90: New test not added by
209         mistake on 2011-01-28.
211 2011-01-29  Tobias Burnus  <burnus@net-b.de>
213         PR fortran/47531
214         * check.c (gfc_check_shape): Support kind argument in SHAPE.
215         * intrinsic.c (add_functions): Ditto.
216         * resolve.c (gfc_resolve_shape): Ditto.
217         * simplify.c (gfc_simplify_shape): Ditto.
218         * intrinsic.h (gfc_check_shape, gfc_resolve_shape,
219         gfc_simplify_shape): Update prototypes.
220         * intrinisc.text (SHAPE): Document kind argument.
222 2011-01-28  Tobias Burnus  <burnus@net-b.de>
224         PR fortran/47507
225         * resolve.c (resolve_formal_arglist): Allow arguments with VALUE
226         attribute also without INTENT.
228 2011-01-28  Tobias Burnus  <burnus@net-b.de>
230         * gfortran.texi (Fortran 2003 status): Mention support for
231         nonconstant namelist variables.
233 2011-01-28  Paul Thomas  <pault@gcc.gnu.org>
234             Tobias Burnus  <burnus@gcc.gnu.org>
236         PR fortran/45170
237         PR fortran/35810
238         PR fortran/47350
239         * interface.c (compare_actual_formal): An allocatable or pointer
240         deferred length actual is only allowed if the formal argument
241         is also deferred length. Clean up whitespace.
242         * trans-expr.c (gfc_conv_procedure_call): Pass string length for
243         deferred character length formal arguments by reference. Do the
244         same for function results.
245         (gfc_trans_pointer_assignment): Do not do runtime check of lhs
246         and rhs character lengths, if deferred length lhs.  In this case
247         set the lhs character length to that of the rhs.
248         (gfc_conv_string_parameter): Remove assert that string length is
249         an integer type.
250         (is_scalar_reallocatable_lhs): New function.
251         (alloc_scalar_allocatable_for_assignment): New function.
252         (gfc_trans_assignment_1): Call above new function. If the rhs is
253         a deferred character length itself, makes ure that the function
254         is called before reallocation, so that the length is available.
255         (gfc_trans_asssignment): Remove error about assignment to
256         deferred length character variables.
257         * gfortran.texi : Update entry about (re)allocation on
258         assignment.
259         * trans-stmt.c (gfc_trans_allocate): Add code to handle deferred
260         length character variables.
261         * module.c (mio_typespec): Transfer deferred characteristic.
262         * trans-types.c (gfc_get_function_type): New code to generate
263         hidden typelist, so that those character lengths that are
264         passed by reference get the right type.
265         * resolve.c (resolve_contained_fntype): Supress error for
266         deferred character length functions.
267         (resolve_function, resolve_fl_procedure) The same.
268         (check_symbols): Remove the error that support for
269         entity with deferred type parameter is not yet implemented.
270         (resolve_fl_derived): The same.
271         match.c (alloc_opt_list): Allow MOLD for deferred length object.
272         * trans-decl.c (gfc_get_symbol_decl): For deferred character
273         length dummies, generate a local variable for string length.
274         (create_function_arglist): Hidden length can be a pointer.
275         (gfc_trans_deferred_vars): For deferred character length
276         results and dummies, assign the string length to the local
277         variable from the hidden argument on entry and the other way
278         round on exit, as appropriate.
280 2011-01-27  Tobias Burnus  <burnus@net-b.de>
282         PR fortran/47474
283         * trans-decl.c (gfc_generate_function_code): Fix init
284         of allocatable result variable with allocatable components.
286 2011-01-27  Tobias Burnus  <burnus@net-b.de>
288         PR fortran/47472
289         * options.c (gfc_handle_module_path_options): Save
290         module path without trailing slash as include path.
292 2011-01-25  Tobias Burnus  <burnus@net-b.de>
294         PR fortran/47448
295         * interface.c (gfc_check_operator_interface): Fix
296         defined-assignment check.
298 2011-01-23  Tobias Burnus  <burnus@net-b.de>
300         PR fortran/47421
301         * trans-decl.c (gfc_trans_deferred_vars): Do not nullify
302         scalar allocatable dummy arguments.
304 2011-01-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
306         PR fortran/38536
307         * resolve.c (gfc_iso_c_func_interface):  For C_LOC,
308         check for array sections followed by component references
309         which are illegal.  Also check for coindexed arguments.
311 2011-01-22  Tobias Burnus  <burnus@net-b.de>
313         PR fortran/47399
314         * primary.c (gfc_match_varspec): Relax gcc_assert to allow for
315         PARAMETER TBP.
317 2011-01-21  Tobias Burnus  <burnus@net-b.de>
319         PR fortran/47394
320         * error.c (gfc_error_now, gfc_fatal_error, gfc_error_check):
321         Use defined instead of magic number exit status codes.
322         * scanner.c (include_line, gfc_new_file): Ditto.
324 2011-01-21  Tobias Burnus  <burnus@net-b.de>
326         PR fortran/47377
327         * expr.c (gfc_check_pointer_assign): Reject expr data-targets
328         without pointer attribute.
330 2011-01-18  Janus Weil  <janus@gcc.gnu.org>
332         PR fortran/47240
333         * resolve.c (expression_rank): Fix rank of procedure poiner components.
334         * trans-expr.c (gfc_conv_procedure_call): Take care of procedure
335         pointer components as actual arguments.
337 2011-01-17  Jakub Jelinek  <jakub@redhat.com>
339         PR fortran/47331
340         * gfortran.h (struct gfc_omp_saved_state): New type.
341         (gfc_omp_save_and_clear_state, gfc_omp_restore_state): New prototypes.
342         * resolve.c (resolve_global_procedure): Call it around gfc_resolve
343         call.
344         * openmp.c (gfc_omp_save_and_clear_state, gfc_omp_restore_state): New
345         functions.
347 2011-01-17  Tobias Burnus  <burnus@net-b.de>
349         PR fortran/47327
350         * invoke.texi (Options to request or suppress errors
351         and warnings): Fix cross link.
353 2011-01-15  Tobias Burnus  <burnus@net-b.de>
355         * gfortran.texi: Update Fortran 2003 Status section.
357         PR fortran/47177
358         * invoke.texi: Add missing "-E" to the -dM example.
360 2011-01-13  Tobias Burnus  <burnus@net-b.de>
362         PR fortran/47268
363         * intrinsic.texi (get_command_argument, get_environment_variable):
364         Mark arguments as optional in the Arguments section.
366 2011-01-13  Kai Tietz  <kai.tietz@onevision.com>
367             Tobias Burnus  <burnus@net-b.de>
369         PR fortran/47260
370         * trans-decl.c (gfc_get_extern_function_decl,
371         build_function_decl): Set TREE_PUBLIC/TREE_EXTERNAL before
372         calling decl_attributes.
374 2011-01-13  Tobias Burnus  <burnus@net-b.de>
375             Mikael Morin  <mikael@gcc.gnu.org>
377         PR fortran/45848
378         PR fortran/47204
379         * gfortran.h (gfc_code): Move union ext's case_list into
380         the struct block.
381         * dump-parse-tree.c (show_code_node): Adapt by prefixing case_list
382         by "block.".
383         * frontend-passes.c (gfc_code_walker): Ditto.
384         * match.c (gfc_match_goto, gfc_match_call, gfc_match_case,
385         gfc_match_type_is, gfc_match_class_is): Ditto.
386         * resolve.c (resolve_select, resolve_select_type): Ditto.
387         * st.c (gfc_free_statement): Ditto.
388         * trans-stmt.c (gfc_trans_integer_select, gfc_trans_logical_select,
389         gfc_trans_character_select): Ditto.
390         * parse.c (resolve_all_program_units): For error recovery, avoid
391         segfault is proc_name is NULL.
393 2011-01-11  Paul Thomas  <pault@gcc.gnu.org>
395         PR fortran/47051
396         * trans-array.c (gfc_alloc_allocatable_for_assignment): Change
397         to be standard compliant by testing for shape rather than size
398         before skipping reallocation. Improve comments.
400 2011-01-09  Janus Weil  <janus@gcc.gnu.org>
402         PR fortran/47224
403         * resolve.c (resolve_actual_arglist): Remove unneeded and buggy piece
404         of code.
406 2011-01-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
408         PR fortran/38536
409         * resolve.c (is_scalar_expr_ptr):  For a substring reference,
410         use gfc_dep_compare_expr to compare start and end expession.
411         Add FIXME for using gfc_deb_compare_expr elsewhere.
413 2011-01-09  Janus Weil  <janus@gcc.gnu.org>
415         PR fortran/46313
416         * class.c (get_unique_type_string): Make type name start with upper
417         case letter.
419 2011-01-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
421         PR fortran/46405
422         * invoke.texi:  Mention -ffree-line-length-none and
423         -ffixed-line-length-none for preprocessing.
425 2011-01-08  Paul Thomas  <pault@gcc.gnu.org>
427         PR fortran/46896
428         * trans-expr.c (gfc_conv_procedure_call): With a non-copying
429         procedure argument (eg TRANSPOSE) use a temporary if there is
430         any chance of aliasing due to host or use association.
431         (arrayfunc_assign_needs_temporary): Correct logic for function
432         results and do not use a temporary for implicitly PURE
433         variables.  Use a temporary for Cray pointees.
434         * symbol.c (gfc_add_save): Explicit SAVE not compatible with
435         implicit pureness of containing procedure.
436         * decl.c (match_old_style_init, gfc_match_data): Where decl
437         would fail in PURE procedure, set implicit_pure to zero.
438         * gfortran.h : Add implicit_pure to structure symbol_attr and
439         add prototype for function gfc_implicit_pure.
440         * expr.c (gfc_check_pointer_assign, gfc_check_vardef_context):
441         Where decl would fail in PURE procedure, reset implicit_pure.
442         * io.c (match_vtag, gfc_match_open, gfc_match_close,
443         gfc_match_print, gfc_match_inquire, gfc_match_wait): The same.
444         * match.c (gfc_match_critical, gfc_match_stopcode,
445         sync_statement, gfc_match_allocate, gfc_match_deallocate): The
446         same.
447         * parse.c (decode_omp_directive): The same.
448         (parse_contained): If not PURE, set implicit pure attribute.
449         * resolve.c (resolve_formal_arglist, resolve_structure_cons,
450         resolve_function, resolve_ordinary_assign) : The same.
451         (gfc_implicit_pure): New function.
452         * module.c (mio_symbol_attribute): Introduce AB_IMPLICIT_PURE
453         to ab_attribute enum and use it in this function.
455 2011-01-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
457         PR fortran/45777
458         * symbol.c (gfc_symbols_could_alias):  Strip gfc_ prefix,
459         make static and move in front of its only caller, to ...
460         * trans-array.c (symbols_could_alias): ... here.
461         Pass information about pointer and target status as
462         arguments.  Allocatable arrays don't alias anything
463         unless they have the POINTER attribute.
464         (gfc_could_be_alias):  Keep track of pointer and target
465         status when following references.  Also check if typespecs
466         of components match those of other components or symbols.
468 2011-01-07  Tobias Burnus  <burnus@net-b.de>
470         PR fortran/41580
471         * class.c (gfc_build_class_symbol): Mark __vtab as attr.vtab.
472         * intrinsic.c (add_functions): Use simplify functions for
473         EXTENDS_TYPE_OF and SAME_TYPE_AS.
474         * intrinsic.h (gfc_simplify_extends_type_of,
475         gfc_simplify_same_type_as): New prototypes.
476         * simplify.c (is_last_ref_vtab, gfc_simplify_extends_type_of,
477         gfc_simplify_same_type_as): New functions.
479 2011-01-07  Janus Weil  <janus@gcc.gnu.org>
481         PR fortran/47189
482         PR fortran/47194
483         * gfortran.h (gfc_lval_expr_from_sym): Moved prototype.
484         * class.c (gfc_class_null_initializer): Initialize _vptr to declared
485         type.
486         * expr.c (gfc_lval_expr_from_sym): Moved here from symbol.c.
487         * resolve.c (resolve_deallocate_expr): _data component will be added
488         at translation stage.
489         * symbol.c (gfc_lval_expr_from_sym): Moved to expr.c.
490         * trans-stmt.c (gfc_trans_deallocate): Reset _vptr to declared type.
492 2011-01-06  Daniel Franke  <franke.daniel@gmail.com>
494         PR fortran/33117
495         PR fortran/46478
496         * parse.c (parse_interface): Remove check for procedure types.
497         * interface.c (check_interface0): Verify that procedures are
498         either all SUBROUTINEs or all FUNCTIONs.
500 2011-01-05  Janus Weil  <janus@gcc.gnu.org>
502         PR fortran/47180
503         * trans-expr.c (gfc_trans_class_assign): Bugfix for r168524 (make sure
504         'vtab' is initialized).
506 2011-01-05  Janus Weil  <janus@gcc.gnu.org>
508         PR fortran/47180
509         * trans-expr.c (gfc_trans_class_assign): For a polymorphic NULL pointer
510         assignment, set the _vptr component to the declared type.
512 2011-01-05  Thomas Koenig  <tkoenig@gcc.gnu.org>
514         PR fortran/46017
515         * resolve.c (resolve_allocate_deallocate): Follow references to
516         check for duplicate occurence of allocation/deallocation objects.
518 2011-01-05  Janus Weil  <janus@gcc.gnu.org>
520         PR fortran/47024
521         * trans-decl.c (gfc_trans_deferred_vars): Initialize the _vpr component
522         of polymorphic allocatables according to their declared type.
524 2011-01-04  Janus Weil  <janus@gcc.gnu.org>
526         PR fortran/46448
527         * class.c (gfc_find_derived_vtab): Set the module field for the copying
528         routine to make sure it receives module name mangling.
530 2011-01-03  Jakub Jelinek  <jakub@redhat.com>
532         * gfortranspec.c (lang_specific_driver): Update copyright notice
533         dates.
535 2011-01-03  Janus Weil  <janus@gcc.gnu.org>
537         * intrinsic.texi (LEADZ): Fix example.
539 2011-01-02  Janus Weil  <janus@gcc.gnu.org>
541         PR fortran/46408
542         * class.c (gfc_find_derived_vtab): Use EXEC_INIT_ASSIGN for __copy_
543         routine.
546 Copyright (C) 2011 Free Software Foundation, Inc.
548 Copying and distribution of this file, with or without modification,
549 are permitted in any medium without royalty provided the copyright
550 notice and this notice are preserved.