OSDN Git Service

2011-12-11 Tobias Burnus <burnus@net-b.de>
[pf3gnuchains/gcc-fork.git] / gcc / fortran / ChangeLog
index 4d78f77..2cab0db 100644 (file)
@@ -1,3 +1,476 @@
+2011-12-11  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/50923
+       * trans-decl.c (generate_local_decl): Set TREE_NO_WARNING only
+       if the front end has printed a warning.
+       (gfc_generate_function_code): Fix unset-result warning.
+
+2011-12-11  Paul Thomas  <pault@gcc.gnu.org>
+       Tobias Burnus  <burnus@gcc.gnu.org>
+
+       PR fortran/41539
+       PR fortran/43214
+       PR fortran/43969
+       PR fortran/44568
+       PR fortran/46356
+       PR fortran/46990
+       PR fortran/49074
+       * interface.c(symbol_rank): Return the rank of the _data
+       component of class objects.
+       (compare_parameter): Also compare the derived type of the class
+       _data component for type mismatch.  Similarly, return 1 if the
+       formal and _data ranks match.
+       (compare_actual_formal): Do not compare storage sizes for class
+       expressions. It is an error if an actual class array, passed to
+       a formal class array is not full.
+       * trans-expr.c (gfc_class_data_get, gfc_class_vptr_get,
+       gfc_vtable_field_get, gfc_vtable_hash_get, gfc_vtable_size_get,
+       gfc_vtable_extends_get, gfc_vtable_def_init_get,
+       gfc_vtable_copy_get): New functions for class API.
+       (gfc_conv_derived_to_class): For an array reference in an
+       elemental procedure call retain the ss to provide the
+       scalarized array reference. Moved in file.
+       (gfc_conv_class_to_class): New function.
+       (gfc_conv_subref_array_arg): Use the type of the
+       class _data component as a basetype.
+       (gfc_conv_procedure_call): Ensure that class array expressions
+       have both the _data reference and an array reference. Use 
+       gfc_conv_class_to_class to handle class arrays for elemental
+       functions in scalarized loops, class array elements and full
+       class arrays. Use a call to gfc_conv_subref_array_arg in order
+       that the copy-in/copy-out for passing class arrays to derived
+       type arrays occurs correctly.
+       (gfc_conv_expr): If it is missing, add the _data component
+       between a class object or component and an array reference.
+       (gfc_trans_class_array_init_assign): New function.
+       (gfc_trans_class_init_assign): Call it for array expressions.
+       * trans-array.c (gfc_add_loop_ss_code): Do not use a temp for
+       class scalars since their size will depend on the dynamic type.
+       (build_class_array_ref): New function.
+       (gfc_conv_scalarized_array_ref): Call build_class_array_ref.
+       (gfc_array_init_size): Add extra argument, expr3, that represents
+       the SOURCE argument. If present,use this for the element size.
+       (gfc_array_allocate): Also add argument expr3 and use it when
+       calling gfc_array_init_size.
+       (structure_alloc_comps): Enable class arrays.
+       * class.c (gfc_add_component_ref): Carry over the derived type
+       of the _data component.
+       (gfc_add_class_array_ref): New function.
+       (class_array_ref_detected): New static function.
+       (gfc_is_class_array_ref): New function that calls previous.
+       (gfc_is_class_scalar_expr): New function.
+       (gfc_build_class_symbol): Throw not implemented error for
+       assumed size class arrays.  Remove error that prevents
+       CLASS arrays.
+       (gfc_build_class_symbol): Prevent pointer/allocatable conflict.
+       Also unset codimension.
+       (gfc_find_derived_vtab): Make 'copy' elemental and set the
+       intent of the arguments accordingly.: 
+       * trans-array.h : Update prototype for gfc_array_allocate.
+       * array.c (gfc_array_dimen_size): Return failure if class expr.
+       (gfc_array_size): Likewise.
+       * gfortran.h : New prototypes for gfc_add_class_array_ref,
+       gfc_is_class_array_ref and gfc_is_class_scalar_expr.
+       * trans-stmt.c (trans_associate_var): Exclude class targets
+       from test. Move the allocation of the _vptr to an earlier time
+       for class objects.
+       (trans_associate_var): Assign the descriptor directly for class
+       arrays.
+       (gfc_trans_allocate): Add expr3 to gfc_array_allocate arguments.
+       Convert array element references into sections. Do not invoke
+       gfc_conv_procedure_call, use gfc_trans_call instead.
+       * expr.c (gfc_get_corank): Fix for BT_CLASS.
+       (gfc_is_simply_contiguous): Exclude class from test.
+       * trans.c (gfc_build_array_ref): Include class array refs.
+       * trans.h : Include prototypes for class API functions that are
+       new in trans-expr. Define GFC_DECL_CLASS(node).
+       * resolve.c (check_typebound_baseobject ): Remove error for
+       non-scalar base object.
+       (resolve_allocate_expr): Ensure that class _data component is
+       present. If array, call gfc_expr_to_intialize.
+       (resolve_select): Remove scalar error for SELECT statement as a
+       temporary measure.
+       (resolve_assoc_var): Update 'target' (aka 'selector') as
+       needed. Ensure that the target expression has the right rank.
+       (resolve_select_type): Ensure that target expressions have a
+       valid locus.
+       (resolve_allocate_expr, resolve_fl_derived0): Fix for BT_CLASS.
+       * trans-decl.c (gfc_get_symbol_decl): Set GFC_DECL_CLASS, where
+       appropriate.
+       (gfc_trans_deferred_vars): Get class arrays right.
+       * match.c(select_type_set_tmp): Add array spec to temporary.
+       (gfc_match_select_type): Allow class arrays.
+       * check.c (array_check): Ensure that class arrays have refs.
+       (dim_corank_check, dim_rank_check): Retrun success if class.
+       * primary.c (gfc_match_varspec): Fix for class arrays and
+       co-arrays. Make sure that class _data is present.
+       (gfc_match_rvalue): Handle class arrays.
+       *trans-intrinsic.c (gfc_conv_intrinsic_size): Add class array
+       reference.
+       (gfc_conv_allocated): Add _data component to class expressions.
+       (gfc_add_intrinsic_ss_code): ditto.
+       * simplify.c (simplify_cobound): Fix for BT_CLASS.
+       (simplify_bound): Return NULL for class arrays.
+       (simplify_cobound): Obtain correct array_spec. Use cotype as
+       appropriate. Use arrayspec for bounds.
+
+2011-12-11  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/50690
+       * frontend-passes.c (in_omp_workshare):  New variable.
+       (cfe_expr_0):  Don't eliminiate common function if it would put
+       the variable immediately into a WORKSHARE construct.
+       (optimize_namespace):  Set in_omp_workshare.
+       (gfc_code_walker):  Keep track of OMP PARALLEL and OMP WORKSHARE
+       constructs.
+
+2011-12-10  Tobias Burnus  <burnus@net-b.de>
+
+       * trans-decl.c (add_argument_checking): Fix syntax.
+
+2011-12-10  Tobias Burnus  <burnus@net-b.de>
+           Kai Tietz  <ktietz@redhat.com>
+
+       * trans-decl.c (add_argument_checking): Check ts.deferred earlier.
+       * trans-intrinsic.c (gfc_conv_intrinsic_repeat): Use %ld with long.
+
+2011-12-08  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/50815
+       * trans-decl.c (add_argument_checking): Skip bound checking
+       for deferred-length strings.
+
+2011-12-08  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/51378
+       * symbol.c (gfc_find_component): Fix access check of parent
+       components.
+
+2011-12-08  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/51407
+       * io/transfer.c (require_numeric_type): New function.
+       (formatted_transfer_scalar_read, formatted_transfer_scalar_write):
+       Use it, allow BOZ edit descriptors with F2008.
+
+2011-12-08  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/51448
+       * fortran/trans-array.c (get_std_lbound): Fix handling of
+       conversion functions.
+
+2011-12-08  Toon Moene  <toon@moene.org>
+
+       PR fortran/51310
+       * invoke.texi: Itemize the cases for which
+       -finit-<type>=<constant> doesn't work.
+
+2011-12-06  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/51435
+       * expr.c (gfc_has_default_initializer): Fix handling of
+       DT with initialized pointer components.
+
+2011-12-05  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/51338
+       * dependency.c (are_identical_variables):  Handle case where
+       end fields of substring references are NULL.
+
+2011-12-04  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/51383
+       * resolve.c (find_array_spec): Use ref->u.c.component
+       directly without starting from ts.u.derived.
+
+2011-12-03  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/48887
+       * match.c (select_type_set_tmp): Don't set allocatable/pointer
+       attribute.
+       * class.c (gfc_build_class_symbol): Handle
+       attr.select_type_temporary.
+
+2011-12-03  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/50684
+       * check.c (variable_check): Fix intent(in) check.
+
+2011-12-03  Tobias Burnus  <burnus@net-b.de>
+
+       * check.c (gfc_check_move_alloc): Allow nonpolymorphic
+       FROM with polymorphic TO.
+       * trans-intrinsic.c (conv_intrinsic_move_alloc): Handle
+       nonpolymorphic FROM with polymorphic TO.
+
+2011-12-01  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * module.c (dt_lower_string): Make static.
+       (dt_upper_string): Likewise.
+
+2011-12-01  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR fortran/25708
+       * module.c (parse_string): Read string into resizable array
+       instead of parsing twice and seeking.
+       (peek_atom): New implementation avoiding seeks.
+       (require_atom): Save and set column and line explicitly for error
+       handling.
+
+2011-12-01  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * misc.c (gfc_open_file): Don't call stat.
+
+2011-11-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/40958
+       * module.c (prev_module_line):  New variable.
+       (prev_module_column):  New variable.
+       (prev_character):  New variable.
+       (module_char):  Update the new variables.
+       (module_unget_char):  New function.
+       (parse_string):  Use module_unget_char.
+       (parse_integer):  Likewise.
+       (parse_name):  Likewise.
+
+2011-11-29  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/51306
+       PR fortran/48700
+       * check.c (gfc_check_move_alloc): Make sure that from/to
+       are both polymorphic or neither.
+       * trans-intrinsic.c (conv_intrinsic_move_alloc): Cleanup,
+       generate inline code.
+
+2011-11-28  Tobias Burnus  <burnus@net-b.de>
+           Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/51308
+       * symbol.c (check_conflict): Ignore BIND(C) + PARAMETER
+       conflicts for ISO_C_BINDING variables.
+       (gen_special_c_interop_ptr): Don't mark c_ptr_null/c_funptr_null
+       as SAVE.
+
+2011-11-25  Mikael Morin  <mikael@gcc.gnu.org>
+
+       * trans-array.c (set_loop_bounds): Remove dead conditions.
+
+2011-11-25  Mikael Morin  <mikael@gcc.gnu.org>
+
+       PR fortran/51250
+       PR fortran/43829
+       * trans-array.c (gfc_trans_create_temp_array): Get dimension from
+       the right gfc_ss struct.
+
+2011-11-25  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/50408
+       * trans-decl.c (gfc_get_module_backend_decl): Also copy
+       ts.u.derived from the gsym if the ts.type is BT_CLASS.
+       (gfc_get_extern_function_decl): Copy also the backend_decl
+       for the symbol's ts.u.{derived,cl} from the gsym.
+       * trans-types.c (gfc_copy_dt_decls_ifequal): Directly
+       return if "from" and "to" are the same.
+
+2011-11-25  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/51302
+       * trans-stmt.c (gfc_trans_simple_do): Add a fold_convert.
+
+2011-11-24  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/51218
+       * resolve.c (pure_subroutine): If called subroutine is
+       impure, unset implicit_pure.
+       (resolve_function): Move impure check to simplify code.
+
+2011-11-19  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/51207
+       * class.c (gfc_find_derived_vtab): Mark __def_init as PARAMETER
+       and hence as TREE_READONLY; add subroutine attribute to
+       __copy_ procedure.
+
+       PR fortran/50640
+       * trans.h (GFC_DECL_PUSH_TOPLEVEL): New DECL_LANG_FLAG_7.
+       * trans-decl.c (gfc_get_symbol_decl): Mark __def_init and vtab as
+       GFC_DECL_PUSH_TOPLEVEL.
+       (gfc_generate_function_code): If GFC_DECL_PUSH_TOPLEVEL, push it there.
+       (build_function_decl): Push __copy_ procedure to the toplevel.
+
+2011-11-16  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/39427
+       PR fortran/37829
+       * decl.c (match_data_constant, match_data_constant, variable_decl,
+       gfc_match_decl_type_spec, access_attr_decl,
+       check_extended_derived_type, gfc_match_derived_decl,
+       gfc_match_derived_decl, gfc_match_derived_decl) Modified to deal
+       with DT constructors.
+       * gfortran.h (gfc_find_dt_in_generic,
+       gfc_convert_to_structure_constructor): New function prototypes.
+       * interface.c (check_interface0, check_interface1,
+       gfc_search_interface): Ignore DT constructors in generic list.
+       * match.h (gfc_match_structure_constructor): Update prototype.
+       * match.c (match_derived_type_spec): Ensure that one uses the DT
+       not the generic function.
+       * module.c (MOD_VERSION): Bump.
+       (dt_lower_string, dt_upper_string): New functions.
+       (find_use_name_n, find_use_operator, compare_true_names,
+       find_true_name, add_true_name, fix_mio_expr, load_needed,
+       read_module, write_dt_extensions, write_symbol): Changes to deal with
+       different symtree vs. sym names.
+       (create_derived_type): Create also generic procedure.
+       * parse.c (gfc_fixup_sibling_symbols): Don't regard DT and generic
+       function as the same.
+       * primary.c (gfc_convert_to_structure_constructor): New function.
+       (gfc_match_structure_constructor): Restructured; calls
+       gfc_convert_to_structure_constructor.
+       (build_actual_constructor, gfc_match_rvalue): Update for DT generic
+       functions.
+       * resolve.c (resolve_formal_arglist, resolve_structure_cons,
+       is_illegal_recursion, resolve_generic_f, resolve_variable,
+       resolve_fl_variable_derived, resolve_fl_derived0,
+       resolve_symbol): Handle DT and DT generic constructors.
+       * symbol.c (gfc_use_derived, gfc_undo_symbols,
+       gen_special_c_interop_ptr, gen_cptr_param,
+       generate_isocbinding_symbol, gfc_get_derived_super_type): Handle
+       derived-types, which are hidden in the generic type.
+       (gfc_find_dt_in_generic): New function
+       * trans-array.c (gfc_conv_array_initializer): Replace FL_PARAMETER
+       expr by actual value.
+       * trans-decl.c (gfc_get_module_backend_decl, gfc_trans_use_stmts):
+       Ensure that we use the DT and not the generic function.
+       * trans-types.c (gfc_get_derived_type): Ensure that we use the DT
+       and not the generic procedure.
+
+2011-11-14  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/51073
+       * trans-decl.c (generate_coarray_sym_init): Handle zero-sized arrays.
+
+2011-11-09  Tobias Burnus  <burnus@net-b.de>
+
+       * symbol.c (clear_sym_mark, traverse_ns): Remove functions.
+       (count_st_nodes, do_traverse_symtree, fill_st_vector): New functions.
+       (gfc_traverse_symtree, gfc_traverse_ns): Call do_traverse_symtree.
+
+2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       PR libfortran/50016
+       * gfortran.texi (Data consistency and durability): New section.
+
+2011-11-09  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/50540
+       * resolve.c (resolve_forall_iterators): Transform internal errors
+       to normal errors.
+
+2011-11-09  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/50960
+       * class.c (gfc_find_derived_vtab): Make the vtab symbols FL_PARAMETER.
+       * expr.c (gfc_simplify_expr): Prevent vtabs from being replaced with
+       their value.
+       * resolve.c (resolve_values): Use-associated symbols do not need to
+       be resolved again.
+       (resolve_fl_parameter): Make sure the symbol has a value.
+
+2011-11-09  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/38718
+       * intrinsic.c (add_functions): Allow dreal simplification.
+       * intrinsic.h (gfc_simplify_dreal): New prototype.
+       * simplify.c (gfc_simplify_dreal): New function.
+
+2011-11-09  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/21881
+       * trans-types.c (gfc_get_dtype): Issue a fatal error instead of
+       an internal error.
+
+2011-11-08  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/50404
+       * io.c (gfc_resolve_close): CLOSE requires a UNIT.
+
+2011-11-08  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/50409
+       * expr.c (gfc_simplify_expr): Substrings can't have negative
+       length.
+
+2011-11-08  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/50334
+       * invoke.texi (-finit-*): Document interaction with
+       -Wuninitialized.
+
+2011-11-07  François-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR libfortran/49188
+       PR libfortran/49336
+       * invoke.texi: Fix documentation of fsign-zero option. Remove
+       contractions.
+       * intrinsic.texi: Fix ATAN2 documentation for signed zeros.
+       Remove contractions.
+       * gfortran.texi: Remove contractions.
+
+2011-11-07  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/50919
+       * class.c (add_proc_comp): Don't add non-overridable procedures to the
+       vtable.
+       * resolve.c (resolve_typebound_function,resolve_typebound_subroutine):
+       Don't generate a dynamic _vptr call for non-overridable procedures.
+
+2011-11-07  Janne Blomqvist  <jb@gcc.gnu.org>
+
+       * intrinsic.texi (MCLOCK, MCLOCK8, TIME, TIME8): Functions clock
+       and time are part of the C standard library.
+
+2011-11-06  Janus Weil  <janus@gcc.gnu.org>
+
+       * gfortran.h (gfc_extend_expr): Modified prototype.
+       * interface.c (gfc_extend_expr): Return 'match' instead of 'gfc_try'.
+       Remove argument 'real_error'.
+       * resolve.c (resolve_operator): Modified call to 'gfc_extend_expr'.
+
+2011-11-06  Andrew MacLeod  <amacleod@redhat.com>
+           Aldy Hernandez  <aldyh@redhat.com>
+
+       Merged from cxx-mem-model.
+
+       * types.def: (BT_SIZE, BT_CONST_VOLATILE_PTR, BT_FN_VOID_INT,
+       BT_FN_I{1,2,4,8,16}_CONST_VPTR_INT, BT_FN_VOID_VPTR_INT,
+       BT_FN_BOOL_VPTR_INT, BT_FN_BOOL_SIZE_CONST_VPTR,
+       BT_FN_VOID_VPTR_I{1,2,4,8,16}_INT, BT_FN_VOID_SIZE_VPTR_PTR_INT,
+       BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT, BT_FN_VOID_SIZE_VPTR_PTR_PTR_INT,
+       BT_FN_BOOL_VPTR_PTR_I{1,2,4,8,16}_BOOL_INT_INT,
+       BT_FN_I{1,2,4,8,16}_VPTR_I{1,2,4,8,16}_INT): New types.
+
+2011-11-04  Mikael Morin  <mikael@gcc.gnu.org>
+
+       PR fortran/43829
+       * trans-array.c (gfc_conv_expr_descriptor): Accept the inline intrinsic
+       case in the assertion.
+       * trans-intrinsic (enter_nested_loop): New function.
+       (gfc_conv_intrinsic_arith): Support non-scalar cases.
+       (nest_loop_dimension, walk_inline_intrinsic_arith): New functions.
+       (walk_inline_intrinsic_function): Handle sum and product.
+       (gfc_inline_intrinsic_function_p): Ditto.
+       * trans.h (gfc_get_loopinfo): New macro.
+
+2011-11-04  Mikael Morin  <mikael@gcc.gnu.org>
+
+       * trans-intrinsic.c (gfc_conv_intrinsic_arith): Introduce parent
+       expression variable.  Use it.
+
+2011-11-04  Mikael Morin  <mikael@gcc.gnu.org>
+
+       * trans-intrinsic.c (gfc_conv_intrinsic.c): Introduce current loop
+       pointer.  Use it.
+
 2011-11-04  Mikael Morin  <mikael@gcc.gnu.org>
 
        * trans-intrinsic.c (gfc_conv_intrinsic_arith): Small argument handling
 2011-10-23  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        * simplify.c (simplify_transformation_to_array): Fix memory leak.
+
 2011-10-20  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/50821