1 2012-02-08 Tobias Burnus <burnus@net-b.de>
4 * trans-expr.c (fcncall_realloc_result): Set also the stride.
6 2012-02-07 Tobias Burnus <burnus@net-b.de>
9 * trans-expr.c (gfc_conv_procedure_call): Add _data component
10 for calls of scalar CLASS actuals to TYPE dummies.
12 2012-02-05 Thomas König <tkoenig@gcc.gnu.org>
15 * trans-decl.c: Warn about unused dummy procedure arguments
16 if -Wunused-dummy-argument is specified. Suppress middle-end
17 warnings about procedure arguments.
19 2012-02-05 Paul Thomas <pault@gcc.gnu.org>
21 * trans-array.c (gfc_array_allocate): Zero memory for all class
23 * trans-stmt.c (gfc_trans_allocate): Ditto for class scalars.
26 * trans-stmt.c (gfc_trans_allocate): Before correcting a class
27 array reference, ensure that 'dataref' points to the _data
28 component that is followed by the array reference..
30 2012-02-02 Mikael Morin <mikael@gcc.gnu.org>
36 * class.c (insert_component_ref, class_data_ref_missing,
37 gfc_fix_class_refs): New functions.
38 * gfortran.h (gfc_fix_class_refs): New prototype.
39 * trans-expr.c (gfc_conv_expr): Remove special case handling and call
40 gfc_fix_class_refs instead.
42 2012-02-02 Paul Thomas <pault@gcc.gnu.org>
45 * trans-expr.c (fcncall_realloc_result): If variable shape is
46 correct, retain the bounds, whatever they are.
48 2012-02-02 Tobias Burnus <burnus@net-b.de>
51 * simplify.c (gfc_simplify_size): Handle INTRINSIC_PARENTHESES.
53 2012-02-01 Thomas König <tkoenig@gcc.gnu.org>
56 * frontend-passes.c (convert_elseif): New function.
57 (optimize_namespace): Call it.
59 2012-02-01 Tobias Burnus <burnus@net-b.de>
62 * module.c (MOD_VERSION): Bump.
63 (mio_typebound_proc): Read/write is_operator from/to the
66 2012-02-01 Tobias Burnus <burnus@net-b.de>
69 * trans-expr.c (gfc_conv_procedure_call): Add array ref
72 2012-01-31 Tobias Burnus <burnus@net-b.de>
75 * gfortran.h (gfc_tbp_generic): Store whether the
76 generic is an operator.
77 * decl.c (gfc_match_generic): Set that flag.
78 * resolve.c (check_generic_tbp_ambiguity): Use it in the
79 gfc_compare_interfaces check.
81 2012-01-31 Tobias Burnus <burnus@net-b.de>
84 * class.c (gfc_find_derived_vtab): Mark _copy function as pure.
86 2012-01-31 Tobias Burnus <burnus@net-b.de>
89 * class.c (get_unique_hashed_string): Adapt trim length.
90 (gfc_build_class_symbol) Encode also corank in the container name.
92 2012-01-31 Paul Thomas <pault@gcc.gnu.org>
95 * trans-expr.c (fcncall_realloc_result): Correct calculation of
98 2012-01-29 Janne Blomqvist <jb@gcc.gnu.org>
100 * module.c (pointer_info): Make true_name and module pointers
101 rather than arrays, order pointers before other fields.
102 (free_pi_tree): free true_name and module as well.
103 (mio_read_string): Rename to read_string.
104 (mio_write_string): Remove.
105 (load_commons): Use read_string.
106 (read_module): Use read_string rather than mio_internal_string.
107 (write_blank_common): Call write_atom directly.
108 (write_symbol): Likewise.
110 2012-01-29 Tobias Burnus <burnus@net-b.de>
113 * expr.c (gfc_default_initializer): Convert the values if
114 the type does not match.
116 2012-01-29 Tobias Burnus <burnus@net-b.de>
119 * trans-array.c (structure_alloc_comps): Fix assignment of
120 polymorphic components (polymorphic deep copying).
122 2012-01-29 Janne Blomqvist <jb@gcc.gnu.org>
125 * decl.c (set_binding_label): Make binding_label argument const.
126 (curr_binding_label): Constify.
127 * gfortran.h (gfc_symbol): Constify binding_label.
128 (gfc_common_head): Likewise.
129 (get_iso_c_sym): Likewise.
130 * match.c (gfc_match_name_C): Constify buffer argument.
131 * match.h (gfc_match_name_C): Likewise.
132 * resolve.c (set_name_and_label): Constify binding_label argument.
133 (gfc_iso_c_sub_interface): Constify binding_label variable.
134 * symbol.c (get_iso_c_sym): Constify binding_label argument.
136 2012-01-29 Janne Blomqvist <jb@gcc.gnu.org>
139 * decl.c (set_binding_label): Move prototype from match.h to here.
140 (curr_binding_label): Make a pointer rather than static array.
141 (build_sym): Check sym->binding_label pointer rather than array,
142 update set_binding_label call, handle curr_binding_label changes.
143 (set_binding_label): Handle new curr_binding_label, dest_label
144 double ptr, and sym->binding_label.
145 (verify_bind_c_sym): Handle sym->binding_label being a pointer.
146 (set_verify_bind_c_sym): Check sym->binding_label pointer rather
147 than array, update set_binding_label call.
148 (gfc_match_bind_c_stmt): Handle curr_binding_label change.
149 (match_procedure_decl): Update set_binding_label call.
150 (gfc_match_bind_c): Change binding_label to pointer, update
151 gfc_match_name_C call.
152 * gfortran.h (GFC_MAX_BINDING_LABEL_LEN): Remove macro.
153 (gfc_symbol): Make binding_label a pointer.
154 (gfc_common_head): Likewise.
155 * match.c (gfc_match_name_C): Heap allocate bind(C) name.
156 * match.h (gfc_match_name_C): Change prototype argument.
157 (set_binding_label): Move prototype to decl.c.
158 * module.c (struct pointer_info): Make binding_label a pointer.
159 (free_pi_tree): Free unused binding_label.
160 (mio_read_string): New function.
161 (mio_write_string): New function.
162 (load_commons): Redo reading of binding_label.
163 (read_module): Likewise.
164 (write_common_0): Change to write empty string instead of name if
166 (write_blank_common): Write empty string for binding label.
167 (write_symbol): Change to write empty string instead of name if no
169 * resolve.c (gfc_iso_c_func_interface): Don't set binding_label.
170 (set_name_and_label): Make binding_label double pointer, use
172 (gfc_iso_c_sub_interface): Make binding_label a pointer.
173 (resolve_bind_c_comms): Handle cases if
174 gfc_common_head->binding_label is NULL.
175 (gfc_verify_binding_labels): sym->binding_label is a pointer.
176 * symbol.c (gfc_new_symbol): Rely on XCNEW zero init for
178 (gen_special_c_interop_ptr): Don't set binding label.
179 (generate_isocbinding_symbol): Insert binding_label into symbol
181 (get_iso_c_sym): Use pointer assignment instead of strcpy.
182 * trans-common.c (gfc_sym_mangled_common_id): Handle
183 com->binding_label being a pointer.
184 * trans-decl.c (gfc_sym_mangled_identifier): Handle
185 sym->binding_label being a pointer.
186 (gfc_sym_mangled_function_id): Likewise.
188 2012-01-29 Tobias Burnus <burnus@net-b.de>
191 * resolve.c (symbol_as): Remove unused, accidentally
194 2012-01-28 Tobias Burnus <burnus@net-b.de>
197 * trans-stmt.c (gfc_trans_allocate): Properly check whether
198 we have a BT_CLASS which needs to be memset.
200 2012-01-27 Tobias Burnus <burnus@net-b.de>
203 * trans-expr.c (gfc_conv_procedure_call): Fix passing
204 of functions, which return allocatables.
206 2012-01-27 Tobias Burnus <burnus@net-b.de>
209 * resolve.c (resolve_formal_arglist): Fix elemental
210 constraint checks for polymorphic dummies also for
213 2012-01-27 Tobias Burnus <burnus@net-b.de>
217 * primary.c (gfc_match_varspec. gfc_match_rvalue): Set
218 handle array spec for BT_CLASS.
219 * expr.c (gfc_get_variable_expr, gfc_lval_expr_from_sym)
220 * frontend-passes.c (create_var): Ditto.
221 * resolve.c (resolve_actual_arglist, resolve_assoc_var): Ditto.
222 * trans-decl.c (gfc_trans_deferred_vars): Use class_pointer
223 instead of attr.pointer.
224 (gfc_generate_function_code): Use CLASS_DATA (sym) for BT_CLASS.
225 * trans-intrinsic.c (conv_intrinsic_move_alloc): Move assert.
226 * trans-stmt.c (trans_associate_var): Ask for the descriptor.
228 2012-01-27 Tobias Burnus <burnus@net-b.de>
231 * match.c (gfc_match_allocate): Allow more than allocate
234 2012-01-27 Tobias Burnus <burnus@net-b.de>
237 * resolve.c (resolve_formal_arglist): Fix elemental
238 constraint checks for polymorphic dummies.
240 2012-01-27 Paul Thomas <pault@gcc.gnu.org>
241 Tobias Burnus <burnus@gcc.gnu.org>
247 * trans-array.c (gfc_array_init_size): Add two extra arguments
248 to convey the dynamic element size of a calls object and to
249 return the number of elements that have been allocated.
250 (gfc_array_allocate): Add the same arguments and use them to
251 call gfc_array_init_size. Before the allocation dereference
252 the data pointer, if necessary. Set the allocated array to zero
253 if the class element size or expr3 are non-null.
254 * trans-expr.c (gfc_conv_class_to_class): Give this function
256 (get_class_array_ref): New function.
257 (gfc_copy_class_to_class): New function.
258 * trans-array.h : Update prototype for gfc_array_allocate.
259 * trans-stmt.c (gfc_trans_allocate): For non-variable class
260 STATUS expressions extract the class object and the dynamic
261 element size. Use the latter to call gfc_array_allocate and
262 the former for setting the vptr and, via
263 gfc_copy_class_to_clasfc_cs, to copy to the allocated data.
264 * trans.h : Prototypes for gfc_get_class_array_ref,
265 gfc_copy_class_to_class and gfc_conv_class_to_class.
267 2012-01-25 Tobias Burnus <burnus@net-b.de>
269 * resolve.c (symbol_as): Check also for attr.class_ok.
271 2012-01-25 Tobias Burnus <burnus@net-b.de>
274 * class.c (gfc_build_class_symbol): Fix invalid freeing
275 issue with fclass->f2k_derived.
277 2012-01-25 Tobias Burnus <burnus@net-b.de>
280 * class.c (gfc_build_class_symbol): Ensure that
281 fclass->f2k_derived is set.
283 2012-01-25 Tobias Burnus <burnus@net-b.de>
286 * resolve.c (resolve_structure_cons): Only create an
287 array constructors for nonscalars.
289 2012-01-23 Tobias Burnus <burnus@net-b.de>
292 * check.c (variable_check): Fix checking for
293 variables and deeply nested BLOCKs.
295 2012-01-21 Tobias Burnus <burnus@net-b.de>
296 Steven G. Kargl <kargl@gcc.gnu.org>
299 * symbol.c (check_conflict): namelist-group-name cannot have the SAVE
302 2012-01-21 Tobias Burnus <burnus@net-b.de>
305 * interface.c (compare_parameter): Fix CLASS comparison.
307 2012-01-20 Tobias Burnus <burnus@net-b.de>
308 Janus Weil <janus@gcc.gnu.org>
311 * module.c (load_needed, read_module): Don't mark __vtab etc.
314 2012-01-19 Tobias Burnus <burnus@net-b.de>
317 * expr.c (gfc_build_intrinsic_call): Also set the symtree.
319 2012-01-18 Paul Thomas <pault@gcc.gnu.org>
322 * trans-expr.c (gfc_conv_procedure_call): Deallocate allocatable
323 components of temporary class arguments.
325 2012-01-17 Tobias Burnus <burnus@net-b.de>
326 Janne Blomqvist <jb@gcc.gnu.org>
329 * trans-expr.c (alloc_scalar_allocatable_for_assignment): Nullify
330 LHS after allocation, if it has allocatable components.
331 * f95-lang.c (gfc_init_builtin_functions): Add BUILT_IN_CALLOC.
333 2012-01-16 Mikael Morin <mikael@gcc.gnu.org>
334 Tobias Burnus <burnus@net-b.de>
337 * trans-array.c (gfc_walk_elemental_function_args): Fix
338 passing of deallocated allocatables/pointers as absent argument.
340 2012-01-16 Tobias Burnus <burnus@net-b.de>
343 * class.c (gfc_find_derived_vtab): Mark __vtab and
344 __def_init as FL_VARIABLE not as FL_PARAMETER.
345 * expr.c (gfc_simplify_expr): Remove special
347 * resolve.c (resolve_values): Ditto.
348 * trans-decl.c (gfc_get_symbol_decl): Mark __vtab
349 and __def_init as TREE_READONLY.
351 2012-01-16 Zydrunas Gimbutas <gimbutas@cims.nyu.edu>
352 Andreas Kloeckner <kloeckner@cims.nyu.edu>
353 Steven G. Kargl <kargl@gcc.gnu.org>
356 * gfortran.h (gfc_option_t): Add members flag_*_kind to store kind.
357 * lang.opt: Add options -freal-4-real-8, -freal-4-real-10,
358 -freal-4-real-16, -freal-8-real-4, -freal-8-real-10, -freal-8-real-16
359 and -finteger-4-integer-8. User-desired type conversion information.
360 * decl.c (gfc_match_old_kind_spec,kind_expr): Type conversions
361 in declaration parsing.
362 * trans-types.c (gfc_init_kinds): User-specified type conversion
363 checked for current backend.
364 * primary.c (match_integer_constant,match_real_constant): Implement
365 type conversion in constant parsing.
366 * options.c (gfc_init_options,gfc_handle_option): Translate input
367 options to flags in internal options data structure.
368 * invoke.texi: Document new options. Re-order options in Options
371 2012-01-16 Paul Thomas <pault@gcc.gnu.org>
373 * trans-array.c (gfc_trans_create_temp_array): In the case of a
374 class array temporary, detect a null 'eltype' on entry and use
375 'initial' to provde the class reference and so, through the
376 vtable, the element size for the dynamic type.
377 * trans-stmt.c (gfc_conv_elemental_dependencies): For class
378 expressions, set 'eltype' to null and pass the values via the
379 'initial' expression.
381 2012-01-14 Tobias Burnus <burnus@net-b.de>
384 * resolve.c (build_default_init_expr): Also initialize
385 nonconstant-length strings with -finit-character=<n>.
387 2011-01-14 Tobias Burnus <burnus@net-b.de>
390 * module.c (read_module): Don't make nonexisting
391 intrinsic operators as found.
392 (rename_list_remove_duplicate): New function.
393 (gfc_use_modules): Use it.
395 2012-01-13 Paul Thomas <pault@gcc.gnu.org>
398 * trans-array.c (structure_alloc_comps): Suppress interative
399 call to self, when current component is deallocated using
400 gfc_trans_dealloc_allocated.
401 * class.c (gfc_build_class_symbol): Copy the 'alloc_comp'
402 attribute from the declared type to the class structure.
404 2012-01-13 Tobias Burnus <burnus@net-b.de>
407 * fortran/trans-types.c (gfc_init_kinds): Use PTRDIFF_TYPE
408 instead of a signed int of size POINTER_SIZE for
409 gfc_index_integer_kind.
411 2012-01-12 Tobias Burnus <burnus@net-b.de>
414 * intrinsic.texi (CHMOD): Extend a bit and remove statement
415 that /bin/chmod is called.
417 2012-01-10 Gerald Pfeifer <gerald@pfeifer.com>
419 * gfortran.texi (Fortran 2003 Status): Fix grammar.
421 2012-01-10 Tobias Burnus <burnus@net-b.de>
424 * resolve.c (resolve_allocate_expr): For non-deferred char lengths,
425 check whether type-spec matches declaration.
427 2012-01-10 Tobias Burnus <burnus@net-b.de>
429 * resolve.c (resolve_ordinary_assign): Improve error wording.
431 2012-01-09 Paul Thomas <pault@gcc.gnu.org>
434 * interface.c (matching_typebound_op): Drill down through
435 possible parentheses to obtain base expression. Do not test for
436 'class_ok' but, instead for the class structure components.
437 * resolve.c (resolve_ordinary_assign): Extend error message for
438 polymorphic assignment to advise checking for specific
442 * resolve.c (resolve_typebound_function): Restore 'static' to
445 2012-01-09 Mikael Morin <mikael@gcc.gnu.org>
448 * trans-array.c (gfc_walk_elemental_function_args):
449 Skip over NULL() actual arguments.
451 2012-01-09 Tobias Burnus <burnus@net-b.de>
453 * gfortran.texi: Bump copyright year.
454 (Fortran 2003 Status): Update polymorphism item, add
455 item for generic interface with DT name.
457 2012-01-09 Tobias Burnus <burnus@net-b.de>
460 * gfortran.h (gfc_use_list):
461 * match.h (gfc_use_module): Rename to ...
462 (gfc_use_modules): ... this.
463 * module.c (use_locus, specified_nonint, specified_int): Remove
465 (module_name): Change type to const char*, used with gfc_get_string.
466 (module_list): New global variable.
467 (free_rename): Free argument not global var.
468 (gfc_match_use): Save match to module_list.
469 (load_generic_interfaces, read_module): Don't free symtree.
470 (write_dt_extensions, gfc_dump_module): Fix module-name I/O due to the
471 type change of module_name.
472 (write_symbol0, write_generic): Optimize due to the type change.
473 (import_iso_c_binding_module, use_iso_fortran_env_module): Use
474 locus of rename->where.
475 (gfc_use_module): Take module_list as argument.
476 (gfc_use_modules): New function.
477 (gfc_module_init_2, gfc_module_done_2): Init module_list, rename_list.
478 * parse.c (last_was_use_stmt): New global variable.
479 (use_modules): New function.
480 (decode_specification_statement, decode_statement): Move USE match up
481 and call use_modules.
482 (next_free, next_fixed): Call use_modules.
483 (accept_statement): Don't call gfc_module_use.
485 2012-01-06 Tobias Burnus <burnus@net-b.de>
487 * trans-openmp.c (gfc_omp_clause_dtor, gfc_trans_omp_array_reduction):
488 Update call to gfc_trans_dealloc_allocated.
489 * trans.c (gfc_allocate_using_malloc): Fix spacing.
490 (gfc_allocate_allocatable): For gfc_allocate_using_lib, jump to
491 label_finish when an error occurs.
492 (gfc_deallocate_with_status): Call caf_deregister for -fcoarray=lib.
493 * trans.h (gfc_allocate_allocatable, gfc_deallocate_with_status):
495 (gfor_fndecl_caf_deregister): New tree symbol.
496 * trans-expr.c (gfc_conv_procedure_call): Update
497 gfc_deallocate_with_status and gfc_trans_dealloc_allocated calls.
498 * trans-array.c (gfc_array_allocate, gfc_trans_dealloc_allocated,
499 structure_alloc_comps, gfc_trans_deferred_array): Ditto.
500 (gfc_array_deallocate): Handle coarrays with -fcoarray=lib.
501 * trans-array.h (gfc_array_deallocate, gfc_array_allocate,
502 gfc_trans_dealloc_allocated): Update prototypes.
503 * trans-stmt.c (gfc_trans_sync): Fix indentation.
504 (gfc_trans_allocate): Fix errmsg padding and label handling.
505 (gfc_trans_deallocate): Ditto and handle -fcoarray=lib.
506 * expr.c (gfc_is_coarray): Fix algorithm for BT_CLASS.
507 * libgfortran.h (GFC_STAT_STOPPED_IMAGE): Use large value
508 to avoid other stats accidentally matching this one.
509 * trans-decl.c (gfor_fndecl_caf_deregister): New global var.
510 (gfc_build_builtin_function_decls): Fix prototype decl of caf_register
511 and add decl for caf_deregister.
512 (gfc_trans_deferred_vars): Handle CAF vars with -fcoarrays=lib.
513 * trans-intrinsic.c (conv_intrinsic_move_alloc): Update call to
514 gfc_deallocate_with_status.
516 2012-01-05 Paul Thomas <pault@gcc.gnu.org>
519 * resolve.c (resolve_typebound_static): If the typebound
520 procedure is 'deferred' try to find the correct specific
521 procedure in the derived type operator space itself.
523 2012-01-04 Mikael Morin <mikael@gcc.gnu.org>
526 * trans-array.h (gfc_walk_elemental_function_args): New argument.
527 * trans-intrinsic.c (gfc_walk_intrinsic_function): Update call.
528 * trans-stmt.c (gfc_trans_call): Ditto.
529 * trans-array.c (gfc_walk_function_expr): Ditto.
530 (gfc_walk_elemental_function_args): Get the dummy argument list
531 if possible. Check that the dummy and the actual argument are both
532 optional, and set can_be_null_ref accordingly.
534 2012-01-04 Mikael Morin <mikael@gcc.gnu.org>
537 * trans.h (struct gfc_ss_info): New field data::scalar::can_be_null_ref
538 * trans-array.c: If the reference can be NULL, save the reference
539 instead of the value.
540 * trans-expr.c (gfc_conv_expr): If we have saved a reference,
543 2012-01-04 Mikael Morin <mikael@gcc.gnu.org>
545 * trans-expr.c (gfc_conv_expr): Move address taking...
546 (gfc_conv_expr_reference): ... here.
548 2012-01-04 Thomas Koenig <tkoenig@gcc.gnu.org>
551 * trans-common.c (create_common): Update copyright years. Mark
552 variables as used to avoid warnings about unused variables in
555 2012-01-03 Hans-Peter Nilsson <hp@axis.com>
557 * gfortran.h (struct gfc_expr): Add missing "struct"
558 qualifier for member base_expr.
560 2012-01-02 Paul Thomas <pault@gcc.gnu.org>
563 * trans-array.c (gfc_array_allocate): Null allocated memory of
564 newly allocted class arrays.
569 * interface.c(build_compcall_for_operator): Add a type to the
571 * trans-expr.c (conv_base_obj_fcn_val): New function.
572 (gfc_conv_procedure_call): Use base_expr to detect non-variable
573 base objects and, ensuring that there is a temporary variable,
574 build up the typebound call using conv_base_obj_fcn_val.
575 (gfc_trans_class_assign): Pick out class procedure pointer
576 assignments and do the assignment with no further prcessing.
577 (gfc_trans_class_array_init_assign, gfc_trans_class_init_assign
578 gfc_trans_class_assign): Move to top of file.
579 * gfortran.h : Add 'base_expr' field to gfc_expr.
580 * resolve.c (get_declared_from_expr): Add 'types' argument to
581 switch checking of derived types on or off.
582 (resolve_typebound_generic_call): Set the new argument.
583 (resolve_typebound_function, resolve_typebound_subroutine):
584 Set 'types' argument for get_declared_from_expr appropriately.
585 Identify base expression, if not a variable, in the argument
586 list of class valued calls. Assign it to the 'base_expr' field
587 of the final expression. Strip away all references after the
588 last class reference.
590 2012-01-02 Tobias Burnus <burnus@net-b.de>
593 * trans-intrinsic.c (trans_this_image, trans_image_index,
594 trans_num_images, conv_intrinsic_cobound): Fold_convert the
595 caf_num_images/caf_this_images variables to the correct int kind.
597 2012-01-01 Jakub Jelinek <jakub@redhat.com>
599 * gfortranspec.c (lang_specific_driver): Update copyright notice
602 Copyright (C) 2012 Free Software Foundation, Inc.
604 Copying and distribution of this file, with or without modification,
605 are permitted in any medium without royalty provided the copyright
606 notice and this notice are preserved.