1 2012-02-12 Mikael Morin <mikael@gcc.gnu.org>
4 * trans-stmt.c (gfc_get_proc_ifc_for_call): New function.
5 (gfc_trans_call): Use gfc_get_proc_ifc_for_call.
7 2012-02-12 Mikael Morin <mikael@gcc.gnu.org>
9 * trans-array.c (gfc_walk_elemental_function_args,
10 gfc_walk_function_expr): Move call to gfc_get_proc_ifc_for_expr out
11 of gfc_walk_elemental_function_args.
12 * trans-stmt.c (gfc_trans_call): Ditto.
13 * trans-array.h (gfc_get_proc_ifc_for_expr): New prototype.
14 (gfc_walk_elemental_function_args): Update prototype.
16 2012-02-12 Mikael Morin <mikael@gcc.gnu.org>
18 * trans-array.c (gfc_get_proc_ifc_for_expr): New function.
19 (gfc_walk_elemental_function_args): Move code to
20 gfc_get_proc_ifc_for_expr and call it.
22 2012-02-08 Tobias Burnus <burnus@net-b.de>
25 * trans-expr.c (fcncall_realloc_result): Set also the stride.
27 2012-02-07 Tobias Burnus <burnus@net-b.de>
30 * trans-expr.c (gfc_conv_procedure_call): Add _data component
31 for calls of scalar CLASS actuals to TYPE dummies.
33 2012-02-05 Thomas König <tkoenig@gcc.gnu.org>
36 * trans-decl.c: Warn about unused dummy procedure arguments
37 if -Wunused-dummy-argument is specified. Suppress middle-end
38 warnings about procedure arguments.
40 2012-02-05 Paul Thomas <pault@gcc.gnu.org>
42 * trans-array.c (gfc_array_allocate): Zero memory for all class
44 * trans-stmt.c (gfc_trans_allocate): Ditto for class scalars.
47 * trans-stmt.c (gfc_trans_allocate): Before correcting a class
48 array reference, ensure that 'dataref' points to the _data
49 component that is followed by the array reference..
51 2012-02-02 Mikael Morin <mikael@gcc.gnu.org>
57 * class.c (insert_component_ref, class_data_ref_missing,
58 gfc_fix_class_refs): New functions.
59 * gfortran.h (gfc_fix_class_refs): New prototype.
60 * trans-expr.c (gfc_conv_expr): Remove special case handling and call
61 gfc_fix_class_refs instead.
63 2012-02-02 Paul Thomas <pault@gcc.gnu.org>
66 * trans-expr.c (fcncall_realloc_result): If variable shape is
67 correct, retain the bounds, whatever they are.
69 2012-02-02 Tobias Burnus <burnus@net-b.de>
72 * simplify.c (gfc_simplify_size): Handle INTRINSIC_PARENTHESES.
74 2012-02-01 Thomas König <tkoenig@gcc.gnu.org>
77 * frontend-passes.c (convert_elseif): New function.
78 (optimize_namespace): Call it.
80 2012-02-01 Tobias Burnus <burnus@net-b.de>
83 * module.c (MOD_VERSION): Bump.
84 (mio_typebound_proc): Read/write is_operator from/to the
87 2012-02-01 Tobias Burnus <burnus@net-b.de>
90 * trans-expr.c (gfc_conv_procedure_call): Add array ref
93 2012-01-31 Tobias Burnus <burnus@net-b.de>
96 * gfortran.h (gfc_tbp_generic): Store whether the
97 generic is an operator.
98 * decl.c (gfc_match_generic): Set that flag.
99 * resolve.c (check_generic_tbp_ambiguity): Use it in the
100 gfc_compare_interfaces check.
102 2012-01-31 Tobias Burnus <burnus@net-b.de>
105 * class.c (gfc_find_derived_vtab): Mark _copy function as pure.
107 2012-01-31 Tobias Burnus <burnus@net-b.de>
110 * class.c (get_unique_hashed_string): Adapt trim length.
111 (gfc_build_class_symbol) Encode also corank in the container name.
113 2012-01-31 Paul Thomas <pault@gcc.gnu.org>
116 * trans-expr.c (fcncall_realloc_result): Correct calculation of
119 2012-01-29 Janne Blomqvist <jb@gcc.gnu.org>
121 * module.c (pointer_info): Make true_name and module pointers
122 rather than arrays, order pointers before other fields.
123 (free_pi_tree): free true_name and module as well.
124 (mio_read_string): Rename to read_string.
125 (mio_write_string): Remove.
126 (load_commons): Use read_string.
127 (read_module): Use read_string rather than mio_internal_string.
128 (write_blank_common): Call write_atom directly.
129 (write_symbol): Likewise.
131 2012-01-29 Tobias Burnus <burnus@net-b.de>
134 * expr.c (gfc_default_initializer): Convert the values if
135 the type does not match.
137 2012-01-29 Tobias Burnus <burnus@net-b.de>
140 * trans-array.c (structure_alloc_comps): Fix assignment of
141 polymorphic components (polymorphic deep copying).
143 2012-01-29 Janne Blomqvist <jb@gcc.gnu.org>
146 * decl.c (set_binding_label): Make binding_label argument const.
147 (curr_binding_label): Constify.
148 * gfortran.h (gfc_symbol): Constify binding_label.
149 (gfc_common_head): Likewise.
150 (get_iso_c_sym): Likewise.
151 * match.c (gfc_match_name_C): Constify buffer argument.
152 * match.h (gfc_match_name_C): Likewise.
153 * resolve.c (set_name_and_label): Constify binding_label argument.
154 (gfc_iso_c_sub_interface): Constify binding_label variable.
155 * symbol.c (get_iso_c_sym): Constify binding_label argument.
157 2012-01-29 Janne Blomqvist <jb@gcc.gnu.org>
160 * decl.c (set_binding_label): Move prototype from match.h to here.
161 (curr_binding_label): Make a pointer rather than static array.
162 (build_sym): Check sym->binding_label pointer rather than array,
163 update set_binding_label call, handle curr_binding_label changes.
164 (set_binding_label): Handle new curr_binding_label, dest_label
165 double ptr, and sym->binding_label.
166 (verify_bind_c_sym): Handle sym->binding_label being a pointer.
167 (set_verify_bind_c_sym): Check sym->binding_label pointer rather
168 than array, update set_binding_label call.
169 (gfc_match_bind_c_stmt): Handle curr_binding_label change.
170 (match_procedure_decl): Update set_binding_label call.
171 (gfc_match_bind_c): Change binding_label to pointer, update
172 gfc_match_name_C call.
173 * gfortran.h (GFC_MAX_BINDING_LABEL_LEN): Remove macro.
174 (gfc_symbol): Make binding_label a pointer.
175 (gfc_common_head): Likewise.
176 * match.c (gfc_match_name_C): Heap allocate bind(C) name.
177 * match.h (gfc_match_name_C): Change prototype argument.
178 (set_binding_label): Move prototype to decl.c.
179 * module.c (struct pointer_info): Make binding_label a pointer.
180 (free_pi_tree): Free unused binding_label.
181 (mio_read_string): New function.
182 (mio_write_string): New function.
183 (load_commons): Redo reading of binding_label.
184 (read_module): Likewise.
185 (write_common_0): Change to write empty string instead of name if
187 (write_blank_common): Write empty string for binding label.
188 (write_symbol): Change to write empty string instead of name if no
190 * resolve.c (gfc_iso_c_func_interface): Don't set binding_label.
191 (set_name_and_label): Make binding_label double pointer, use
193 (gfc_iso_c_sub_interface): Make binding_label a pointer.
194 (resolve_bind_c_comms): Handle cases if
195 gfc_common_head->binding_label is NULL.
196 (gfc_verify_binding_labels): sym->binding_label is a pointer.
197 * symbol.c (gfc_new_symbol): Rely on XCNEW zero init for
199 (gen_special_c_interop_ptr): Don't set binding label.
200 (generate_isocbinding_symbol): Insert binding_label into symbol
202 (get_iso_c_sym): Use pointer assignment instead of strcpy.
203 * trans-common.c (gfc_sym_mangled_common_id): Handle
204 com->binding_label being a pointer.
205 * trans-decl.c (gfc_sym_mangled_identifier): Handle
206 sym->binding_label being a pointer.
207 (gfc_sym_mangled_function_id): Likewise.
209 2012-01-29 Tobias Burnus <burnus@net-b.de>
212 * resolve.c (symbol_as): Remove unused, accidentally
215 2012-01-28 Tobias Burnus <burnus@net-b.de>
218 * trans-stmt.c (gfc_trans_allocate): Properly check whether
219 we have a BT_CLASS which needs to be memset.
221 2012-01-27 Tobias Burnus <burnus@net-b.de>
224 * trans-expr.c (gfc_conv_procedure_call): Fix passing
225 of functions, which return allocatables.
227 2012-01-27 Tobias Burnus <burnus@net-b.de>
230 * resolve.c (resolve_formal_arglist): Fix elemental
231 constraint checks for polymorphic dummies also for
234 2012-01-27 Tobias Burnus <burnus@net-b.de>
238 * primary.c (gfc_match_varspec. gfc_match_rvalue): Set
239 handle array spec for BT_CLASS.
240 * expr.c (gfc_get_variable_expr, gfc_lval_expr_from_sym)
241 * frontend-passes.c (create_var): Ditto.
242 * resolve.c (resolve_actual_arglist, resolve_assoc_var): Ditto.
243 * trans-decl.c (gfc_trans_deferred_vars): Use class_pointer
244 instead of attr.pointer.
245 (gfc_generate_function_code): Use CLASS_DATA (sym) for BT_CLASS.
246 * trans-intrinsic.c (conv_intrinsic_move_alloc): Move assert.
247 * trans-stmt.c (trans_associate_var): Ask for the descriptor.
249 2012-01-27 Tobias Burnus <burnus@net-b.de>
252 * match.c (gfc_match_allocate): Allow more than allocate
255 2012-01-27 Tobias Burnus <burnus@net-b.de>
258 * resolve.c (resolve_formal_arglist): Fix elemental
259 constraint checks for polymorphic dummies.
261 2012-01-27 Paul Thomas <pault@gcc.gnu.org>
262 Tobias Burnus <burnus@gcc.gnu.org>
268 * trans-array.c (gfc_array_init_size): Add two extra arguments
269 to convey the dynamic element size of a calls object and to
270 return the number of elements that have been allocated.
271 (gfc_array_allocate): Add the same arguments and use them to
272 call gfc_array_init_size. Before the allocation dereference
273 the data pointer, if necessary. Set the allocated array to zero
274 if the class element size or expr3 are non-null.
275 * trans-expr.c (gfc_conv_class_to_class): Give this function
277 (get_class_array_ref): New function.
278 (gfc_copy_class_to_class): New function.
279 * trans-array.h : Update prototype for gfc_array_allocate.
280 * trans-stmt.c (gfc_trans_allocate): For non-variable class
281 STATUS expressions extract the class object and the dynamic
282 element size. Use the latter to call gfc_array_allocate and
283 the former for setting the vptr and, via
284 gfc_copy_class_to_clasfc_cs, to copy to the allocated data.
285 * trans.h : Prototypes for gfc_get_class_array_ref,
286 gfc_copy_class_to_class and gfc_conv_class_to_class.
288 2012-01-25 Tobias Burnus <burnus@net-b.de>
290 * resolve.c (symbol_as): Check also for attr.class_ok.
292 2012-01-25 Tobias Burnus <burnus@net-b.de>
295 * class.c (gfc_build_class_symbol): Fix invalid freeing
296 issue with fclass->f2k_derived.
298 2012-01-25 Tobias Burnus <burnus@net-b.de>
301 * class.c (gfc_build_class_symbol): Ensure that
302 fclass->f2k_derived is set.
304 2012-01-25 Tobias Burnus <burnus@net-b.de>
307 * resolve.c (resolve_structure_cons): Only create an
308 array constructors for nonscalars.
310 2012-01-23 Tobias Burnus <burnus@net-b.de>
313 * check.c (variable_check): Fix checking for
314 variables and deeply nested BLOCKs.
316 2012-01-21 Tobias Burnus <burnus@net-b.de>
317 Steven G. Kargl <kargl@gcc.gnu.org>
320 * symbol.c (check_conflict): namelist-group-name cannot have the SAVE
323 2012-01-21 Tobias Burnus <burnus@net-b.de>
326 * interface.c (compare_parameter): Fix CLASS comparison.
328 2012-01-20 Tobias Burnus <burnus@net-b.de>
329 Janus Weil <janus@gcc.gnu.org>
332 * module.c (load_needed, read_module): Don't mark __vtab etc.
335 2012-01-19 Tobias Burnus <burnus@net-b.de>
338 * expr.c (gfc_build_intrinsic_call): Also set the symtree.
340 2012-01-18 Paul Thomas <pault@gcc.gnu.org>
343 * trans-expr.c (gfc_conv_procedure_call): Deallocate allocatable
344 components of temporary class arguments.
346 2012-01-17 Tobias Burnus <burnus@net-b.de>
347 Janne Blomqvist <jb@gcc.gnu.org>
350 * trans-expr.c (alloc_scalar_allocatable_for_assignment): Nullify
351 LHS after allocation, if it has allocatable components.
352 * f95-lang.c (gfc_init_builtin_functions): Add BUILT_IN_CALLOC.
354 2012-01-16 Mikael Morin <mikael@gcc.gnu.org>
355 Tobias Burnus <burnus@net-b.de>
358 * trans-array.c (gfc_walk_elemental_function_args): Fix
359 passing of deallocated allocatables/pointers as absent argument.
361 2012-01-16 Tobias Burnus <burnus@net-b.de>
364 * class.c (gfc_find_derived_vtab): Mark __vtab and
365 __def_init as FL_VARIABLE not as FL_PARAMETER.
366 * expr.c (gfc_simplify_expr): Remove special
368 * resolve.c (resolve_values): Ditto.
369 * trans-decl.c (gfc_get_symbol_decl): Mark __vtab
370 and __def_init as TREE_READONLY.
372 2012-01-16 Zydrunas Gimbutas <gimbutas@cims.nyu.edu>
373 Andreas Kloeckner <kloeckner@cims.nyu.edu>
374 Steven G. Kargl <kargl@gcc.gnu.org>
377 * gfortran.h (gfc_option_t): Add members flag_*_kind to store kind.
378 * lang.opt: Add options -freal-4-real-8, -freal-4-real-10,
379 -freal-4-real-16, -freal-8-real-4, -freal-8-real-10, -freal-8-real-16
380 and -finteger-4-integer-8. User-desired type conversion information.
381 * decl.c (gfc_match_old_kind_spec,kind_expr): Type conversions
382 in declaration parsing.
383 * trans-types.c (gfc_init_kinds): User-specified type conversion
384 checked for current backend.
385 * primary.c (match_integer_constant,match_real_constant): Implement
386 type conversion in constant parsing.
387 * options.c (gfc_init_options,gfc_handle_option): Translate input
388 options to flags in internal options data structure.
389 * invoke.texi: Document new options. Re-order options in Options
392 2012-01-16 Paul Thomas <pault@gcc.gnu.org>
394 * trans-array.c (gfc_trans_create_temp_array): In the case of a
395 class array temporary, detect a null 'eltype' on entry and use
396 'initial' to provde the class reference and so, through the
397 vtable, the element size for the dynamic type.
398 * trans-stmt.c (gfc_conv_elemental_dependencies): For class
399 expressions, set 'eltype' to null and pass the values via the
400 'initial' expression.
402 2012-01-14 Tobias Burnus <burnus@net-b.de>
405 * resolve.c (build_default_init_expr): Also initialize
406 nonconstant-length strings with -finit-character=<n>.
408 2011-01-14 Tobias Burnus <burnus@net-b.de>
411 * module.c (read_module): Don't make nonexisting
412 intrinsic operators as found.
413 (rename_list_remove_duplicate): New function.
414 (gfc_use_modules): Use it.
416 2012-01-13 Paul Thomas <pault@gcc.gnu.org>
419 * trans-array.c (structure_alloc_comps): Suppress interative
420 call to self, when current component is deallocated using
421 gfc_trans_dealloc_allocated.
422 * class.c (gfc_build_class_symbol): Copy the 'alloc_comp'
423 attribute from the declared type to the class structure.
425 2012-01-13 Tobias Burnus <burnus@net-b.de>
428 * fortran/trans-types.c (gfc_init_kinds): Use PTRDIFF_TYPE
429 instead of a signed int of size POINTER_SIZE for
430 gfc_index_integer_kind.
432 2012-01-12 Tobias Burnus <burnus@net-b.de>
435 * intrinsic.texi (CHMOD): Extend a bit and remove statement
436 that /bin/chmod is called.
438 2012-01-10 Gerald Pfeifer <gerald@pfeifer.com>
440 * gfortran.texi (Fortran 2003 Status): Fix grammar.
442 2012-01-10 Tobias Burnus <burnus@net-b.de>
445 * resolve.c (resolve_allocate_expr): For non-deferred char lengths,
446 check whether type-spec matches declaration.
448 2012-01-10 Tobias Burnus <burnus@net-b.de>
450 * resolve.c (resolve_ordinary_assign): Improve error wording.
452 2012-01-09 Paul Thomas <pault@gcc.gnu.org>
455 * interface.c (matching_typebound_op): Drill down through
456 possible parentheses to obtain base expression. Do not test for
457 'class_ok' but, instead for the class structure components.
458 * resolve.c (resolve_ordinary_assign): Extend error message for
459 polymorphic assignment to advise checking for specific
463 * resolve.c (resolve_typebound_function): Restore 'static' to
466 2012-01-09 Mikael Morin <mikael@gcc.gnu.org>
469 * trans-array.c (gfc_walk_elemental_function_args):
470 Skip over NULL() actual arguments.
472 2012-01-09 Tobias Burnus <burnus@net-b.de>
474 * gfortran.texi: Bump copyright year.
475 (Fortran 2003 Status): Update polymorphism item, add
476 item for generic interface with DT name.
478 2012-01-09 Tobias Burnus <burnus@net-b.de>
481 * gfortran.h (gfc_use_list):
482 * match.h (gfc_use_module): Rename to ...
483 (gfc_use_modules): ... this.
484 * module.c (use_locus, specified_nonint, specified_int): Remove
486 (module_name): Change type to const char*, used with gfc_get_string.
487 (module_list): New global variable.
488 (free_rename): Free argument not global var.
489 (gfc_match_use): Save match to module_list.
490 (load_generic_interfaces, read_module): Don't free symtree.
491 (write_dt_extensions, gfc_dump_module): Fix module-name I/O due to the
492 type change of module_name.
493 (write_symbol0, write_generic): Optimize due to the type change.
494 (import_iso_c_binding_module, use_iso_fortran_env_module): Use
495 locus of rename->where.
496 (gfc_use_module): Take module_list as argument.
497 (gfc_use_modules): New function.
498 (gfc_module_init_2, gfc_module_done_2): Init module_list, rename_list.
499 * parse.c (last_was_use_stmt): New global variable.
500 (use_modules): New function.
501 (decode_specification_statement, decode_statement): Move USE match up
502 and call use_modules.
503 (next_free, next_fixed): Call use_modules.
504 (accept_statement): Don't call gfc_module_use.
506 2012-01-06 Tobias Burnus <burnus@net-b.de>
508 * trans-openmp.c (gfc_omp_clause_dtor, gfc_trans_omp_array_reduction):
509 Update call to gfc_trans_dealloc_allocated.
510 * trans.c (gfc_allocate_using_malloc): Fix spacing.
511 (gfc_allocate_allocatable): For gfc_allocate_using_lib, jump to
512 label_finish when an error occurs.
513 (gfc_deallocate_with_status): Call caf_deregister for -fcoarray=lib.
514 * trans.h (gfc_allocate_allocatable, gfc_deallocate_with_status):
516 (gfor_fndecl_caf_deregister): New tree symbol.
517 * trans-expr.c (gfc_conv_procedure_call): Update
518 gfc_deallocate_with_status and gfc_trans_dealloc_allocated calls.
519 * trans-array.c (gfc_array_allocate, gfc_trans_dealloc_allocated,
520 structure_alloc_comps, gfc_trans_deferred_array): Ditto.
521 (gfc_array_deallocate): Handle coarrays with -fcoarray=lib.
522 * trans-array.h (gfc_array_deallocate, gfc_array_allocate,
523 gfc_trans_dealloc_allocated): Update prototypes.
524 * trans-stmt.c (gfc_trans_sync): Fix indentation.
525 (gfc_trans_allocate): Fix errmsg padding and label handling.
526 (gfc_trans_deallocate): Ditto and handle -fcoarray=lib.
527 * expr.c (gfc_is_coarray): Fix algorithm for BT_CLASS.
528 * libgfortran.h (GFC_STAT_STOPPED_IMAGE): Use large value
529 to avoid other stats accidentally matching this one.
530 * trans-decl.c (gfor_fndecl_caf_deregister): New global var.
531 (gfc_build_builtin_function_decls): Fix prototype decl of caf_register
532 and add decl for caf_deregister.
533 (gfc_trans_deferred_vars): Handle CAF vars with -fcoarrays=lib.
534 * trans-intrinsic.c (conv_intrinsic_move_alloc): Update call to
535 gfc_deallocate_with_status.
537 2012-01-05 Paul Thomas <pault@gcc.gnu.org>
540 * resolve.c (resolve_typebound_static): If the typebound
541 procedure is 'deferred' try to find the correct specific
542 procedure in the derived type operator space itself.
544 2012-01-04 Mikael Morin <mikael@gcc.gnu.org>
547 * trans-array.h (gfc_walk_elemental_function_args): New argument.
548 * trans-intrinsic.c (gfc_walk_intrinsic_function): Update call.
549 * trans-stmt.c (gfc_trans_call): Ditto.
550 * trans-array.c (gfc_walk_function_expr): Ditto.
551 (gfc_walk_elemental_function_args): Get the dummy argument list
552 if possible. Check that the dummy and the actual argument are both
553 optional, and set can_be_null_ref accordingly.
555 2012-01-04 Mikael Morin <mikael@gcc.gnu.org>
558 * trans.h (struct gfc_ss_info): New field data::scalar::can_be_null_ref
559 * trans-array.c: If the reference can be NULL, save the reference
560 instead of the value.
561 * trans-expr.c (gfc_conv_expr): If we have saved a reference,
564 2012-01-04 Mikael Morin <mikael@gcc.gnu.org>
566 * trans-expr.c (gfc_conv_expr): Move address taking...
567 (gfc_conv_expr_reference): ... here.
569 2012-01-04 Thomas Koenig <tkoenig@gcc.gnu.org>
572 * trans-common.c (create_common): Update copyright years. Mark
573 variables as used to avoid warnings about unused variables in
576 2012-01-03 Hans-Peter Nilsson <hp@axis.com>
578 * gfortran.h (struct gfc_expr): Add missing "struct"
579 qualifier for member base_expr.
581 2012-01-02 Paul Thomas <pault@gcc.gnu.org>
584 * trans-array.c (gfc_array_allocate): Null allocated memory of
585 newly allocted class arrays.
590 * interface.c(build_compcall_for_operator): Add a type to the
592 * trans-expr.c (conv_base_obj_fcn_val): New function.
593 (gfc_conv_procedure_call): Use base_expr to detect non-variable
594 base objects and, ensuring that there is a temporary variable,
595 build up the typebound call using conv_base_obj_fcn_val.
596 (gfc_trans_class_assign): Pick out class procedure pointer
597 assignments and do the assignment with no further prcessing.
598 (gfc_trans_class_array_init_assign, gfc_trans_class_init_assign
599 gfc_trans_class_assign): Move to top of file.
600 * gfortran.h : Add 'base_expr' field to gfc_expr.
601 * resolve.c (get_declared_from_expr): Add 'types' argument to
602 switch checking of derived types on or off.
603 (resolve_typebound_generic_call): Set the new argument.
604 (resolve_typebound_function, resolve_typebound_subroutine):
605 Set 'types' argument for get_declared_from_expr appropriately.
606 Identify base expression, if not a variable, in the argument
607 list of class valued calls. Assign it to the 'base_expr' field
608 of the final expression. Strip away all references after the
609 last class reference.
611 2012-01-02 Tobias Burnus <burnus@net-b.de>
614 * trans-intrinsic.c (trans_this_image, trans_image_index,
615 trans_num_images, conv_intrinsic_cobound): Fold_convert the
616 caf_num_images/caf_this_images variables to the correct int kind.
618 2012-01-01 Jakub Jelinek <jakub@redhat.com>
620 * gfortranspec.c (lang_specific_driver): Update copyright notice
623 Copyright (C) 2012 Free Software Foundation, Inc.
625 Copying and distribution of this file, with or without modification,
626 are permitted in any medium without royalty provided the copyright
627 notice and this notice are preserved.