2012-01-27 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / fortran / ChangeLog
blob1dcbfeaa0cda2fbf7ee36b80097ec342a7da5d51
1 2012-01-27  Paul Thomas  <pault@gcc.gnu.org>
2             Tobias Burnus <burnus@gcc.gnu.org>
4         PR fortran/48705
5         PR fortran/51870
6         PR fortran/51943
7         PR fortran/51946
8         * trans-array.c (gfc_array_init_size): Add two extra arguments
9         to convey the dynamic element size of a calls object and to
10         return the number of elements that have been allocated.
11         (gfc_array_allocate): Add the same arguments and use them to
12         call gfc_array_init_size.  Before the allocation dereference
13         the data pointer, if necessary. Set the allocated array to zero
14         if the class element size or expr3 are non-null.
15         * trans-expr.c (gfc_conv_class_to_class): Give this function
16         global scope.
17         (get_class_array_ref): New function.
18         (gfc_copy_class_to_class): New function.
19         * trans-array.h : Update prototype for gfc_array_allocate.
20         * trans-stmt.c (gfc_trans_allocate): For non-variable class
21         STATUS expressions extract the class object and the dynamic
22         element size. Use the latter to call gfc_array_allocate and
23         the former for setting the vptr and, via
24         gfc_copy_class_to_clasfc_cs, to copy to the allocated data.
25         * trans.h : Prototypes for gfc_get_class_array_ref,
26         gfc_copy_class_to_class and gfc_conv_class_to_class.
27   
28 2012-01-25  Tobias Burnus  <burnus@net-b.de>
30         PR fortran/51995
31         * class.c (gfc_build_class_symbol): Fix invalid freeing
32         issue with fclass->f2k_derived.
34 2012-01-25  Tobias Burnus  <burnus@net-b.de>
36         PR fortran/51995
37         * class.c (gfc_build_class_symbol): Ensure that
38         fclass->f2k_derived is set.
40 2012-01-25  Tobias Burnus  <burnus@net-b.de>
42         PR fortran/51966
43         * resolve.c (resolve_structure_cons): Only create an
44         array constructors for nonscalars.
46 2012-01-23  Tobias Burnus  <burnus@net-b.de>
48         PR fortran/51948
49         * check.c (variable_check): Fix checking for
50          variables and deeply nested BLOCKs.
52 2012-01-21  Tobias Burnus  <burnus@net-b.de>
53             Steven G. Kargl  <kargl@gcc.gnu.org>
55         PR fortran/50556
56         * symbol.c (check_conflict): namelist-group-name cannot have the SAVE
57         attribure.
59 2012-01-21  Tobias Burnus  <burnus@net-b.de>
61         PR fortran/51913
62         * interface.c (compare_parameter): Fix CLASS comparison.
64 2012-01-20  Tobias Burnus  <burnus@net-b.de>
65             Janus Weil  <janus@gcc.gnu.org>
67         PR fortran/51056
68         * module.c (load_needed, read_module): Don't mark __vtab etc.
69         as use_only.
71 2012-01-19  Tobias Burnus  <burnus@net-b.de>
73         PR fortran/51904
74         * expr.c (gfc_build_intrinsic_call): Also set the symtree.
76 2012-01-18  Paul Thomas  <pault@gcc.gnu.org>
78         PR fortran/51634
79         * trans-expr.c (gfc_conv_procedure_call): Deallocate allocatable
80         components of temporary class arguments.
82 2012-01-17  Tobias Burnus  <burnus@net-b.de>
83             Janne Blomqvist  <jb@gcc.gnu.org>
85         PR fortran/51869
86         * trans-expr.c (alloc_scalar_allocatable_for_assignment): Nullify
87         LHS after allocation, if it has allocatable components.
88         * f95-lang.c (gfc_init_builtin_functions): Add BUILT_IN_CALLOC.
90 2012-01-16  Mikael Morin  <mikael@gcc.gnu.org>
91             Tobias Burnus  <burnus@net-b.de>
93         PR fortran/50981
94         * trans-array.c (gfc_walk_elemental_function_args): Fix
95         passing of deallocated allocatables/pointers as absent argument. 
97 2012-01-16  Tobias Burnus  <burnus@net-b.de>
99         PR fortran/51809
100         * class.c (gfc_find_derived_vtab): Mark __vtab and
101         __def_init as FL_VARIABLE not as FL_PARAMETER.
102         * expr.c (gfc_simplify_expr): Remove special
103         handling of __vtab.
104         * resolve.c (resolve_values): Ditto.
105         * trans-decl.c (gfc_get_symbol_decl): Mark __vtab
106         and __def_init as TREE_READONLY.
108 2012-01-16  Zydrunas Gimbutas  <gimbutas@cims.nyu.edu>
109         Andreas Kloeckner  <kloeckner@cims.nyu.edu>
110         Steven G. Kargl  <kargl@gcc.gnu.org>
112         PR fortran/48426
113         * gfortran.h (gfc_option_t): Add members flag_*_kind to store kind.
114         * lang.opt: Add options -freal-4-real-8, -freal-4-real-10,
115         -freal-4-real-16, -freal-8-real-4, -freal-8-real-10, -freal-8-real-16
116         and -finteger-4-integer-8. User-desired type conversion information.
117         * decl.c (gfc_match_old_kind_spec,kind_expr): Type conversions
118         in declaration parsing.
119         * trans-types.c (gfc_init_kinds): User-specified type conversion
120         checked for current backend.
121         * primary.c (match_integer_constant,match_real_constant): Implement
122         type conversion in constant parsing.
123         * options.c (gfc_init_options,gfc_handle_option): Translate input
124         options to flags in internal options data structure.
125         * invoke.texi: Document new options.  Re-order options in Options
126         summary section.
128 2012-01-16  Paul Thomas  <pault@gcc.gnu.org>
130         * trans-array.c (gfc_trans_create_temp_array): In the case of a
131         class array temporary, detect a null 'eltype' on entry and use 
132         'initial' to provde the class reference and so, through the
133         vtable, the element size for the dynamic type.
134         * trans-stmt.c (gfc_conv_elemental_dependencies): For class
135         expressions, set 'eltype' to null and pass the values via the
136         'initial' expression.
138 2012-01-14  Tobias Burnus  <burnus@net-b.de>
140         PR fortran/51800
141         * resolve.c (build_default_init_expr): Also initialize
142         nonconstant-length strings with -finit-character=<n>.
144 2011-01-14  Tobias Burnus  <burnus@net-b.de>
146         PR fortran/51816
147         * module.c (read_module): Don't make nonexisting
148         intrinsic operators as found.
149         (rename_list_remove_duplicate): New function.
150         (gfc_use_modules): Use it.
152 2012-01-13  Paul Thomas  <pault@gcc.gnu.org>
154         PR fortran/48351
155         * trans-array.c (structure_alloc_comps): Suppress interative
156         call to self, when current component is deallocated using
157         gfc_trans_dealloc_allocated.
158         * class.c (gfc_build_class_symbol): Copy the 'alloc_comp'
159         attribute from the declared type to the class structure.
161 2012-01-13  Tobias Burnus  <burnus@net-b.de>
163         PR fortran/51842
164         * fortran/trans-types.c (gfc_init_kinds): Use PTRDIFF_TYPE
165         instead of a signed int of size POINTER_SIZE for
166         gfc_index_integer_kind.
168 2012-01-12  Tobias Burnus  <burnus@net-b.de>
170         PR fortran/36755
171         * intrinsic.texi (CHMOD): Extend a bit and remove statement
172         that /bin/chmod is called.
174 2012-01-10  Gerald Pfeifer  <gerald@pfeifer.com>
176         * gfortran.texi (Fortran 2003 Status): Fix grammar.
178 2012-01-10  Tobias Burnus  <burnus@net-b.de>
180         PR fortran/51652
181         * resolve.c (resolve_allocate_expr): For non-deferred char lengths,
182         check whether type-spec matches declaration.
184 2012-01-10  Tobias Burnus  <burnus@net-b.de>
186         * resolve.c (resolve_ordinary_assign): Improve error wording.
188 2012-01-09  Paul Thomas  <pault@gcc.gnu.org>
190         PR fortran/51791
191         * interface.c (matching_typebound_op): Drill down through
192         possible parentheses to obtain base expression. Do not test for
193         'class_ok' but, instead for the class structure components.
194         * resolve.c (resolve_ordinary_assign): Extend error message for
195         polymorphic assignment to advise checking for specific
196         subroutine.
198         PR fortran/51792
199         * resolve.c (resolve_typebound_function): Restore 'static' to
200         declaration.
202 2012-01-09  Mikael Morin  <mikael@gcc.gnu.org>
204         PR fortran/51758
205         * trans-array.c (gfc_walk_elemental_function_args):
206         Skip over NULL() actual arguments.
208 2012-01-09  Tobias Burnus  <burnus@net-b.de>
210         * gfortran.texi: Bump copyright year.
211         (Fortran 2003 Status): Update polymorphism item, add
212         item for generic interface with DT name.
214 2012-01-09  Tobias Burnus  <burnus@net-b.de>
216         PR fortran/51578
217         * gfortran.h (gfc_use_list):
218         * match.h (gfc_use_module): Rename to ...
219         (gfc_use_modules): ... this.
220         * module.c (use_locus, specified_nonint, specified_int): Remove
221         global variable.
222         (module_name): Change type to const char*, used with gfc_get_string.
223         (module_list): New global variable.
224         (free_rename): Free argument not global var.
225         (gfc_match_use): Save match to module_list.
226         (load_generic_interfaces, read_module): Don't free symtree.
227         (write_dt_extensions, gfc_dump_module): Fix module-name I/O due to the
228         type change of module_name.
229         (write_symbol0, write_generic): Optimize due to the type change.
230         (import_iso_c_binding_module, use_iso_fortran_env_module): Use
231         locus of rename->where.
232         (gfc_use_module): Take module_list as argument.
233         (gfc_use_modules): New function.
234         (gfc_module_init_2, gfc_module_done_2): Init module_list, rename_list.
235         * parse.c (last_was_use_stmt): New global variable.
236         (use_modules): New function.
237         (decode_specification_statement, decode_statement): Move USE match up
238         and call use_modules.
239         (next_free, next_fixed): Call use_modules.
240         (accept_statement): Don't call gfc_module_use.
242 2012-01-06  Tobias Burnus <burnus@net-b.de>
244         * trans-openmp.c (gfc_omp_clause_dtor, gfc_trans_omp_array_reduction):
245         Update call to gfc_trans_dealloc_allocated.
246         * trans.c (gfc_allocate_using_malloc): Fix spacing.
247         (gfc_allocate_allocatable): For gfc_allocate_using_lib, jump to
248         label_finish when an error occurs.
249         (gfc_deallocate_with_status): Call caf_deregister for -fcoarray=lib.
250         * trans.h (gfc_allocate_allocatable, gfc_deallocate_with_status):
251         Update prototype.
252         (gfor_fndecl_caf_deregister): New tree symbol.
253         * trans-expr.c (gfc_conv_procedure_call): Update
254         gfc_deallocate_with_status and gfc_trans_dealloc_allocated calls.
255         * trans-array.c (gfc_array_allocate, gfc_trans_dealloc_allocated,
256         structure_alloc_comps, gfc_trans_deferred_array): Ditto.
257         (gfc_array_deallocate): Handle coarrays with -fcoarray=lib.
258         * trans-array.h (gfc_array_deallocate, gfc_array_allocate,
259         gfc_trans_dealloc_allocated): Update prototypes.
260         * trans-stmt.c (gfc_trans_sync): Fix indentation.
261         (gfc_trans_allocate): Fix errmsg padding and label handling.
262         (gfc_trans_deallocate): Ditto and handle -fcoarray=lib.
263         * expr.c (gfc_is_coarray): Fix algorithm for BT_CLASS.
264         * libgfortran.h (GFC_STAT_STOPPED_IMAGE): Use large value
265         to avoid other stats accidentally matching this one.
266         * trans-decl.c (gfor_fndecl_caf_deregister): New global var.
267         (gfc_build_builtin_function_decls): Fix prototype decl of caf_register
268         and add decl for caf_deregister.
269         (gfc_trans_deferred_vars): Handle CAF vars with -fcoarrays=lib.
270         * trans-intrinsic.c (conv_intrinsic_move_alloc): Update call to
271         gfc_deallocate_with_status.
273 2012-01-05  Paul Thomas  <pault@gcc.gnu.org>
275         PR fortran/PR48946
276         * resolve.c (resolve_typebound_static): If the typebound
277         procedure is 'deferred' try to find the correct specific
278         procedure in the derived type operator space itself.
280 2012-01-04  Mikael Morin  <mikael@gcc.gnu.org>
282         PR fortran/50981
283         * trans-array.h (gfc_walk_elemental_function_args): New argument.
284         * trans-intrinsic.c (gfc_walk_intrinsic_function): Update call.
285         * trans-stmt.c (gfc_trans_call): Ditto.
286         * trans-array.c (gfc_walk_function_expr): Ditto.
287         (gfc_walk_elemental_function_args): Get the dummy argument list
288         if possible.  Check that the dummy and the actual argument are both
289         optional, and set can_be_null_ref accordingly.
291 2012-01-04  Mikael Morin  <mikael@gcc.gnu.org>
293         PR fortran/50981
294         * trans.h (struct gfc_ss_info): New field data::scalar::can_be_null_ref
295         * trans-array.c: If the reference can be NULL, save the reference
296         instead of the value.
297         * trans-expr.c (gfc_conv_expr): If we have saved a reference,
298         dereference it.
300 2012-01-04  Mikael Morin  <mikael@gcc.gnu.org>
302         * trans-expr.c (gfc_conv_expr): Move address taking...
303         (gfc_conv_expr_reference): ... here.
305 2012-01-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
307         PR fortran/49693
308         * trans-common.c (create_common): Update copyright years.  Mark
309         variables as used to avoid warnings about unused variables in
310         common blocks.
312 2012-01-03  Hans-Peter Nilsson  <hp@axis.com>
314         * gfortran.h (struct gfc_expr): Add missing "struct"
315         qualifier for member base_expr.
317 2012-01-02  Paul Thomas  <pault@gcc.gnu.org>
319         PR fortran/51529
320         * trans-array.c (gfc_array_allocate): Null allocated memory of
321         newly allocted class arrays.
323         PR fortran/46262
324         PR fortran/46328
325         PR fortran/51052
326         * interface.c(build_compcall_for_operator): Add a type to the
327         expression.
328         * trans-expr.c (conv_base_obj_fcn_val): New function.
329         (gfc_conv_procedure_call): Use base_expr to detect non-variable
330         base objects and, ensuring that there is a temporary variable,
331         build up the typebound call using conv_base_obj_fcn_val.
332         (gfc_trans_class_assign): Pick out class procedure pointer
333         assignments and do the assignment with no further prcessing.
334         (gfc_trans_class_array_init_assign, gfc_trans_class_init_assign
335         gfc_trans_class_assign): Move to top of file.
336         * gfortran.h : Add 'base_expr' field to gfc_expr.
337         * resolve.c (get_declared_from_expr): Add 'types' argument to
338         switch checking of derived types on or off.
339         (resolve_typebound_generic_call): Set the new argument.
340         (resolve_typebound_function, resolve_typebound_subroutine):
341         Set 'types' argument for get_declared_from_expr appropriately.
342         Identify base expression, if not a variable, in the argument
343         list of class valued calls. Assign it to the 'base_expr' field
344         of the final expression. Strip away all references after the
345         last class reference.
347 2012-01-02  Tobias Burnus  <burnus@net-b.de>
349         PR fortran/51682
350         * trans-intrinsic.c (trans_this_image, trans_image_index,
351         trans_num_images, conv_intrinsic_cobound): Fold_convert the
352         caf_num_images/caf_this_images variables to the correct int kind.
354 2012-01-01  Jakub Jelinek  <jakub@redhat.com>
356         * gfortranspec.c (lang_specific_driver): Update copyright notice
357         dates.
359 Copyright (C) 2012 Free Software Foundation, Inc.
361 Copying and distribution of this file, with or without modification,
362 are permitted in any medium without royalty provided the copyright
363 notice and this notice are preserved.