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