OSDN Git Service

2012-01-29 Tobias Burnus <burnus@net-b.de>
[pf3gnuchains/gcc-fork.git] / gcc / fortran / ChangeLog
1 2012-01-29  Janne Blomqvist  <jb@gcc.gnu.org>
2
3         * module.c (pointer_info): Make true_name and module pointers
4         rather than arrays, order pointers before other fields.
5         (free_pi_tree): free true_name and module as well.
6         (mio_read_string): Rename to read_string.
7         (mio_write_string): Remove.
8         (load_commons): Use read_string.
9         (read_module): Use read_string rather than mio_internal_string.
10         (write_blank_common): Call write_atom directly.
11         (write_symbol): Likewise.
12
13 2012-01-29  Tobias Burnus  <burnus@net-b.de>
14
15         PR fortran/41600
16         * expr.c (gfc_default_initializer): Convert the values if
17         the type does not match.
18
19 2012-01-29  Tobias Burnus  <burnus@net-b.de>
20
21         PR fortran/51972
22         * trans-array.c (structure_alloc_comps): Fix assignment of
23         polymorphic components (polymorphic deep copying).
24
25 2012-01-29  Janne Blomqvist  <jb@gcc.gnu.org>
26
27         PR fortran/51808
28         * decl.c (set_binding_label): Make binding_label argument const.
29         (curr_binding_label): Constify.
30         * gfortran.h (gfc_symbol): Constify binding_label.
31         (gfc_common_head): Likewise.
32         (get_iso_c_sym): Likewise.
33         * match.c (gfc_match_name_C): Constify buffer argument.
34         * match.h (gfc_match_name_C): Likewise.
35         * resolve.c (set_name_and_label): Constify binding_label argument.
36         (gfc_iso_c_sub_interface): Constify binding_label variable.
37         * symbol.c (get_iso_c_sym): Constify binding_label argument.
38
39 2012-01-29  Janne Blomqvist  <jb@gcc.gnu.org>
40
41         PR fortran/51808
42         * decl.c (set_binding_label): Move prototype from match.h to here.
43         (curr_binding_label): Make a pointer rather than static array.
44         (build_sym): Check sym->binding_label pointer rather than array,
45         update set_binding_label call, handle curr_binding_label changes.
46         (set_binding_label): Handle new curr_binding_label, dest_label
47         double ptr, and sym->binding_label.
48         (verify_bind_c_sym): Handle sym->binding_label being a pointer.
49         (set_verify_bind_c_sym): Check sym->binding_label pointer rather
50         than array, update set_binding_label call.
51         (gfc_match_bind_c_stmt): Handle curr_binding_label change.
52         (match_procedure_decl): Update set_binding_label call.
53         (gfc_match_bind_c): Change binding_label to pointer, update
54         gfc_match_name_C call.
55         * gfortran.h (GFC_MAX_BINDING_LABEL_LEN): Remove macro.
56         (gfc_symbol): Make binding_label a pointer.
57         (gfc_common_head): Likewise.
58         * match.c (gfc_match_name_C): Heap allocate bind(C) name.
59         * match.h (gfc_match_name_C): Change prototype argument.
60         (set_binding_label): Move prototype to decl.c.
61         * module.c (struct pointer_info): Make binding_label a pointer.
62         (free_pi_tree): Free unused binding_label.
63         (mio_read_string): New function.
64         (mio_write_string): New function.
65         (load_commons): Redo reading of binding_label.
66         (read_module): Likewise.
67         (write_common_0): Change to write empty string instead of name if
68         no binding_label.
69         (write_blank_common): Write empty string for binding label.
70         (write_symbol): Change to write empty string instead of name if no
71         binding_label.
72         * resolve.c (gfc_iso_c_func_interface): Don't set binding_label.
73         (set_name_and_label): Make binding_label double pointer, use
74         asprintf.
75         (gfc_iso_c_sub_interface): Make binding_label a pointer.
76         (resolve_bind_c_comms): Handle cases if
77         gfc_common_head->binding_label is NULL.
78         (gfc_verify_binding_labels): sym->binding_label is a pointer.
79         * symbol.c (gfc_new_symbol): Rely on XCNEW zero init for
80         binding_label.
81         (gen_special_c_interop_ptr): Don't set binding label.
82         (generate_isocbinding_symbol): Insert binding_label into symbol
83         table.
84         (get_iso_c_sym): Use pointer assignment instead of strcpy.
85         * trans-common.c (gfc_sym_mangled_common_id): Handle
86         com->binding_label being a pointer.
87         * trans-decl.c (gfc_sym_mangled_identifier): Handle
88         sym->binding_label being a pointer.
89         (gfc_sym_mangled_function_id): Likewise.
90
91 2012-01-29  Tobias Burnus  <burnus@net-b.de>
92
93         PR fortran/52038
94         * resolve.c (symbol_as): Remove unused, accidentally
95         added function.
96
97 2012-01-28  Tobias Burnus  <burnus@net-b.de>
98
99         PR fortran/51972
100         * trans-stmt.c (gfc_trans_allocate): Properly check whether
101         we have a BT_CLASS which needs to be memset.
102
103 2012-01-27  Tobias Burnus  <burnus@net-b.de>
104
105         PR fortran/52022
106         * trans-expr.c (gfc_conv_procedure_call): Fix passing
107         of functions, which return allocatables.
108
109 2012-01-27  Tobias Burnus  <burnus@net-b.de>
110
111         PR fortran/52016
112         * resolve.c (resolve_formal_arglist): Fix elemental
113         constraint checks for polymorphic dummies also for
114         pointers.
115
116 2012-01-27  Tobias Burnus  <burnus@net-b.de>
117
118         PR fortran/51970
119         PR fortran/51977
120         * primary.c (gfc_match_varspec. gfc_match_rvalue): Set
121         handle array spec for BT_CLASS.
122         * expr.c (gfc_get_variable_expr, gfc_lval_expr_from_sym)
123         * frontend-passes.c (create_var): Ditto.
124         * resolve.c (resolve_actual_arglist, resolve_assoc_var): Ditto.
125         * trans-decl.c (gfc_trans_deferred_vars): Use class_pointer
126         instead of attr.pointer.
127         (gfc_generate_function_code): Use CLASS_DATA (sym) for BT_CLASS.
128         * trans-intrinsic.c (conv_intrinsic_move_alloc): Move assert.
129         * trans-stmt.c (trans_associate_var): Ask for the descriptor.
130
131 2012-01-27  Tobias Burnus  <burnus@net-b.de>
132
133         PR fortran/51953
134         * match.c (gfc_match_allocate): Allow more than allocate
135         object with SOURCE=.
136
137 2012-01-27  Tobias Burnus  <burnus@net-b.de>
138
139         PR fortran/52016
140         * resolve.c (resolve_formal_arglist): Fix elemental
141         constraint checks for polymorphic dummies.
142
143 2012-01-27  Paul Thomas  <pault@gcc.gnu.org>
144             Tobias Burnus <burnus@gcc.gnu.org>
145
146         PR fortran/48705
147         PR fortran/51870
148         PR fortran/51943
149         PR fortran/51946
150         * trans-array.c (gfc_array_init_size): Add two extra arguments
151         to convey the dynamic element size of a calls object and to
152         return the number of elements that have been allocated.
153         (gfc_array_allocate): Add the same arguments and use them to
154         call gfc_array_init_size.  Before the allocation dereference
155         the data pointer, if necessary. Set the allocated array to zero
156         if the class element size or expr3 are non-null.
157         * trans-expr.c (gfc_conv_class_to_class): Give this function
158         global scope.
159         (get_class_array_ref): New function.
160         (gfc_copy_class_to_class): New function.
161         * trans-array.h : Update prototype for gfc_array_allocate.
162         * trans-stmt.c (gfc_trans_allocate): For non-variable class
163         STATUS expressions extract the class object and the dynamic
164         element size. Use the latter to call gfc_array_allocate and
165         the former for setting the vptr and, via
166         gfc_copy_class_to_clasfc_cs, to copy to the allocated data.
167         * trans.h : Prototypes for gfc_get_class_array_ref,
168         gfc_copy_class_to_class and gfc_conv_class_to_class.
169
170 2012-01-25  Tobias Burnus  <burnus@net-b.de>
171
172         * resolve.c (symbol_as): Check also for attr.class_ok.
173
174 2012-01-25  Tobias Burnus  <burnus@net-b.de>
175
176         PR fortran/51995
177         * class.c (gfc_build_class_symbol): Fix invalid freeing
178         issue with fclass->f2k_derived.
179
180 2012-01-25  Tobias Burnus  <burnus@net-b.de>
181
182         PR fortran/51995
183         * class.c (gfc_build_class_symbol): Ensure that
184         fclass->f2k_derived is set.
185
186 2012-01-25  Tobias Burnus  <burnus@net-b.de>
187
188         PR fortran/51966
189         * resolve.c (resolve_structure_cons): Only create an
190         array constructors for nonscalars.
191
192 2012-01-23  Tobias Burnus  <burnus@net-b.de>
193
194         PR fortran/51948
195         * check.c (variable_check): Fix checking for
196          variables and deeply nested BLOCKs.
197
198 2012-01-21  Tobias Burnus  <burnus@net-b.de>
199             Steven G. Kargl  <kargl@gcc.gnu.org>
200
201         PR fortran/50556
202         * symbol.c (check_conflict): namelist-group-name cannot have the SAVE
203         attribute.
204
205 2012-01-21  Tobias Burnus  <burnus@net-b.de>
206
207         PR fortran/51913
208         * interface.c (compare_parameter): Fix CLASS comparison.
209
210 2012-01-20  Tobias Burnus  <burnus@net-b.de>
211             Janus Weil  <janus@gcc.gnu.org>
212
213         PR fortran/51056
214         * module.c (load_needed, read_module): Don't mark __vtab etc.
215         as use_only.
216
217 2012-01-19  Tobias Burnus  <burnus@net-b.de>
218
219         PR fortran/51904
220         * expr.c (gfc_build_intrinsic_call): Also set the symtree.
221
222 2012-01-18  Paul Thomas  <pault@gcc.gnu.org>
223
224         PR fortran/51634
225         * trans-expr.c (gfc_conv_procedure_call): Deallocate allocatable
226         components of temporary class arguments.
227
228 2012-01-17  Tobias Burnus  <burnus@net-b.de>
229             Janne Blomqvist  <jb@gcc.gnu.org>
230
231         PR fortran/51869
232         * trans-expr.c (alloc_scalar_allocatable_for_assignment): Nullify
233         LHS after allocation, if it has allocatable components.
234         * f95-lang.c (gfc_init_builtin_functions): Add BUILT_IN_CALLOC.
235
236 2012-01-16  Mikael Morin  <mikael@gcc.gnu.org>
237             Tobias Burnus  <burnus@net-b.de>
238
239         PR fortran/50981
240         * trans-array.c (gfc_walk_elemental_function_args): Fix
241         passing of deallocated allocatables/pointers as absent argument. 
242
243 2012-01-16  Tobias Burnus  <burnus@net-b.de>
244
245         PR fortran/51809
246         * class.c (gfc_find_derived_vtab): Mark __vtab and
247         __def_init as FL_VARIABLE not as FL_PARAMETER.
248         * expr.c (gfc_simplify_expr): Remove special
249         handling of __vtab.
250         * resolve.c (resolve_values): Ditto.
251         * trans-decl.c (gfc_get_symbol_decl): Mark __vtab
252         and __def_init as TREE_READONLY.
253
254 2012-01-16  Zydrunas Gimbutas  <gimbutas@cims.nyu.edu>
255         Andreas Kloeckner  <kloeckner@cims.nyu.edu>
256         Steven G. Kargl  <kargl@gcc.gnu.org>
257
258         PR fortran/48426
259         * gfortran.h (gfc_option_t): Add members flag_*_kind to store kind.
260         * lang.opt: Add options -freal-4-real-8, -freal-4-real-10,
261         -freal-4-real-16, -freal-8-real-4, -freal-8-real-10, -freal-8-real-16
262         and -finteger-4-integer-8. User-desired type conversion information.
263         * decl.c (gfc_match_old_kind_spec,kind_expr): Type conversions
264         in declaration parsing.
265         * trans-types.c (gfc_init_kinds): User-specified type conversion
266         checked for current backend.
267         * primary.c (match_integer_constant,match_real_constant): Implement
268         type conversion in constant parsing.
269         * options.c (gfc_init_options,gfc_handle_option): Translate input
270         options to flags in internal options data structure.
271         * invoke.texi: Document new options.  Re-order options in Options
272         summary section.
273
274 2012-01-16  Paul Thomas  <pault@gcc.gnu.org>
275
276         * trans-array.c (gfc_trans_create_temp_array): In the case of a
277         class array temporary, detect a null 'eltype' on entry and use 
278         'initial' to provde the class reference and so, through the
279         vtable, the element size for the dynamic type.
280         * trans-stmt.c (gfc_conv_elemental_dependencies): For class
281         expressions, set 'eltype' to null and pass the values via the
282         'initial' expression.
283
284 2012-01-14  Tobias Burnus  <burnus@net-b.de>
285
286         PR fortran/51800
287         * resolve.c (build_default_init_expr): Also initialize
288         nonconstant-length strings with -finit-character=<n>.
289
290 2011-01-14  Tobias Burnus  <burnus@net-b.de>
291
292         PR fortran/51816
293         * module.c (read_module): Don't make nonexisting
294         intrinsic operators as found.
295         (rename_list_remove_duplicate): New function.
296         (gfc_use_modules): Use it.
297
298 2012-01-13  Paul Thomas  <pault@gcc.gnu.org>
299
300         PR fortran/48351
301         * trans-array.c (structure_alloc_comps): Suppress interative
302         call to self, when current component is deallocated using
303         gfc_trans_dealloc_allocated.
304         * class.c (gfc_build_class_symbol): Copy the 'alloc_comp'
305         attribute from the declared type to the class structure.
306
307 2012-01-13  Tobias Burnus  <burnus@net-b.de>
308
309         PR fortran/51842
310         * fortran/trans-types.c (gfc_init_kinds): Use PTRDIFF_TYPE
311         instead of a signed int of size POINTER_SIZE for
312         gfc_index_integer_kind.
313
314 2012-01-12  Tobias Burnus  <burnus@net-b.de>
315
316         PR fortran/36755
317         * intrinsic.texi (CHMOD): Extend a bit and remove statement
318         that /bin/chmod is called.
319
320 2012-01-10  Gerald Pfeifer  <gerald@pfeifer.com>
321
322         * gfortran.texi (Fortran 2003 Status): Fix grammar.
323
324 2012-01-10  Tobias Burnus  <burnus@net-b.de>
325
326         PR fortran/51652
327         * resolve.c (resolve_allocate_expr): For non-deferred char lengths,
328         check whether type-spec matches declaration.
329
330 2012-01-10  Tobias Burnus  <burnus@net-b.de>
331
332         * resolve.c (resolve_ordinary_assign): Improve error wording.
333
334 2012-01-09  Paul Thomas  <pault@gcc.gnu.org>
335
336         PR fortran/51791
337         * interface.c (matching_typebound_op): Drill down through
338         possible parentheses to obtain base expression. Do not test for
339         'class_ok' but, instead for the class structure components.
340         * resolve.c (resolve_ordinary_assign): Extend error message for
341         polymorphic assignment to advise checking for specific
342         subroutine.
343
344         PR fortran/51792
345         * resolve.c (resolve_typebound_function): Restore 'static' to
346         declaration.
347
348 2012-01-09  Mikael Morin  <mikael@gcc.gnu.org>
349
350         PR fortran/51758
351         * trans-array.c (gfc_walk_elemental_function_args):
352         Skip over NULL() actual arguments.
353
354 2012-01-09  Tobias Burnus  <burnus@net-b.de>
355
356         * gfortran.texi: Bump copyright year.
357         (Fortran 2003 Status): Update polymorphism item, add
358         item for generic interface with DT name.
359
360 2012-01-09  Tobias Burnus  <burnus@net-b.de>
361
362         PR fortran/51578
363         * gfortran.h (gfc_use_list):
364         * match.h (gfc_use_module): Rename to ...
365         (gfc_use_modules): ... this.
366         * module.c (use_locus, specified_nonint, specified_int): Remove
367         global variable.
368         (module_name): Change type to const char*, used with gfc_get_string.
369         (module_list): New global variable.
370         (free_rename): Free argument not global var.
371         (gfc_match_use): Save match to module_list.
372         (load_generic_interfaces, read_module): Don't free symtree.
373         (write_dt_extensions, gfc_dump_module): Fix module-name I/O due to the
374         type change of module_name.
375         (write_symbol0, write_generic): Optimize due to the type change.
376         (import_iso_c_binding_module, use_iso_fortran_env_module): Use
377         locus of rename->where.
378         (gfc_use_module): Take module_list as argument.
379         (gfc_use_modules): New function.
380         (gfc_module_init_2, gfc_module_done_2): Init module_list, rename_list.
381         * parse.c (last_was_use_stmt): New global variable.
382         (use_modules): New function.
383         (decode_specification_statement, decode_statement): Move USE match up
384         and call use_modules.
385         (next_free, next_fixed): Call use_modules.
386         (accept_statement): Don't call gfc_module_use.
387
388 2012-01-06  Tobias Burnus <burnus@net-b.de>
389
390         * trans-openmp.c (gfc_omp_clause_dtor, gfc_trans_omp_array_reduction):
391         Update call to gfc_trans_dealloc_allocated.
392         * trans.c (gfc_allocate_using_malloc): Fix spacing.
393         (gfc_allocate_allocatable): For gfc_allocate_using_lib, jump to
394         label_finish when an error occurs.
395         (gfc_deallocate_with_status): Call caf_deregister for -fcoarray=lib.
396         * trans.h (gfc_allocate_allocatable, gfc_deallocate_with_status):
397         Update prototype.
398         (gfor_fndecl_caf_deregister): New tree symbol.
399         * trans-expr.c (gfc_conv_procedure_call): Update
400         gfc_deallocate_with_status and gfc_trans_dealloc_allocated calls.
401         * trans-array.c (gfc_array_allocate, gfc_trans_dealloc_allocated,
402         structure_alloc_comps, gfc_trans_deferred_array): Ditto.
403         (gfc_array_deallocate): Handle coarrays with -fcoarray=lib.
404         * trans-array.h (gfc_array_deallocate, gfc_array_allocate,
405         gfc_trans_dealloc_allocated): Update prototypes.
406         * trans-stmt.c (gfc_trans_sync): Fix indentation.
407         (gfc_trans_allocate): Fix errmsg padding and label handling.
408         (gfc_trans_deallocate): Ditto and handle -fcoarray=lib.
409         * expr.c (gfc_is_coarray): Fix algorithm for BT_CLASS.
410         * libgfortran.h (GFC_STAT_STOPPED_IMAGE): Use large value
411         to avoid other stats accidentally matching this one.
412         * trans-decl.c (gfor_fndecl_caf_deregister): New global var.
413         (gfc_build_builtin_function_decls): Fix prototype decl of caf_register
414         and add decl for caf_deregister.
415         (gfc_trans_deferred_vars): Handle CAF vars with -fcoarrays=lib.
416         * trans-intrinsic.c (conv_intrinsic_move_alloc): Update call to
417         gfc_deallocate_with_status.
418
419 2012-01-05  Paul Thomas  <pault@gcc.gnu.org>
420
421         PR fortran/PR48946
422         * resolve.c (resolve_typebound_static): If the typebound
423         procedure is 'deferred' try to find the correct specific
424         procedure in the derived type operator space itself.
425
426 2012-01-04  Mikael Morin  <mikael@gcc.gnu.org>
427
428         PR fortran/50981
429         * trans-array.h (gfc_walk_elemental_function_args): New argument.
430         * trans-intrinsic.c (gfc_walk_intrinsic_function): Update call.
431         * trans-stmt.c (gfc_trans_call): Ditto.
432         * trans-array.c (gfc_walk_function_expr): Ditto.
433         (gfc_walk_elemental_function_args): Get the dummy argument list
434         if possible.  Check that the dummy and the actual argument are both
435         optional, and set can_be_null_ref accordingly.
436
437 2012-01-04  Mikael Morin  <mikael@gcc.gnu.org>
438
439         PR fortran/50981
440         * trans.h (struct gfc_ss_info): New field data::scalar::can_be_null_ref
441         * trans-array.c: If the reference can be NULL, save the reference
442         instead of the value.
443         * trans-expr.c (gfc_conv_expr): If we have saved a reference,
444         dereference it.
445
446 2012-01-04  Mikael Morin  <mikael@gcc.gnu.org>
447
448         * trans-expr.c (gfc_conv_expr): Move address taking...
449         (gfc_conv_expr_reference): ... here.
450
451 2012-01-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
452
453         PR fortran/49693
454         * trans-common.c (create_common): Update copyright years.  Mark
455         variables as used to avoid warnings about unused variables in
456         common blocks.
457
458 2012-01-03  Hans-Peter Nilsson  <hp@axis.com>
459
460         * gfortran.h (struct gfc_expr): Add missing "struct"
461         qualifier for member base_expr.
462
463 2012-01-02  Paul Thomas  <pault@gcc.gnu.org>
464
465         PR fortran/51529
466         * trans-array.c (gfc_array_allocate): Null allocated memory of
467         newly allocted class arrays.
468
469         PR fortran/46262
470         PR fortran/46328
471         PR fortran/51052
472         * interface.c(build_compcall_for_operator): Add a type to the
473         expression.
474         * trans-expr.c (conv_base_obj_fcn_val): New function.
475         (gfc_conv_procedure_call): Use base_expr to detect non-variable
476         base objects and, ensuring that there is a temporary variable,
477         build up the typebound call using conv_base_obj_fcn_val.
478         (gfc_trans_class_assign): Pick out class procedure pointer
479         assignments and do the assignment with no further prcessing.
480         (gfc_trans_class_array_init_assign, gfc_trans_class_init_assign
481         gfc_trans_class_assign): Move to top of file.
482         * gfortran.h : Add 'base_expr' field to gfc_expr.
483         * resolve.c (get_declared_from_expr): Add 'types' argument to
484         switch checking of derived types on or off.
485         (resolve_typebound_generic_call): Set the new argument.
486         (resolve_typebound_function, resolve_typebound_subroutine):
487         Set 'types' argument for get_declared_from_expr appropriately.
488         Identify base expression, if not a variable, in the argument
489         list of class valued calls. Assign it to the 'base_expr' field
490         of the final expression. Strip away all references after the
491         last class reference.
492
493 2012-01-02  Tobias Burnus  <burnus@net-b.de>
494
495         PR fortran/51682
496         * trans-intrinsic.c (trans_this_image, trans_image_index,
497         trans_num_images, conv_intrinsic_cobound): Fold_convert the
498         caf_num_images/caf_this_images variables to the correct int kind.
499
500 2012-01-01  Jakub Jelinek  <jakub@redhat.com>
501
502         * gfortranspec.c (lang_specific_driver): Update copyright notice
503         dates.
504 \f
505 Copyright (C) 2012 Free Software Foundation, Inc.
506
507 Copying and distribution of this file, with or without modification,
508 are permitted in any medium without royalty provided the copyright
509 notice and this notice are preserved.