OSDN Git Service

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