From be262ab5cc288412e8b120dd407cf545bfaa8943 Mon Sep 17 00:00:00 2001 From: ghazi Date: Sun, 28 Jun 2009 06:06:28 +0000 Subject: gcc/fortran: * gfortran.h: Define HAVE_mpc_pow. * arith.c (complex_reciprocal, complex_pow): If HAVE_mpc_pow, don't define these functions. (arith_power): If HAVE_mpc_pow, use mpc_pow. gcc/testsuite: * gfortran.dg/integer_exponentiation_4.f90: Temporarily comment out some values and add some cases. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149023 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index de0025b75b7..80991689770 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1558,6 +1558,9 @@ gfc_intrinsic_sym; #include #ifdef HAVE_mpc #include +# if MPC_VERSION >= MPC_VERSION_NUM(0,6,1) +# define HAVE_mpc_pow +# endif #else #define mpc_realref(X) ((X).r) #define mpc_imagref(X) ((X).i) -- cgit v1.2.1 From 36b0a1b039d86aea9b9684db3b8edaf09a150285 Mon Sep 17 00:00:00 2001 From: burnus Date: Sun, 28 Jun 2009 17:56:41 +0000 Subject: 2009-06-28 Tobias Burnus Francois-Xavier Coudert PR fortran/34112 * symbol.c (gfc_add_ext_attribute): New function. (gfc_get_sym_tree): New argument allow_subroutine. (gfc_get_symbol,gfc_get_ha_sym_tree,gen_cptr_param,gen_fptr_param gen_shape_param,generate_isocbinding_symbol): Use it. * decl.c (find_special): New argument allow_subroutine. (add_init_expr_to_sym,add_hidden_procptr_result,attr_decl1, match_procedure_in_type,gfc_match_final_decl): Use it. (gfc_match_gcc_attributes): New function. * gfortran.texi (Mixed-Language Programming): New section "GNU Fortran Compiler Directives". * gfortran.h (ext_attr_t): New struct. (symbol_attributes): Use it. (gfc_add_ext_attribute): New prototype. (gfc_get_sym_tree): Update pototype. * expr.c (gfc_check_pointer_assign): Check whether call convention is the same. * module.c (import_iso_c_binding_module, create_int_parameter, use_iso_fortran_env_module): Update gfc_get_sym_tree call. * scanner.c (skip_gcc_attribute): New function. (skip_free_comments,skip_fixed_comments): Use it. (gfc_next_char_literal): Support !GCC$ lines. * resolve.c (check_host_association): Update gfc_get_sym_tree call. * match.c (gfc_match_sym_tree,gfc_match_call): Update gfc_get_sym_tree call. * trans-decl.c (add_attributes_to_decl): New function. (gfc_get_symbol_decl,get_proc_pointer_decl, gfc_get_extern_function_decl,build_function_decl: Use it. * match.h (gfc_match_gcc_attributes): Add prototype. * parse.c (decode_gcc_attribute): New function. (next_free,next_fixed): Support !GCC$ lines. * primary.c (match_actual_arg,check_for_implicit_index, gfc_match_rvalue,gfc_match_rvalue): Update gfc_get_sym_tree call. 2009-06-28 Tobias Burnus PR fortran/34112 * gfortran.dg/compiler-directive_1.f90: New test. * gfortran.dg/compiler-directive_2.f: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149036 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 80991689770..67127419b00 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -619,6 +619,28 @@ CInteropKind_t; that the list is initialized. */ extern CInteropKind_t c_interop_kinds_table[]; + +/* Structure and list of supported extension attributes. */ +enum +{ + EXT_ATTR_DLLIMPORT = 0, + EXT_ATTR_DLLEXPORT, + EXT_ATTR_STDCALL, + EXT_ATTR_CDECL, + EXT_ATTR_FASTCALL, + EXT_ATTR_LAST, EXT_ATTR_NUM = EXT_ATTR_LAST +}; + +typedef struct +{ + const char *name; + unsigned id; + const char *middle_end_name; +} +ext_attr_t; + +extern const ext_attr_t ext_attr_list[]; + /* Symbol attribute structure. */ typedef struct { @@ -704,6 +726,9 @@ typedef struct unsigned alloc_comp:1, pointer_comp:1, proc_pointer_comp:1, private_comp:1, zero_comp:1; + /* Attributes set by compiler extensions (!GCC$ ATTRIBUTES). */ + unsigned ext_attr:EXT_ATTR_NUM; + /* The namespace where the VOLATILE attribute has been set. */ struct gfc_namespace *volatile_ns; } @@ -2299,6 +2324,7 @@ gfc_try gfc_set_default_type (gfc_symbol *, int, gfc_namespace *); void gfc_set_sym_referenced (gfc_symbol *); gfc_try gfc_add_attribute (symbol_attribute *, locus *); +gfc_try gfc_add_ext_attribute (symbol_attribute *, unsigned, locus *); gfc_try gfc_add_allocatable (symbol_attribute *, locus *); gfc_try gfc_add_dimension (symbol_attribute *, const char *, locus *); gfc_try gfc_add_external (symbol_attribute *, locus *); @@ -2379,7 +2405,7 @@ gfc_try verify_bind_c_derived_type (gfc_symbol *); gfc_try verify_com_block_vars_c_interop (gfc_common_head *); void generate_isocbinding_symbol (const char *, iso_c_binding_symbol, const char *); gfc_symbol *get_iso_c_sym (gfc_symbol *, char *, char *, int); -int gfc_get_sym_tree (const char *, gfc_namespace *, gfc_symtree **); +int gfc_get_sym_tree (const char *, gfc_namespace *, gfc_symtree **, bool); int gfc_get_ha_symbol (const char *, gfc_symbol **); int gfc_get_ha_sym_tree (const char *, gfc_symtree **); -- cgit v1.2.1 From 88a37d69d9f4acebdb312422aca037999d333638 Mon Sep 17 00:00:00 2001 From: pault Date: Sun, 5 Jul 2009 19:13:59 +0000 Subject: 2009-07-05 Paul Thomas and Tobias Burnus PR fortran/40646 * gfortran.h : Change the compcall member of the 'value' union in the gfc_expr structure so that its fields overlap with the 'function' member. * resolve.c (resolve_compcall): Set the function.esym. * trans-expr.c (gfc_trans_arrayfunc_assign): Use is_proc_ptr_comp in the condition. * dependency.c (gfc_full_array_ref_p): Ensure that 'contiguous' retunrs a value if non-NULL. 2009-07-05 Paul Thomas and Tobias Burnus PR fortran/40646 * gfortran.dg/func_assign_3.f90 : New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149262 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 67127419b00..260d718b13c 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1678,8 +1678,9 @@ typedef struct gfc_expr struct { gfc_actual_arglist* actual; - gfc_typebound_proc* tbp; const char* name; + void* padding; /* Overlap gfc_typebound_proc with esym. */ + gfc_typebound_proc* tbp; } compcall; -- cgit v1.2.1 From ff70e44325c390560120b8ab5a8e0043d0403aef Mon Sep 17 00:00:00 2001 From: janus Date: Thu, 9 Jul 2009 14:07:03 +0000 Subject: 2009-07-09 Janus Weil PR fortran/40646 * dump-parse-tree.c (show_expr): Renamed 'is_proc_ptr_comp'. * expr.c (is_proc_ptr_comp): Renamed to 'gfc_is_proc_ptr_comp'. (gfc_check_pointer_assign): Renamed 'is_proc_ptr_comp'. (replace_comp,gfc_expr_replace_comp): New functions, analogous to 'replace_symbol' and 'gfc_expr_replace_symbol', just with components instead of symbols. * gfortran.h (gfc_expr_replace_comp): New prototype. (is_proc_ptr_comp): Renamed to 'gfc_is_proc_ptr_comp'. * interface.c (compare_actual_formal): Renamed 'is_proc_ptr_comp'. * match.c (gfc_match_pointer_assignment): Ditto. * primary.c (gfc_match_varspec): Handle array-valued procedure pointers and procedure pointer components. Renamed 'is_proc_ptr_comp'. * resolve.c (resolve_fl_derived): Correctly handle interfaces with RESULT statement, and handle array-valued procedure pointer components. (resolve_actual_arglist,resolve_ppc_call,resolve_expr_ppc): Renamed 'is_proc_ptr_comp'. * trans-array.c (gfc_walk_function_expr): Ditto. * trans-decl.c (gfc_get_symbol_decl): Security check for presence of ns->proc_name. * trans-expr.c (gfc_conv_procedure_call): Handle array-valued procedure pointer components. Renamed 'is_proc_ptr_comp'. (conv_function_val,gfc_trans_arrayfunc_assign): Renamed 'is_proc_ptr_comp'. (gfc_get_proc_ptr_comp): Do not modify the argument 'e', but instead make a copy of it. * trans-io.c (gfc_trans_transfer): Handle array-valued procedure pointer components. 2009-07-09 Janus Weil PR fortran/40646 * gfortran.dg/proc_ptr_22.f90: New. * gfortran.dg/proc_ptr_comp_12.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149419 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 260d718b13c..5e3f80fa822 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2539,8 +2539,9 @@ bool gfc_traverse_expr (gfc_expr *, gfc_symbol *, void gfc_expr_set_symbols_referenced (gfc_expr *); gfc_try gfc_expr_check_typed (gfc_expr*, gfc_namespace*, bool); void gfc_expr_replace_symbols (gfc_expr *, gfc_symbol *); +void gfc_expr_replace_comp (gfc_expr *, gfc_component *); -bool is_proc_ptr_comp (gfc_expr *, gfc_component **); +bool gfc_is_proc_ptr_comp (gfc_expr *, gfc_component **); /* st.c */ extern gfc_code new_st; -- cgit v1.2.1 From 3506b33fb392a4177653c120138be8da0b28f71a Mon Sep 17 00:00:00 2001 From: jakub Date: Thu, 23 Jul 2009 18:09:43 +0000 Subject: PR fortran/40839 * io.c (gfc_resolve_dt): Add LOC argument. Fail if dt->io_unit is NULL. Return FAILURE after issuing error about negative UNIT number. (match_io_element): Don't segfault if current_dt->io_unit is NULL. * gfortran.h (gfc_resolve_dt): Adjust prototype. * resolve.c (resolve_code): Adjust caller. * gfortran.dg/pr40839.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150021 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 5e3f80fa822..83c36c5ad85 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2637,7 +2637,7 @@ gfc_try gfc_resolve_filepos (gfc_filepos *); void gfc_free_inquire (gfc_inquire *); gfc_try gfc_resolve_inquire (gfc_inquire *); void gfc_free_dt (gfc_dt *); -gfc_try gfc_resolve_dt (gfc_dt *); +gfc_try gfc_resolve_dt (gfc_dt *, locus *); void gfc_free_wait (gfc_wait *); gfc_try gfc_resolve_wait (gfc_wait *); -- cgit v1.2.1 From 5d50997a4873b2ff4acdfe03f24b81d7ada048fd Mon Sep 17 00:00:00 2001 From: janus Date: Fri, 24 Jul 2009 11:00:01 +0000 Subject: 2009-07-24 Janus Weil PR fortran/40822 * array.c (gfc_resolve_character_array_constructor): Use new function gfc_new_charlen. * decl.c (add_init_expr_to_sym,variable_decl,match_char_spec, gfc_match_implicit): Ditto. * expr.c (gfc_simplify_expr): Ditto. * gfortran.h (gfc_new_charlen): New prototype. * iresolve.c (check_charlen_present,gfc_resolve_char_achar): Use new function gfc_new_charlen. * module.c (mio_charlen): Ditto. * resolve.c (gfc_resolve_substring_charlen, gfc_resolve_character_operator,fixup_charlen,resolve_fl_derived, resolve_symbol): Ditto. * symbol.c (gfc_new_charlen): New function to create a new gfc_charlen structure and add it to a namespace. (gfc_copy_formal_args_intr): Make sure ts.cl is present for CHARACTER variables. 2009-07-24 Janus Weil PR fortran/40822 * gfortran.dg/char_length_16.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150047 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 83c36c5ad85..ce8e6fc1461 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2415,6 +2415,7 @@ int gfc_symbols_could_alias (gfc_symbol *, gfc_symbol *); void gfc_undo_symbols (void); void gfc_commit_symbols (void); void gfc_commit_symbol (gfc_symbol *); +gfc_charlen *gfc_new_charlen (gfc_namespace *); void gfc_free_charlen (gfc_charlen *, gfc_charlen *); void gfc_free_namespace (gfc_namespace *); -- cgit v1.2.1 From fe9b08a2c2202c07f1f02f83e8dfac36923b6662 Mon Sep 17 00:00:00 2001 From: janus Date: Sat, 25 Jul 2009 11:56:35 +0000 Subject: 2009-07-25 Janus Weil PR fortran/39630 * decl.c (match_ppc_decl): Implement the PASS attribute for procedure pointer components. (match_binding_attributes): Ditto. * gfortran.h (gfc_component): Add member 'tb'. (gfc_typebound_proc): Add member 'ppc' and make 'pass_arg' const. * module.c (MOD_VERSION): Bump module version. (binding_ppc): New string constants. (mio_component): Only use formal args if component is a procedure pointer and add 'tb' member. (mio_typebound_proc): Include pass_arg and take care of procedure pointer components. * resolve.c (update_arglist_pass): Add argument 'name' and take care of optional arguments. (extract_ppc_passed_object): New function, analogous to extract_compcall_passed_object, but for procedure pointer components. (update_ppc_arglist): New function, analogous to update_compcall_arglist, but for procedure pointer components. (resolve_typebound_generic_call): Added argument to update_arglist_pass. (resolve_ppc_call, resolve_expr_ppc): Take care of PASS attribute. (resolve_fl_derived): Check the PASS argument for procedure pointer components. * symbol.c (verify_bind_c_derived_type): Reject procedure pointer components in BIND(C) types. 2009-07-25 Janus Weil PR fortran/39630 * gfortran.dg/proc_ptr_comp_3.f90: Modified. * gfortran.dg/proc_ptr_comp_pass_1.f90: New. * gfortran.dg/proc_ptr_comp_pass_2.f90: New. * gfortran.dg/proc_ptr_comp_pass_3.f90: New. * gfortran.dg/proc_ptr_comp_pass_4.f90: New. * gfortran.dg/proc_ptr_comp_pass_5.f90: New. * gfortran.dg/typebound_call_10.f03: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150078 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index ce8e6fc1461..7792cfabab6 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -879,8 +879,10 @@ typedef struct gfc_component struct gfc_expr *initializer; struct gfc_component *next; + /* Needed for procedure pointer components. */ struct gfc_formal_arglist *formal; struct gfc_namespace *formal_ns; + struct gfc_typebound_proc *tb; } gfc_component; @@ -1064,7 +1066,7 @@ typedef struct gfc_typebound_proc u; gfc_access access; - char* pass_arg; /* Argument-name for PASS. NULL if not specified. */ + const char* pass_arg; /* Argument-name for PASS. NULL if not specified. */ /* The overridden type-bound proc (or GENERIC with this name in the parent-type) or NULL if non. */ @@ -1081,6 +1083,7 @@ typedef struct gfc_typebound_proc unsigned is_generic:1; unsigned function:1, subroutine:1; unsigned error:1; /* Ignore it, when an error occurred during resolution. */ + unsigned ppc:1; } gfc_typebound_proc; -- cgit v1.2.1 From 7ea64434b40d07d43f4aa6cafac4684487e69304 Mon Sep 17 00:00:00 2001 From: pault Date: Sat, 1 Aug 2009 13:45:12 +0000 Subject: 2009-08-01 Paul Thomas PR fortran/40011 * error.c : Add static flag 'warnings_not_errors'. (gfc_error): If 'warnings_not_errors' is set, branch to code from gfc_warning. (gfc_clear_error): Reset 'warnings_not_errors'. (gfc_errors_to_warnings): New function. * options.c (gfc_post_options): If pedantic and flag_whole_file change the latter to a value of 2. * parse.c (parse_module): Add module namespace to gsymbol. (resolve_all_program_units): New function. (clean_up_modules): New function. (translate_all_program_units): New function. (gfc_parse_file): If whole_file, do not clean up module right away and add derived types to namespace derived types. In addition, call the three new functions above. * resolve.c (not_in_recursive): New function. (not_entry_self_reference): New function. (resolve_global_procedure): Symbol must not be IFSRC_UNKNOWN, procedure must not be in the course of being resolved and must return false for the two new functions. Pack away the current derived type list before calling gfc_resolve for the gsymbol namespace. It is unconditionally an error if the ranks of the reference and ther procedure do not match. Convert errors to warnings during call to gfc_procedure_use if not pedantic or legacy. (gfc_resolve): Set namespace resolved flag to -1 during resolution and store current cs_base. * trans-decl.c (gfc_get_symbol_decl): If whole_file compilation substitute a use associated variable, if it is available in a gsymbolnamespace. (gfc_get_extern_function_decl): If the procedure is use assoc, do not attempt to find it in a gsymbol because it could be an interface. If the symbol exists in a module namespace, return its backend_decl. * trans-expr.c (gfc_trans_scalar_assign): If a derived type assignment, set the rhs TYPE_MAIN_VARIANT to that of the rhs. * trans-types.c (copy_dt_decls_ifequal): Add 'from_gsym' as a boolean argument. Copy component backend_decls directly if the components are derived types and from_gsym is true. (gfc_get_derived_type): If whole_file copy the derived type from the module if it is use associated, otherwise, if can be found in another gsymbol namespace, use the existing derived type as the TYPE_CANONICAL and build normally. * gfortran.h : Add derived_types and resolved fields to gfc_namespace. Include prototype for gfc_errors_to_warnings. 2009-08-01 Paul Thomas PR fortran/40011 * gfortran.dg/whole_file_7.f90: New test. * gfortran.dg/whole_file_8.f90: New test. * gfortran.dg/whole_file_9.f90: New test. * gfortran.dg/whole_file_10.f90: New test. * gfortran.dg/whole_file_11.f90: New test. * gfortran.dg/whole_file_12.f90: New test. * gfortran.dg/whole_file_13.f90: New test. * gfortran.dg/whole_file_14.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150333 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 7792cfabab6..da3d5f052b8 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1329,6 +1329,8 @@ typedef struct gfc_namespace gfc_charlen *cl_list, *old_cl_list; + gfc_dt_list *derived_types; + int save_all, seen_save, seen_implicit_none; /* Normally we don't need to refcount namespaces. However when we read @@ -1350,6 +1352,9 @@ typedef struct gfc_namespace /* Set to 1 if resolved has been called for this namespace. */ int resolved; + + /* Set to 1 if code has been generated for this namespace. */ + int translated; } gfc_namespace; @@ -2288,6 +2293,7 @@ void gfc_pop_error (gfc_error_buf *); void gfc_free_error (gfc_error_buf *); void gfc_get_errors (int *, int *); +void gfc_errors_to_warnings (int); /* arith.c */ void gfc_arith_init_1 (void); -- cgit v1.2.1 From de0c4488fdfa38f2c6c01b098b416b8772572e54 Mon Sep 17 00:00:00 2001 From: burnus Date: Sun, 9 Aug 2009 08:35:36 +0000 Subject: 2009-08-05 Tobias Burnus PR fortran/40955 * gfortran.h (ext_attr_id_t): Add typedef for this enum. (gfc_add_ext_attribute): Use it. * decl.c (gfc_match_gcc_attributes): Ditto. * expr.c (gfc_check_pointer_assign): Ditto. * symbol.c (gfc_add_ext_attribute): Ditto. (gfc_copy_attr): Copy also ext_attr. * resolve.c (resolve_fl_derived,resolve_symbol): Ditto. * module.c (mio_symbol_attribute): Save ext_attr in the mod * file. 2009-08-05 Tobias Burnus PR fortran/40955 * gfortran.dg/module_md5_1.f90: Update MD5 check sum. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150589 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index da3d5f052b8..cefe3ec1c8f 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -621,7 +621,7 @@ extern CInteropKind_t c_interop_kinds_table[]; /* Structure and list of supported extension attributes. */ -enum +typedef enum { EXT_ATTR_DLLIMPORT = 0, EXT_ATTR_DLLEXPORT, @@ -629,7 +629,8 @@ enum EXT_ATTR_CDECL, EXT_ATTR_FASTCALL, EXT_ATTR_LAST, EXT_ATTR_NUM = EXT_ATTR_LAST -}; +} +ext_attr_id_t; typedef struct { @@ -2334,7 +2335,7 @@ gfc_try gfc_set_default_type (gfc_symbol *, int, gfc_namespace *); void gfc_set_sym_referenced (gfc_symbol *); gfc_try gfc_add_attribute (symbol_attribute *, locus *); -gfc_try gfc_add_ext_attribute (symbol_attribute *, unsigned, locus *); +gfc_try gfc_add_ext_attribute (symbol_attribute *, ext_attr_id_t, locus *); gfc_try gfc_add_allocatable (symbol_attribute *, locus *); gfc_try gfc_add_dimension (symbol_attribute *, const char *, locus *); gfc_try gfc_add_external (symbol_attribute *, locus *); -- cgit v1.2.1 From 8ca7f89ce738994bbb0a78ca04a7d9a984456d03 Mon Sep 17 00:00:00 2001 From: janus Date: Mon, 10 Aug 2009 09:19:24 +0000 Subject: 2009-08-10 Janus Weil PR fortran/40940 * decl.c (gfc_match_type_spec): Match CLASS statement and warn about missing polymorphism. * gfortran.h (gfc_typespec): Add field 'is_class'. * misc.c (gfc_clear_ts): Initialize 'is_class' to zero. * resolve.c (type_is_extensible): New function to check if a derived type is extensible. (resolve_fl_variable_derived): Add error checks for CLASS variables. (resolve_typebound_procedure): Disallow non-polymorphic passed-object dummy arguments, turning warning into error. (resolve_fl_derived): Use 'type_is_extensible'. Disallow non-polymorphic passed-object dummy arguments for procedure pointer components, turning warning into error. Add error check for CLASS components. 2009-08-10 Janus Weil PR fortran/40940 * gfortran.dg/class_1.f03: New. * gfortran.dg/class_2.f03: New. * gfortran.dg/proc_ptr_comp_pass_1.f90: Use CLASS instead of TYPE. * gfortran.dg/proc_ptr_comp_pass_2.f90: Ditto. * gfortran.dg/proc_ptr_comp_pass_3.f90: Ditto. * gfortran.dg/typebound_call_10.f03: Ditto. * gfortran.dg/typebound_call_2.f03: Ditto. * gfortran.dg/typebound_call_3.f03: Ditto. * gfortran.dg/typebound_call_4.f03: Ditto. * gfortran.dg/typebound_generic_3.f03: Ditto. * gfortran.dg/typebound_generic_4.f03: Ditto. * gfortran.dg/typebound_proc_1.f08: Ditto. * gfortran.dg/typebound_proc_5.f03: Ditto. * gfortran.dg/typebound_proc_6.f03: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150620 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index cefe3ec1c8f..3d95d2177ae 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -841,6 +841,7 @@ typedef struct struct gfc_symbol *derived; gfc_charlen *cl; /* For character types only. */ struct gfc_symbol *interface; /* For PROCEDURE declarations. */ + unsigned int is_class:1; int is_c_interop; int is_iso_c; bt f90_type; -- cgit v1.2.1 From a36eb9ee1253552fcabdb8a9c578e0b68652f126 Mon Sep 17 00:00:00 2001 From: domob Date: Mon, 10 Aug 2009 10:51:46 +0000 Subject: 2009-08-10 Daniel Kraft PR fortran/37425 * gfortran.dg/typebound_operator_1.f03: New test. * gfortran.dg/typebound_operator_2.f03: New test. 2009-08-10 Daniel Kraft PR fortran/37425 * gfortran.h (struct gfc_namespace): New fields tb_uop_root and tb_op. (gfc_find_typebound_user_op): New routine. (gfc_find_typebound_intrinsic_op): Ditto. (gfc_check_operator_interface): Now public routine. * decl.c (gfc_match_generic): Match OPERATOR(X) or ASSIGNMENT(=). * interface.c (check_operator_interface): Made public, renamed to `gfc_check_operator_interface' accordingly and hand in the interface as gfc_symbol rather than gfc_interface so it is useful for type-bound operators, too. Return boolean result. (gfc_check_interfaces): Adapt call to `check_operator_interface'. * symbol.c (gfc_get_namespace): Initialize new field `tb_op'. (gfc_free_namespace): Free `tb_uop_root'-based tree. (find_typebound_proc_uop): New helper function. (gfc_find_typebound_proc): Use it. (gfc_find_typebound_user_op): New method. (gfc_find_typebound_intrinsic_op): Ditto. * resolve.c (resolve_tb_generic_targets): New helper function. (resolve_typebound_generic): Use it. (resolve_typebound_intrinsic_op), (resolve_typebound_user_op): New. (resolve_typebound_procedures): Resolve operators, too. (check_uop_procedure): New, code from gfc_resolve_uops. (gfc_resolve_uops): Moved main code to new `check_uop_procedure'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150622 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 3d95d2177ae..cb456bc5976 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1287,6 +1287,10 @@ typedef struct gfc_namespace /* Tree containing type-bound procedures. */ gfc_symtree *tb_sym_root; + /* Type-bound user operators. */ + gfc_symtree *tb_uop_root; + /* For derived-types, store type-bound intrinsic operators here. */ + gfc_typebound_proc *tb_op[GFC_INTRINSIC_OPS]; /* Linked list of finalizer procedures. */ struct gfc_finalizer *finalizers; @@ -2448,6 +2452,10 @@ gfc_gsymbol *gfc_find_gsymbol (gfc_gsymbol *, const char *); gfc_typebound_proc* gfc_get_typebound_proc (void); gfc_symbol* gfc_get_derived_super_type (gfc_symbol*); gfc_symtree* gfc_find_typebound_proc (gfc_symbol*, gfc_try*, const char*, bool); +gfc_symtree* gfc_find_typebound_user_op (gfc_symbol*, gfc_try*, + const char*, bool); +gfc_typebound_proc* gfc_find_typebound_intrinsic_op (gfc_symbol*, gfc_try*, + gfc_intrinsic_op, bool); gfc_symtree* gfc_get_tbp_symtree (gfc_symtree**, const char*); void gfc_copy_formal_args (gfc_symbol *, gfc_symbol *); @@ -2636,6 +2644,7 @@ gfc_interface *gfc_current_interface_head (void); void gfc_set_current_interface_head (gfc_interface *); gfc_symtree* gfc_find_sym_in_symtree (gfc_symbol*); bool gfc_arglist_matches_symbol (gfc_actual_arglist**, gfc_symbol*); +bool gfc_check_operator_interface (gfc_symbol*, gfc_intrinsic_op, locus); /* io.c */ extern gfc_st_label format_asterisk; -- cgit v1.2.1 From eeebe20ba63ca092de5e2d4575b5765dd88a7ce6 Mon Sep 17 00:00:00 2001 From: janus Date: Thu, 13 Aug 2009 19:46:46 +0000 Subject: 2009-08-13 Janus Weil PR fortran/40941 * gfortran.h (gfc_typespec): Put 'derived' and 'cl' into union. * decl.c (build_struct): Make sure 'cl' is only used if type is BT_CHARACTER. * symbol.c (gfc_set_default_type): Ditto. * resolve.c (resolve_symbol, resolve_fl_derived): Ditto. (resolve_equivalence,resolve_equivalence_derived): Make sure 'derived' is only used if type is BT_DERIVED. * trans-io.c (transfer_expr): Make sure 'derived' is only used if type is BT_DERIVED or BT_INTEGER (special case: C_PTR/C_FUNPTR). * array.c: Mechanical replacements to accomodate union in gfc_typespec. * check.c: Ditto. * data.c: Ditto. * decl.c: Ditto. * dump-parse-tree.c: Ditto. * expr.c: Ditto. * interface.c: Ditto. * iresolve.c: Ditto. * match.c: Ditto. * misc.c: Ditto. * module.c: Ditto. * openmp.c: Ditto. * parse.c: Ditto. * primary.c: Ditto. * resolve.c: Ditto. * simplify.c: Ditto. * symbol.c: Ditto. * target-memory.c: Ditto. * trans-array.c: Ditto. * trans-common.c: Ditto. * trans-const.c: Ditto. * trans-decl.c: Ditto. * trans-expr.c: Ditto. * trans-intrinsic.c: Ditto. * trans-io.c: Ditto. * trans-stmt.c: Ditto. * trans-types.c: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150725 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index cb456bc5976..17a0a532072 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -833,13 +833,19 @@ gfc_charlen; #define gfc_get_charlen() XCNEW (gfc_charlen) -/* Type specification structure. FIXME: derived and cl could be union??? */ +/* Type specification structure. */ typedef struct { bt type; int kind; - struct gfc_symbol *derived; - gfc_charlen *cl; /* For character types only. */ + + union + { + struct gfc_symbol *derived; /* For derived types only. */ + gfc_charlen *cl; /* For character types only. */ + } + u; + struct gfc_symbol *interface; /* For PROCEDURE declarations. */ unsigned int is_class:1; int is_c_interop; -- cgit v1.2.1 From d270ce529b4bdd51b952f8ed87746b9e77ada4c2 Mon Sep 17 00:00:00 2001 From: janus Date: Mon, 17 Aug 2009 09:11:00 +0000 Subject: 2009-08-17 Janus Weil PR fortran/40877 * array.c (gfc_resolve_character_array_constructor): Add NULL argument to gfc_new_charlen. * decl.c (add_init_expr_to_sym,variable_decl,match_char_spec, gfc_match_implicit): Ditto. * expr.c (simplify_const_ref): Fix memory leak. (gfc_simplify_expr): Add NULL argument to gfc_new_charlen. * gfortran.h (gfc_new_charlen): Modified prototype. * iresolve.c (check_charlen_present,gfc_resolve_char_achar): Add NULL argument to gfc_new_charlen. * module.c (mio_charlen): Ditto. * resolve.c (gfc_resolve_substring_charlen, gfc_resolve_character_operator,fixup_charlen): Ditto. (resolve_fl_derived,resolve_symbol): Add argument to gfc_charlen. * symbol.c (gfc_new_charlen): Add argument 'old_cl' (to make a copy of an existing charlen). (gfc_set_default_type,generate_isocbinding_symbol): Fix memory leak. (gfc_copy_formal_args_intr): Add NULL argument to gfc_new_charlen. * trans-decl.c (create_function_arglist): Fix memory leak. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150823 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 17a0a532072..a4a3b817cf9 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2436,7 +2436,7 @@ int gfc_symbols_could_alias (gfc_symbol *, gfc_symbol *); void gfc_undo_symbols (void); void gfc_commit_symbols (void); void gfc_commit_symbol (gfc_symbol *); -gfc_charlen *gfc_new_charlen (gfc_namespace *); +gfc_charlen *gfc_new_charlen (gfc_namespace *, gfc_charlen *); void gfc_free_charlen (gfc_charlen *, gfc_charlen *); void gfc_free_namespace (gfc_namespace *); -- cgit v1.2.1 From 10f5dcc072169f5b3c7075b723a53e0da5c3d10d Mon Sep 17 00:00:00 2001 From: kargl Date: Sun, 23 Aug 2009 03:19:55 +0000 Subject: 2009-08-22 Steven K. kargl * gfortran.dg/allocate_alloc_opt_4.f90: New test. * gfortran.dg/allocate_alloc_opt_5.f90: New test. * gfortran.dg/allocate_alloc_opt_6.f90: New test. 2009-08-22 Steven K. kargl * fortran/decl.c (match_char_spec): Rename to gfc_match_char_spec, and remove static. * fortran/gfortran.h: Add *expr3 entity to gfc_code. Add prototype for gfc_match_char_spec. * fortran/trans-stmt.c (gfc_trans_allocate): Translate the SOURCE= tag. * fortran/match.c (match_intrinsic_typespec): New function to match F2003 intrinsic-type-spec. (conformable_arrays): New function. Check SOURCE= and allocation-object are conformable. (gfc_match_allocate): Use new functions. Match SOURCE= tag. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151023 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index a4a3b817cf9..cbab000ad6e 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1977,7 +1977,7 @@ typedef struct gfc_code gfc_st_label *here, *label1, *label2, *label3; gfc_symtree *symtree; - gfc_expr *expr1, *expr2; + gfc_expr *expr1, *expr2, *expr3; /* A name isn't sufficient to identify a subroutine, we need the actual symbol for the interface definition. const char *sub_name; */ @@ -2184,6 +2184,7 @@ gfc_finalizer; /* decl.c */ bool gfc_in_match_data (void); +match gfc_match_char_spec (gfc_typespec *); /* scanner.c */ void gfc_scanner_done_1 (void); -- cgit v1.2.1 From 7d034542867cddd55dc133813dae02338fdb9cf2 Mon Sep 17 00:00:00 2001 From: domob Date: Thu, 27 Aug 2009 11:42:56 +0000 Subject: 2009-08-27 Daniel Kraft PR fortran/37425 * gfortran.h (gfc_expr): Optionally store base-object in compcall value and add a new flag to distinguish assign-calls generated. (gfc_find_typebound_proc): Add locus argument. (gfc_find_typebound_user_op), (gfc_find_typebound_intrinsic_op): Ditto. (gfc_extend_expr): Return if failure was by a real error. * interface.c (matching_typebound_op): New routine. (build_compcall_for_operator): New routine. (gfc_extend_expr): Handle type-bound operators, some clean-up and return if failure was by a real error or just by not finding an appropriate operator definition. (gfc_extend_assign): Handle type-bound assignments. * module.c (MOD_VERSION): Incremented. (mio_intrinsic_op): New routine. (mio_full_typebound_tree): New routine to make typebound-procedures IO code reusable for type-bound user operators. (mio_f2k_derived): IO of type-bound operators. * primary.c (gfc_match_varspec): Initialize new fields in gfc_expr and pass locus to gfc_find_typebound_proc. * resolve.c (resolve_operator): Only output error about no matching interface if gfc_extend_expr did not already fail with an error. (extract_compcall_passed_object): Use specified base-object if present. (update_compcall_arglist): Handle ignore_pass field. (resolve_ordinary_assign): Update to handle extended code for type-bound assignments, too. (resolve_code): Handle EXEC_ASSIGN_CALL statement code. (resolve_tb_generic_targets): Pass locus to gfc_find_typebound_proc. (resolve_typebound_generic), (resolve_typebound_procedure): Ditto. (resolve_typebound_intrinsic_op), (resolve_typebound_user_op): Ditto. (ensure_not_abstract_walker), (resolve_fl_derived): Ditto. (resolve_typebound_procedures): Remove not-implemented error. (resolve_typebound_call): Handle assign-call flag. * symbol.c (find_typebound_proc_uop): New argument to pass locus for error message about PRIVATE, verify that a found procedure is not marked as erraneous. (gfc_find_typebound_intrinsic_op): Ditto. (gfc_find_typebound_proc), (gfc_find_typebound_user_op): New locus arg. 2009-08-27 Daniel Kraft PR fortran/37425 * gfortran.dg/impure_assignment_1.f90: Change expected error message. * gfortran.dg/typebound_operator_1.f03: Remove check for not-implemented error and fix problem with recursive assignment. * gfortran.dg/typebound_operator_2.f03: No not-implemented check. * gfortran.dg/typebound_operator_3.f03: New test. * gfortran.dg/typebound_operator_4.f03: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151140 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index cbab000ad6e..16c596bd753 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1622,8 +1622,8 @@ typedef struct gfc_expr int rank; mpz_t *shape; /* Can be NULL if shape is unknown at compile time */ - /* Nonnull for functions and structure constructors, the base object for - component-calls. */ + /* Nonnull for functions and structure constructors, may also used to hold the + base-object for component calls. */ gfc_symtree *symtree; gfc_ref *ref; @@ -1699,8 +1699,19 @@ typedef struct gfc_expr { gfc_actual_arglist* actual; const char* name; - void* padding; /* Overlap gfc_typebound_proc with esym. */ - gfc_typebound_proc* tbp; + /* Base-object, whose component was called. NULL means that it should + be taken from symtree/ref. */ + struct gfc_expr* base_object; + gfc_typebound_proc* tbp; /* Should overlap with esym. */ + + /* For type-bound operators, we want to call PASS procedures but already + have the full arglist; mark this, so that it is not extended by the + PASS argument. */ + unsigned ignore_pass:1; + + /* Do assign-calls rather than calls, that is appropriate dependency + checking. */ + unsigned assign:1; } compcall; @@ -2458,11 +2469,13 @@ gfc_gsymbol *gfc_find_gsymbol (gfc_gsymbol *, const char *); gfc_typebound_proc* gfc_get_typebound_proc (void); gfc_symbol* gfc_get_derived_super_type (gfc_symbol*); -gfc_symtree* gfc_find_typebound_proc (gfc_symbol*, gfc_try*, const char*, bool); +gfc_symtree* gfc_find_typebound_proc (gfc_symbol*, gfc_try*, + const char*, bool, locus*); gfc_symtree* gfc_find_typebound_user_op (gfc_symbol*, gfc_try*, - const char*, bool); + const char*, bool, locus*); gfc_typebound_proc* gfc_find_typebound_intrinsic_op (gfc_symbol*, gfc_try*, - gfc_intrinsic_op, bool); + gfc_intrinsic_op, bool, + locus*); gfc_symtree* gfc_get_tbp_symtree (gfc_symtree**, const char*); void gfc_copy_formal_args (gfc_symbol *, gfc_symbol *); @@ -2643,7 +2656,7 @@ void gfc_procedure_use (gfc_symbol *, gfc_actual_arglist **, locus *); void gfc_ppc_use (gfc_component *, gfc_actual_arglist **, locus *); gfc_symbol *gfc_search_interface (gfc_interface *, int, gfc_actual_arglist **); -gfc_try gfc_extend_expr (gfc_expr *); +gfc_try gfc_extend_expr (gfc_expr *, bool *); void gfc_free_formal_arglist (gfc_formal_arglist *); gfc_try gfc_extend_assign (gfc_code *, gfc_namespace *); gfc_try gfc_add_interface (gfc_symbol *); -- cgit v1.2.1 From 10e9d5ee9cdd7a24dead20d3db2702644e5b580f Mon Sep 17 00:00:00 2001 From: janus Date: Thu, 27 Aug 2009 19:48:46 +0000 Subject: 2009-08-27 Janus Weil PR fortran/40869 * expr.c (gfc_check_pointer_assign): Enable interface check for pointer assignments involving procedure pointer components. * gfortran.h (gfc_compare_interfaces): Modified prototype. * interface.c (gfc_compare_interfaces): Add argument 'name2', to be used instead of s2->name. Don't rely on the proc_pointer attribute, but instead on the flags handed to this function. (check_interface1,compare_parameter): Add argument for gfc_compare_interfaces. * resolve.c (check_generic_tbp_ambiguity): Ditto. 2009-08-27 Janus Weil PR fortran/40869 * gfortran.dg/proc_ptr_comp_20.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151147 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 16c596bd753..514cc808417 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2650,7 +2650,8 @@ gfc_try gfc_ref_dimen_size (gfc_array_ref *, int dimen, mpz_t *); void gfc_free_interface (gfc_interface *); int gfc_compare_derived_types (gfc_symbol *, gfc_symbol *); int gfc_compare_types (gfc_typespec *, gfc_typespec *); -int gfc_compare_interfaces (gfc_symbol*, gfc_symbol*, int, int, char *, int); +int gfc_compare_interfaces (gfc_symbol*, gfc_symbol*, const char *, int, int, + char *, int); void gfc_check_interfaces (gfc_namespace *); void gfc_procedure_use (gfc_symbol *, gfc_actual_arglist **, locus *); void gfc_ppc_use (gfc_component *, gfc_actual_arglist **, locus *); -- cgit v1.2.1 From e8152f13490bf1b3e3a94c318d83a750d562e5b2 Mon Sep 17 00:00:00 2001 From: janus Date: Mon, 31 Aug 2009 19:08:03 +0000 Subject: 2009-08-31 Janus Weil Paul Thomas PR fortran/40940 * array.c (gfc_match_array_constructor): Rename gfc_match_type_spec. * decl.c (gfc_match_type_spec): Rename to gfc_match_decl_type_spec, and reject CLASS with -std=f95. (gfc_match_implicit, gfc_match_data_decl,gfc_match_prefix, match_procedure_interface): Rename gfc_match_type_spec. * gfortran.h (gfc_type_compatible): Add prototype. * match.h (gfc_match_type_spec): Rename to gfc_match_decl_type_spec. * match.c (match_intrinsic_typespec): Rename to match_type_spec, and add handling of derived types. (gfc_match_allocate): Rename match_intrinsic_typespec and check type compatibility of derived types. * symbol.c (gfc_type_compatible): New function to check if two types are compatible. 2009-08-31 Janus Weil PR fortran/40940 * gfortran.dg/allocate_derived_1.f90: New. * gfortran.dg/class_3.f03: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151244 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 514cc808417..b6ac2542969 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2469,6 +2469,7 @@ gfc_gsymbol *gfc_find_gsymbol (gfc_gsymbol *, const char *); gfc_typebound_proc* gfc_get_typebound_proc (void); gfc_symbol* gfc_get_derived_super_type (gfc_symbol*); +bool gfc_type_compatible (gfc_typespec *, gfc_typespec *); gfc_symtree* gfc_find_typebound_proc (gfc_symbol*, gfc_try*, const char*, bool, locus*); gfc_symtree* gfc_find_typebound_user_op (gfc_symbol*, gfc_try*, -- cgit v1.2.1 From 6a7084d700f33c25ffdfe5e213b60f05785ba87c Mon Sep 17 00:00:00 2001 From: domob Date: Tue, 29 Sep 2009 07:42:42 +0000 Subject: 2009-09-29 Daniel Kraft PR fortran/39626 * gfortran.h (enum gfc_statement): Add ST_BLOCK and ST_END_BLOCK. (struct gfc_namespace): Convert flags to bit-fields and add flag `construct_entities' for use with BLOCK constructs. (enum gfc_exec_code): Add EXEC_BLOCK. (struct gfc_code): Add namespace field to union for EXEC_BLOCK. * match.h (gfc_match_block): New prototype. * parse.h (enum gfc_compile_state): Add COMP_BLOCK. * trans.h (gfc_process_block_locals): New prototype. (gfc_trans_deferred_vars): Made public, new prototype. * trans-stmt.h (gfc_trans_block_construct): New prototype. * decl.c (gfc_match_end): Handle END BLOCK correctly. (gfc_match_intent): Error if inside of BLOCK. (gfc_match_optional), (gfc_match_value): Ditto. * match.c (gfc_match_block): New routine. * parse.c (decode_statement): Handle BLOCK statement. (case_exec_markers): Add ST_BLOCK. (case_end): Add ST_END_BLOCK. (gfc_ascii_statement): Handle ST_BLOCK and ST_END_BLOCK. (parse_spec): Check for statements not allowed inside of BLOCK. (parse_block_construct): New routine. (parse_executable): Parse BLOCKs. (parse_progunit): Disallow CONTAINS in BLOCK constructs. * resolve.c (is_illegal_recursion): Find real container procedure and don't get confused by BLOCK constructs. (resolve_block_construct): New routine. (gfc_resolve_blocks), (resolve_code): Handle EXEC_BLOCK. * st.c (gfc_free_statement): Handle EXEC_BLOCK statements. * trans-decl.c (saved_local_decls): New static variable. (add_decl_as_local): New routine. (gfc_finish_var_decl): Add variable as local if inside BLOCK. (gfc_trans_deferred_vars): Make public. (gfc_process_block_locals): New routine. * trans-stmt.c (gfc_trans_block_construct): New routine. * trans.c (gfc_trans_code): Handle EXEC_BLOCK statements. 2009-09-29 Daniel Kraft PR fortran/39626 * gfortran.dg/block_1.f08: New test. * gfortran.dg/block_2.f08: New test. * gfortran.dg/block_3.f90: New test. * gfortran.dg/block_4.f08: New test. * gfortran.dg/block_5.f08: New test. * gfortran.dg/block_6.f08: New test. * gfortran.dg/block_7.f08: New test. * gfortran.dg/block_8.f08: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152266 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index b6ac2542969..0dce218b22c 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -206,15 +206,17 @@ arith; /* Statements. */ typedef enum { - ST_ARITHMETIC_IF, ST_ALLOCATE, ST_ATTR_DECL, ST_BACKSPACE, ST_BLOCK_DATA, + ST_ARITHMETIC_IF, ST_ALLOCATE, ST_ATTR_DECL, ST_BACKSPACE, + ST_BLOCK, ST_BLOCK_DATA, ST_CALL, ST_CASE, ST_CLOSE, ST_COMMON, ST_CONTINUE, ST_CONTAINS, ST_CYCLE, ST_DATA, ST_DATA_DECL, ST_DEALLOCATE, ST_DO, ST_ELSE, ST_ELSEIF, - ST_ELSEWHERE, ST_END_BLOCK_DATA, ST_ENDDO, ST_IMPLIED_ENDDO, + ST_ELSEWHERE, ST_END_BLOCK, ST_END_BLOCK_DATA, ST_ENDDO, ST_IMPLIED_ENDDO, ST_END_FILE, ST_FINAL, ST_FLUSH, ST_END_FORALL, ST_END_FUNCTION, ST_ENDIF, ST_END_INTERFACE, ST_END_MODULE, ST_END_PROGRAM, ST_END_SELECT, ST_END_SUBROUTINE, ST_END_WHERE, ST_END_TYPE, ST_ENTRY, ST_EQUIVALENCE, ST_EXIT, ST_FORALL, ST_FORALL_BLOCK, ST_FORMAT, ST_FUNCTION, ST_GOTO, - ST_IF_BLOCK, ST_IMPLICIT, ST_IMPLICIT_NONE, ST_IMPORT, ST_INQUIRE, ST_INTERFACE, + ST_IF_BLOCK, ST_IMPLICIT, ST_IMPLICIT_NONE, ST_IMPORT, + ST_INQUIRE, ST_INTERFACE, ST_PARAMETER, ST_MODULE, ST_MODULE_PROC, ST_NAMELIST, ST_NULLIFY, ST_OPEN, ST_PAUSE, ST_PRIVATE, ST_PROGRAM, ST_PUBLIC, ST_READ, ST_RETURN, ST_REWIND, ST_STOP, ST_SUBROUTINE, ST_TYPE, ST_USE, ST_WHERE_BLOCK, ST_WHERE, ST_WAIT, @@ -1278,8 +1280,8 @@ gfc_dt_list; /* A list of all derived types. */ extern gfc_dt_list *gfc_derived_types; -/* A namespace describes the contents of procedure, module or - interface block. */ +/* A namespace describes the contents of procedure, module, interface block + or BLOCK construct. */ /* ??? Anything else use these? */ typedef struct gfc_namespace @@ -1357,16 +1359,20 @@ typedef struct gfc_namespace gfc_use_list *use_stmts; /* Set to 1 if namespace is a BLOCK DATA program unit. */ - int is_block_data; + unsigned is_block_data:1; /* Set to 1 if namespace is an interface body with "IMPORT" used. */ - int has_import_set; + unsigned has_import_set:1; /* Set to 1 if resolved has been called for this namespace. */ - int resolved; + unsigned resolved:1; /* Set to 1 if code has been generated for this namespace. */ - int translated; + unsigned translated:1; + + /* Set to 1 if symbols in this namespace should be 'construct entities', + i.e. for BLOCK local variables. */ + unsigned construct_entities:1; } gfc_namespace; @@ -1964,7 +1970,7 @@ typedef enum EXEC_POINTER_ASSIGN, EXEC_GOTO, EXEC_CALL, EXEC_COMPCALL, EXEC_ASSIGN_CALL, EXEC_RETURN, EXEC_ENTRY, EXEC_PAUSE, EXEC_STOP, EXEC_CONTINUE, EXEC_INIT_ASSIGN, - EXEC_IF, EXEC_ARITHMETIC_IF, EXEC_DO, EXEC_DO_WHILE, EXEC_SELECT, + EXEC_IF, EXEC_ARITHMETIC_IF, EXEC_DO, EXEC_DO_WHILE, EXEC_SELECT, EXEC_BLOCK, EXEC_FORALL, EXEC_WHERE, EXEC_CYCLE, EXEC_EXIT, EXEC_CALL_PPC, EXEC_ALLOCATE, EXEC_DEALLOCATE, EXEC_END_PROCEDURE, EXEC_OPEN, EXEC_CLOSE, EXEC_WAIT, @@ -2015,6 +2021,7 @@ typedef struct gfc_code const char *omp_name; gfc_namelist *omp_namelist; bool omp_bool; + gfc_namespace *ns; } ext; /* Points to additional structures required by statement */ -- cgit v1.2.1 From 1de1b1a9e40b5aa064d5e3d032dd43ce14f6d2ad Mon Sep 17 00:00:00 2001 From: burnus Date: Wed, 30 Sep 2009 19:55:45 +0000 Subject: fortran/ 2009-09-30 Janus Weil * check.c (gfc_check_same_type_as): New function for checking SAME_TYPE_AS and EXTENDS_TYPE_OF. * decl.c (encapsulate_class_symbol): Set ABSTRACT attribute for class container, if the contained type has it. Add an initializer for the class container. (add_init_expr_to_sym): Handle BT_CLASS. (vindex_counter): New counter for setting vindices. (gfc_match_derived_decl): Set vindex for all derived types, not only those which are being extended. * expr.c (gfc_check_assign_symbol): Handle NULL initialization of class pointers. * gfortran.h (gfc_isym_id): New values GFC_ISYM_SAME_TYPE_AS and GFC_ISYM_EXTENDS_TYPE_OF. (gfc_type_is_extensible): New prototype. * intrinsic.h (gfc_check_same_type_as): New prototype. * intrinsic.c (add_functions): Add SAME_TYPE_AS and EXTENDS_TYPE_OF. * primary.c (gfc_expr_attr): Handle CLASS-valued functions. * resolve.c (resolve_structure_cons): Handle BT_CLASS. (type_is_extensible): Make non-static and rename to 'gfc_type_is_extensible. (resolve_select_type): Renamed type_is_extensible. (resolve_class_assign): Handle NULL pointers. (resolve_fl_variable_derived): Renamed type_is_extensible. (resolve_fl_derived): Ditto. * trans-expr.c (gfc_trans_subcomponent_assign): Handle NULL initialization of class pointer components. (gfc_conv_structure): Handle BT_CLASS. * trans-intrinsic.c (gfc_conv_same_type_as,gfc_conv_extends_type_of): New functions. (gfc_conv_intrinsic_function): Handle SAME_TYPE_AS and EXTENDS_TYPE_OF. 2009-09-30 Janus Weil * gfortran.h (type_selector, select_type_tmp): New global variables. * match.c (type_selector, select_type_tmp): New global variables, used for SELECT TYPE statements. (gfc_match_select_type): Better error handling. Remember selector. (gfc_match_type_is): Create temporary variable. * module.c (ab_attribute): New value 'AB_IS_CLASS'. (attr_bits): New string. (mio_symbol_attribute): Handle 'is_class'. * resolve.c (resolve_select_type): Insert pointer assignment statement, to assign temporary to selector. * symbol.c (gfc_get_ha_sym_tree): Replace selector by a temporary in SELECT TYPE statements. 2009-09-30 Janus Weil * dump-parse-tree.c (show_code_node): Renamed 'alloc_list'. * gfortran.h (gfc_code): Rename 'alloc_list'. Add member 'ts'. (gfc_expr_to_initialize): New prototype. * match.c (alloc_opt_list): Correctly check type compatibility. Renamed 'alloc_list'. (dealloc_opt_list): Renamed 'alloc_list'. * resolve.c (expr_to_initialize): Rename to 'gfc_expr_to_initialize' and make it non-static. (resolve_allocate_expr): Set vindex for CLASS variables correctly. Move initialization code to gfc_trans_allocate. Renamed 'alloc_list'. (resolve_allocate_deallocate): Renamed 'alloc_list'. (check_class_pointer_assign): Rename to 'resolve_class_assign'. Change argument type. Adjust to work with ordinary assignments. (resolve_code): Call 'resolve_class_assign' for ordinary assignments. Renamed 'check_class_pointer_assign'. * st.c (gfc_free_statement): Renamed 'alloc_list'. * trans-stmt.c (gfc_trans_allocate): Renamed 'alloc_list'. Handle size determination and initialization of CLASS variables. Bugfix for ALLOCATE statements with default initialization and SOURCE block. (gfc_trans_deallocate): Renamed 'alloc_list'. 2009-09-30 Paul Thomas * trans-expr.c (gfc_conv_procedure_call): Convert a derived type actual to a class object if the formal argument is a class. 2009-09-30 Janus Weil PR fortran/40996 * decl.c (build_struct): Handle allocatable scalar components. * expr.c (gfc_add_component_ref): Correctly set typespec of expression, after inserting component reference. * match.c (gfc_match_type_is,gfc_match_class_is): Make sure that no variables are being used uninitialized. * primary.c (gfc_match_varspec): Handle CLASS array components. * resolve.c (resolve_select_type): Transform EXEC_SELECT_TYPE to EXEC_SELECT. * trans-array.c (structure_alloc_comps,gfc_trans_deferred_array): Handle allocatable scalar components. * trans-expr.c (gfc_conv_component_ref): Ditto. * trans-types.c (gfc_get_derived_type): Ditto. 2009-09-30 Janus Weil * decl.c (encapsulate_class_symbol): Modify names of class container components by prefixing with '$'. (gfc_match_end): Handle COMP_SELECT_TYPE. * expr.c (gfc_add_component_ref): Modify names of class container components by prefixing with '$'. * gfortran.h (gfc_statement): Add ST_SELECT_TYPE, ST_TYPE_IS and ST_CLASS_IS. (gfc_case): New field 'ts'. (gfc_exec_op): Add EXEC_SELECT_TYPE. (gfc_type_is_extension_of): New prototype. * match.h (gfc_match_select_type,gfc_match_type_is,gfc_match_class_is): New prototypes. * match.c (match_derived_type_spec): New function. (match_type_spec): Use 'match_derived_type_spec'. (match_case_eos): Modify error message. (gfc_match_select_type): New function. (gfc_match_case): Modify error message. (gfc_match_type_is): New function. (gfc_match_class_is): Ditto. * parse.h (gfc_compile_state): Add COMP_SELECT_TYPE. * parse.c (decode_statement): Handle SELECT TYPE, TYPE IS and CLASS IS statements. (next_statement): Handle ST_SELECT_TYPE. (gfc_ascii_statement): Handle ST_SELECT_TYPE, ST_TYPE_IS, ST_CLASS_IS. (parse_select_type_block): New function. (parse_executable): Handle ST_SELECT_TYPE. * resolve.c (resolve_deallocate_expr): Handle BT_CLASS. Modify names of class container components by prefixing with '$'. (resolve_allocate_expr): Ditto. (resolve_select_type): New function. (gfc_resolve_blocks): Handle EXEC_SELECT_TYPE. (check_class_pointer_assign): Modify names of class container components by prefixing with '$'. (resolve_code): Ditto. * st.c (gfc_free_statement): Ditto. * symbol.c (gfc_type_is_extension_of): New function. (gfc_type_compatible): Use 'gfc_type_is_extension_of', plus a bugfix. * trans.c (gfc_trans_code): Handel EXEC_SELECT_TYPE. 2009-09-30 Janus Weil Paul Thomas * check.c (gfc_check_move_alloc): Arguments don't have to be arrays. The second argument needs to be type-compatible with the first (not the other way around, which makes a difference for CLASS entities). * decl.c (encapsulate_class_symbol): New function. (build_sym,build_struct): Handle BT_CLASS, call 'encapsulate_class_symbol'. (gfc_match_decl_type_spec): Remove warning, use BT_CLASS. (gfc_match_derived_decl): Set vindex; * expr.c (gfc_add_component_ref): New function. (gfc_copy_expr,gfc_check_pointer_assign,gfc_check_assign_symbol): Handle BT_CLASS. * dump-parse-tree.c (show_symbol): Print vindex. * gfortran.h (bt): New basic type BT_CLASS. (symbol_attribute): New field 'is_class'. (gfc_typespec): Remove field 'is_class'. (gfc_symbol): New field 'vindex'. (gfc_get_ultimate_derived_super_type): New prototype. (gfc_add_component_ref): Ditto. * interface.c (gfc_compare_derived_types): Pointer equality check moved here from gfc_compare_types. (gfc_compare_types): Handle BT_CLASS and use gfc_type_compatible. * match.c (gfc_match_allocate,gfc_match_deallocate,gfc_match_call): Handle BT_CLASS. * misc.c (gfc_clear_ts): Removed is_class. (gfc_basic_typename,gfc_typename): Handle BT_CLASS. * module.c (bt_types,mio_typespec): Handle BT_CLASS. (mio_symbol): Handle vindex. * primary.c (gfc_match_varspec,gfc_variable_attr): Handle BT_CLASS. * resolve.c (find_array_spec,check_typebound_baseobject): Handle BT_CLASS. (resolve_ppc_call,resolve_expr_ppc): Don't call 'gfc_is_proc_ptr_comp' inside 'gcc_assert'. (resolve_deallocate_expr,resolve_allocate_expr): Handle BT_CLASS. (check_class_pointer_assign): New function. (resolve_code): Handle BT_CLASS, call check_class_pointer_assign. (resolve_fl_var_and_proc,type_is_extensible,resolve_fl_variable_derived, resolve_fl_variable): Handle BT_CLASS. (check_generic_tbp_ambiguity): Add special case. (resolve_typebound_procedure,resolve_fl_derived): Handle BT_CLASS. * symbol.c (gfc_get_ultimate_derived_super_type): New function. (gfc_type_compatible): Handle BT_CLASS. * trans-expr.c (conv_parent_component_references): Handle CLASS containers. (gfc_conv_initializer): Handle BT_CLASS. * trans-types.c (gfc_typenode_for_spec,gfc_get_derived_type): Handle BT_CLASS. testsuite/ 2009-09-30 Janus Weil * gfortran.dg/same_type_as_1.f03: New test. * gfortran.dg/same_type_as_2.f03: Ditto. 2009-09-30 Janus Weil * gfortran.dg/select_type_1.f03: Extended. * gfortran.dg/select_type_3.f03: New test. 2009-09-30 Janus Weil * gfortran.dg/class_allocate_1.f03: New test. 2009-09-30 Janus Weil PR fortran/40996 * gfortran.dg/allocatable_scalar_3.f90: New test. * gfortran.dg/select_type_2.f03: Ditto. * gfortran.dg/typebound_proc_5.f03: Changed error messages. 2009-09-30 Janus Weil * gfortran.dg/block_name_2.f90: Modified error message. * gfortran.dg/select_6.f90: Ditto. * gfortran.dg/select_type_1.f03: New test. 2009-09-30 Janus Weil * gfortran.dg/allocate_derived_1.f90: Remove -w option. * gfortran.dg/class_1.f03: Ditto. * gfortran.dg/class_2.f03: Ditto. * gfortran.dg/proc_ptr_comp_pass_1.f90: Ditto. * gfortran.dg/proc_ptr_comp_pass_2.f90: Ditto. * gfortran.dg/proc_ptr_comp_pass_3.f90: Ditto. * gfortran.dg/typebound_call_10.f03: Ditto. * gfortran.dg/typebound_call_2.f03: Ditto. * gfortran.dg/typebound_call_3.f03: Ditto. * gfortran.dg/typebound_call_4.f03: Ditto. * gfortran.dg/typebound_call_9.f03: Ditto. * gfortran.dg/typebound_generic_3.f03: Ditto. * gfortran.dg/typebound_generic_4.f03: Ditto. * gfortran.dg/typebound_operator_1.f03: Ditto. * gfortran.dg/typebound_operator_2.f03: Ditto. * gfortran.dg/typebound_operator_3.f03: Ditto. * gfortran.dg/typebound_operator_4.f03: Ditto. * gfortran.dg/typebound_proc_1.f08: Ditto. * gfortran.dg/typebound_proc_5.f03: Ditto. * gfortran.dg/typebound_proc_6.f03: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152345 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 0dce218b22c..326112df482 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -142,9 +142,8 @@ gfc_source_form; /* Basic types. BT_VOID is used by ISO C Binding so funcs like c_f_pointer can take any arg with the pointer attribute as a param. */ typedef enum -{ BT_UNKNOWN = 1, BT_INTEGER, BT_REAL, BT_COMPLEX, - BT_LOGICAL, BT_CHARACTER, BT_DERIVED, BT_PROCEDURE, BT_HOLLERITH, - BT_VOID +{ BT_UNKNOWN = 1, BT_INTEGER, BT_REAL, BT_COMPLEX, BT_LOGICAL, BT_CHARACTER, + BT_DERIVED, BT_CLASS, BT_PROCEDURE, BT_HOLLERITH, BT_VOID } bt; @@ -222,7 +221,7 @@ typedef enum ST_STOP, ST_SUBROUTINE, ST_TYPE, ST_USE, ST_WHERE_BLOCK, ST_WHERE, ST_WAIT, ST_WRITE, ST_ASSIGNMENT, ST_POINTER_ASSIGNMENT, ST_SELECT_CASE, ST_SEQUENCE, ST_SIMPLE_IF, ST_STATEMENT_FUNCTION, ST_DERIVED_DECL, ST_LABEL_ASSIGNMENT, - ST_ENUM, ST_ENUMERATOR, ST_END_ENUM, + ST_ENUM, ST_ENUMERATOR, ST_END_ENUM, ST_SELECT_TYPE, ST_TYPE_IS, ST_CLASS_IS, ST_OMP_ATOMIC, ST_OMP_BARRIER, ST_OMP_CRITICAL, ST_OMP_END_CRITICAL, ST_OMP_END_DO, ST_OMP_END_MASTER, ST_OMP_END_ORDERED, ST_OMP_END_PARALLEL, ST_OMP_END_PARALLEL_DO, ST_OMP_END_PARALLEL_SECTIONS, @@ -364,6 +363,7 @@ enum gfc_isym_id GFC_ISYM_EXIT, GFC_ISYM_EXP, GFC_ISYM_EXPONENT, + GFC_ISYM_EXTENDS_TYPE_OF, GFC_ISYM_FDATE, GFC_ISYM_FGET, GFC_ISYM_FGETC, @@ -478,6 +478,7 @@ enum gfc_isym_id GFC_ISYM_RESHAPE, GFC_ISYM_RRSPACING, GFC_ISYM_RSHIFT, + GFC_ISYM_SAME_TYPE_AS, GFC_ISYM_SC_KIND, GFC_ISYM_SCALE, GFC_ISYM_SCAN, @@ -670,6 +671,7 @@ typedef struct unsigned is_bind_c:1; /* say if is bound to C. */ unsigned extension:1; /* extends a derived type. */ + unsigned is_class:1; /* is a CLASS container. */ /* These flags are both in the typespec and attribute. The attribute list is what gets read from/written to a module file. The typespec @@ -849,7 +851,6 @@ typedef struct u; struct gfc_symbol *interface; /* For PROCEDURE declarations. */ - unsigned int is_class:1; int is_c_interop; int is_iso_c; bt f90_type; @@ -1133,6 +1134,11 @@ typedef struct gfc_symbol /* Defined only for Cray pointees; points to their pointer. */ struct gfc_symbol *cp_pointer; + int entry_id; /* Used in resolve.c for entries. */ + + /* CLASS vindex for declared and dynamic types in the class. */ + int vindex; + struct gfc_symbol *common_next; /* Links for COMMON syms */ /* This is in fact a gfc_common_head but it is only used for pointer @@ -1143,8 +1149,6 @@ typedef struct gfc_symbol order. */ int dummy_order; - int entry_id; - gfc_namelist *namelist, *namelist_tail; /* Change management fields. Symbols that might be modified by the @@ -1856,6 +1860,9 @@ typedef struct gfc_case represents the default case. */ gfc_expr *low, *high; + /* Only used for SELECT TYPE. */ + gfc_typespec ts; + /* Next case label in the list of cases for a single CASE label. */ struct gfc_case *next; @@ -1972,7 +1979,7 @@ typedef enum EXEC_ENTRY, EXEC_PAUSE, EXEC_STOP, EXEC_CONTINUE, EXEC_INIT_ASSIGN, EXEC_IF, EXEC_ARITHMETIC_IF, EXEC_DO, EXEC_DO_WHILE, EXEC_SELECT, EXEC_BLOCK, EXEC_FORALL, EXEC_WHERE, EXEC_CYCLE, EXEC_EXIT, EXEC_CALL_PPC, - EXEC_ALLOCATE, EXEC_DEALLOCATE, EXEC_END_PROCEDURE, + EXEC_ALLOCATE, EXEC_DEALLOCATE, EXEC_END_PROCEDURE, EXEC_SELECT_TYPE, EXEC_OPEN, EXEC_CLOSE, EXEC_WAIT, EXEC_READ, EXEC_WRITE, EXEC_IOLENGTH, EXEC_TRANSFER, EXEC_DT_END, EXEC_BACKSPACE, EXEC_ENDFILE, EXEC_INQUIRE, EXEC_REWIND, EXEC_FLUSH, @@ -2006,7 +2013,14 @@ typedef struct gfc_code gfc_actual_arglist *actual; gfc_case *case_list; gfc_iterator *iterator; - gfc_alloc *alloc_list; + + struct + { + gfc_typespec ts; + gfc_alloc *list; + } + alloc; + gfc_open *open; gfc_close *close; gfc_filepos *filepos; @@ -2476,6 +2490,8 @@ gfc_gsymbol *gfc_find_gsymbol (gfc_gsymbol *, const char *); gfc_typebound_proc* gfc_get_typebound_proc (void); gfc_symbol* gfc_get_derived_super_type (gfc_symbol*); +gfc_symbol* gfc_get_ultimate_derived_super_type (gfc_symbol*); +bool gfc_type_is_extension_of (gfc_symbol *, gfc_symbol *); bool gfc_type_compatible (gfc_typespec *, gfc_typespec *); gfc_symtree* gfc_find_typebound_proc (gfc_symbol*, gfc_try*, const char*, bool, locus*); @@ -2534,6 +2550,10 @@ void gfc_free_equiv (gfc_equiv *); void gfc_free_data (gfc_data *); void gfc_free_case_list (gfc_case *); +/* Used for SELECT TYPE statements. */ +extern gfc_symbol *type_selector; +extern gfc_symtree *select_type_tmp; + /* matchexp.c -- FIXME too? */ gfc_expr *gfc_get_parentheses (gfc_expr *); @@ -2548,9 +2568,9 @@ void gfc_resolve_omp_do_blocks (gfc_code *, gfc_namespace *); void gfc_free_actual_arglist (gfc_actual_arglist *); gfc_actual_arglist *gfc_copy_actual_arglist (gfc_actual_arglist *); const char *gfc_extract_int (gfc_expr *, int *); -gfc_expr *gfc_expr_to_initialize (gfc_expr *); bool is_subref_array (gfc_expr *); +void gfc_add_component_ref (gfc_expr *, const char *); gfc_expr *gfc_build_conversion (gfc_expr *); void gfc_free_ref_list (gfc_ref *); void gfc_type_convert_binary (gfc_expr *); @@ -2614,6 +2634,8 @@ gfc_try gfc_resolve_dim_arg (gfc_expr *); int gfc_is_formal_arg (void); void gfc_resolve_substring_charlen (gfc_expr *); match gfc_iso_c_sub_interface(gfc_code *, gfc_symbol *); +gfc_expr *gfc_expr_to_initialize (gfc_expr *); +bool gfc_type_is_extensible (gfc_symbol *sym); /* array.c */ -- cgit v1.2.1 From 72a81e55421a2af798db69a896a5f86c34e56554 Mon Sep 17 00:00:00 2001 From: ghazi Date: Fri, 2 Oct 2009 03:52:05 +0000 Subject: PR fortran/33197 * gfortran.h (HAVE_mpc_arc): Define. * simplify.c (gfc_simplify_acos): Handle complex acos. (gfc_simplify_acosh): Likewise for acosh. (gfc_simplify_asin): Likewise for asin. (gfc_simplify_asinh): Likewise for asinh. (gfc_simplify_atan): Likewise for atan. (gfc_simplify_atanh): Likewise for atanh. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152394 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 326112df482..b40f01ba4bf 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1616,6 +1616,9 @@ gfc_intrinsic_sym; # if MPC_VERSION >= MPC_VERSION_NUM(0,6,1) # define HAVE_mpc_pow # endif +# if MPC_VERSION >= MPC_VERSION_NUM(0,7,1) +# define HAVE_mpc_arc +# endif #else #define mpc_realref(X) ((X).r) #define mpc_imagref(X) ((X).i) -- cgit v1.2.1 From d94c13853accd0d733620f127edb7eb40e4b70b5 Mon Sep 17 00:00:00 2001 From: pault Date: Mon, 5 Oct 2009 18:19:55 +0000 Subject: 2009-10-05 Paul Thomas * trans-expr.c (select_class_proc): New function. (conv_function_val): Deal with class methods and call above. * symbol.c (gfc_type_compatible): Treat case where both ts1 and ts2 are BT_CLASS. gfortran.h : Add structure gfc_class_esym_list and include in the structure gfc_expr. * module.c (load_derived_extensions): New function. (read_module): Call above. (write_dt_extensions): New function. (write_derived_extensions): New function. (write_module): Use the above. * resolve.c (resolve_typebound_call): Add a function expression for class methods. This carries the chain of symbols for the dynamic dispatch in select_class_proc. (resolve_compcall): Add second, boolean argument to indicate if a function is being handled. (check_members): New function. (check_class_members): New function. (resolve_class_compcall): New function. (resolve_class_typebound_call): New function. (gfc_resolve_expr): Call above for component calls.. 2009-10-05 Paul Thomas * gfortran.dg/dynamic_dispatch_1.f90: New test. * gfortran.dg/dynamic_dispatch_2.f90: New test. * gfortran.dg/dynamic_dispatch_3.f90: New test. * gfortran.dg/module_md5_1.f90: Update md5 sum. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152463 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index b40f01ba4bf..72f01264630 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1594,6 +1594,17 @@ typedef struct gfc_intrinsic_sym gfc_intrinsic_sym; +typedef struct gfc_class_esym_list +{ + gfc_symbol *derived; + gfc_symbol *esym; + gfc_symbol *class_object; + struct gfc_class_esym_list *next; +} +gfc_class_esym_list; + +#define gfc_get_class_esym_list() XCNEW (gfc_class_esym_list) + /* Expression nodes. The expression node types deserve explanations, since the last couple can be easily misconstrued: @@ -1705,6 +1716,7 @@ typedef struct gfc_expr const char *name; /* Points to the ultimate name of the function */ gfc_intrinsic_sym *isym; gfc_symbol *esym; + gfc_class_esym_list *class_esym; } function; -- cgit v1.2.1 From a414690d9fc74fb66266ef8e37926a672163ebf9 Mon Sep 17 00:00:00 2001 From: ghazi Date: Wed, 7 Oct 2009 23:40:25 +0000 Subject: * arith.c (arith_power): Use mpc_pow_z. * gfortran.h (HAVE_mpc_pow_z): Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152544 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 72f01264630..d6ad992dda7 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1629,6 +1629,7 @@ gfc_class_esym_list; # endif # if MPC_VERSION >= MPC_VERSION_NUM(0,7,1) # define HAVE_mpc_arc +# define HAVE_mpc_pow_z # endif #else #define mpc_realref(X) ((X).r) -- cgit v1.2.1 From c151eaabaf50c3360ef47e70c15abd146ad11cd1 Mon Sep 17 00:00:00 2001 From: janus Date: Fri, 9 Oct 2009 20:25:19 +0000 Subject: 2009-10-09 Janus Weil PR fortran/41579 * gfortran.h (gfc_select_type_stack): New struct, to be used as a stack for SELECT TYPE statements. (select_type_stack): New global variable. (type_selector,select_type_tmp): Removed. * match.c (type_selector,type_selector): Removed. (select_type_stack): New variable, serving as a stack for SELECT TYPE statements. (select_type_push,select_type_set_tmp): New functions. (gfc_match_select_type): Call select_type_push. (gfc_match_type_is): Call select_type_set_tmp. * parse.c (select_type_pop): New function. (parse_select_type_block): Call select_type_pop. * symbol.c (select_type_insert_tmp): New function. (gfc_find_sym_tree): Call select_type_insert_tmp. 2009-10-09 Janus Weil PR fortran/41579 * gfortran.dg/select_type_6.f03: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152600 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index d6ad992dda7..c602600165b 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2208,6 +2208,18 @@ iterator_stack; extern iterator_stack *iter_stack; +/* Used for (possibly nested) SELECT TYPE statements. */ +typedef struct gfc_select_type_stack +{ + gfc_symbol *selector; /* Current selector variable. */ + gfc_symtree *tmp; /* Current temporary variable. */ + struct gfc_select_type_stack *prev; /* Previous element on stack. */ +} +gfc_select_type_stack; +extern gfc_select_type_stack *select_type_stack; +#define gfc_get_select_type_stack() XCNEW (gfc_select_type_stack) + + /* Node in the linked list used for storing finalizer procedures. */ typedef struct gfc_finalizer @@ -2566,10 +2578,6 @@ void gfc_free_equiv (gfc_equiv *); void gfc_free_data (gfc_data *); void gfc_free_case_list (gfc_case *); -/* Used for SELECT TYPE statements. */ -extern gfc_symbol *type_selector; -extern gfc_symtree *select_type_tmp; - /* matchexp.c -- FIXME too? */ gfc_expr *gfc_get_parentheses (gfc_expr *); -- cgit v1.2.1 From 8df8872c3cfa29af7821199a7e5200432b971717 Mon Sep 17 00:00:00 2001 From: jvdelisle Date: Fri, 16 Oct 2009 07:08:52 +0000 Subject: Commit file missed in previous commit. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152894 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index c602600165b..f6b172a2f38 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1598,7 +1598,7 @@ typedef struct gfc_class_esym_list { gfc_symbol *derived; gfc_symbol *esym; - gfc_symbol *class_object; + struct gfc_expr *vindex; struct gfc_class_esym_list *next; } gfc_class_esym_list; -- cgit v1.2.1 From b3704193582f3a455ad91d1d20b99034ca9ddb02 Mon Sep 17 00:00:00 2001 From: pault Date: Sat, 17 Oct 2009 18:09:25 +0000 Subject: 2009-10-17 Janus Weil Paul Thomas PR fortran/41608 * decl.c (gfc_match_data_decl): Add BT_CLASS for undefined type and empty type errors. * parse.c (gfc_build_block_ns): Only set recursive if parent ns has a proc_name. PR fortran/41629 PR fortran/41618 PR fortran/41587 * gfortran.h : Add class_ok bitfield to symbol_attr. * decl.c (build_sym): Set attr.class_ok if dummy, pointer or allocatable. (build_struct): Use gfc_try 't' to carry errors past the call to encapsulate_class_symbol. (attr_decl1): For a CLASS object, apply the new attribute to the data component. * match.c (gfc_match_select_type): Set attr.class_ok for an assigned selector. * resolve.c (resolve_fl_variable_derived): Check a CLASS object is dummy, pointer or allocatable by testing the class_ok and the use_assoc attribute. 2009-10-17 Janus Weil Paul Thomas PR fortran/41629 * gfortran.dg/class_6.f90: New test. PR fortran/41608 PR fortran/41587 * gfortran.dg/class_7.f90: New test. PR fortran/41618 * gfortran.dg/class_8.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152955 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index f6b172a2f38..74a31d2661c 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -672,6 +672,7 @@ typedef struct unsigned is_bind_c:1; /* say if is bound to C. */ unsigned extension:1; /* extends a derived type. */ unsigned is_class:1; /* is a CLASS container. */ + unsigned class_ok:1; /* is a CLASS object with correct attributes. */ /* These flags are both in the typespec and attribute. The attribute list is what gets read from/written to a module file. The typespec -- cgit v1.2.1 From 208593734c14b141f1a6f1a6524605e01f7f0b22 Mon Sep 17 00:00:00 2001 From: janus Date: Thu, 26 Nov 2009 19:01:02 +0000 Subject: 2009-11-26 Janus Weil PR fortran/42048 PR fortran/42167 * gfortran.h (gfc_is_function_return_value): New prototype. * match.c (gfc_match_call): Use new function 'gfc_is_function_return_value'. * primary.c (gfc_is_function_return_value): New function to check if a symbol is the return value of an encompassing function. (match_actual_arg,gfc_match_rvalue,match_variable): Use new function 'gfc_is_function_return_value'. * resolve.c (resolve_common_blocks,resolve_actual_arglist): Ditto. 2009-11-26 Janus Weil PR fortran/42048 PR fortran/42167 * gfortran.dg/select_type_10.f03: New test case. * gfortran.dg/typebound_call_11.f03: Extended test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154679 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 74a31d2661c..cc3ccf5527c 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2751,6 +2751,7 @@ symbol_attribute gfc_expr_attr (gfc_expr *); match gfc_match_rvalue (gfc_expr **); match gfc_match_varspec (gfc_expr*, int, bool, bool); int gfc_check_digit (char, int); +bool gfc_is_function_return_value (gfc_symbol *, gfc_namespace *); /* trans.c */ void gfc_generate_code (gfc_namespace *); -- cgit v1.2.1 From bdfbc762ef80b1196e214ed9c90e9f57a11e264b Mon Sep 17 00:00:00 2001 From: janus Date: Mon, 30 Nov 2009 20:43:06 +0000 Subject: merge from fortran-dev branch: gcc/fortran/ 2009-11-30 Janus Weil PR fortran/42053 * resolve.c (resolve_select_type): Check for duplicate CLASS IS blocks. 2009-11-30 Janus Weil PR fortran/41631 * decl.c (gfc_match_derived_decl): Set extension level. * gfortran.h (symbol_attribute): Expand 'extension' bit field to 8 bit. * iresolve.c (gfc_resolve_extends_type_of): Return value of 'is_extension_of' has kind=4. * match.c (select_type_set_tmp,gfc_match_class_is): Create temporary for CLASS IS blocks. * module.c (MOD_VERSION): Bump module version. (ab_attribute,attr_bits): Remove AB_EXTENSION. (mio_symbol_attribute): Handle expanded 'extension' field. * resolve.c (resolve_select_type): Implement CLASS IS blocks. (resolve_fl_variable_derived): Show correct type name. * symbol.c (gfc_build_class_symbol): Set extension level. 2009-11-30 Janus Weil * intrinsic.h (gfc_resolve_extends_type_of): Add prototype. * intrinsic.c (add_functions): Use 'gfc_resolve_extends_type_of'. * iresolve.c (gfc_resolve_extends_type_of): New function, which replaces the call to EXTENDS_TYPE_OF by the library function 'is_extension_of' and modifies the arguments. * trans-intrinsic.c (gfc_conv_extends_type_of): Removed. (gfc_conv_intrinsic_function): FOR EXTENDS_TYPE_OF, don't call gfc_conv_extends_type_of but gfc_conv_intrinsic_funcall. 2009-11-30 Paul Thomas Janus Weil * decl.c (encapsulate_class_symbol): Replaced by 'gfc_build_class_symbol'. (build_sym,build_struct): Call 'gfc_build_class_symbol'. (gfc_match_derived_decl): Replace vindex by hash_value. * dump-parse-tree.c (show_symbol): Replace vindex by hash_value. * gfortran.h (symbol_attribute): Add field 'vtab'. (gfc_symbol): Replace vindex by hash_value. (gfc_class_esym_list): Ditto. (gfc_get_derived_type,gfc_build_class_symbol,gfc_find_derived_vtab): New prototypes. * module.c (mio_symbol): Replace vindex by hash_value. * resolve.c (vindex_expr): Rename to 'hash_value_expr'. (resolve_class_compcall,resolve_class_typebound_call): Renamed 'vindex_expr'. (resolve_select_type): Replace $vindex by $vptr->$hash. * symbol.c (gfc_add_save): Handle vtab symbols. (gfc_type_compatible): Rewrite. (gfc_build_class_symbol): New function which replaces 'encapsulate_class_symbol'. (gfc_find_derived_vtab): New function to set up a vtab symbol for a derived type. * trans-decl.c (gfc_create_module_variable): Handle vtab symbols. * trans-expr.c (select_class_proc): Replace vindex by hash_value. (gfc_conv_derived_to_class): New function to construct a temporary CLASS variable from a derived type expression. (gfc_conv_procedure_call): Call 'gfc_conv_derived_to_class'. (gfc_conv_structure): Initialize the $extends and $size fields of vtab symbols. (gfc_trans_class_assign): Replace $vindex by $vptr. Remove the $size assignment. * trans-intrinsic.c (gfc_conv_same_type_as): Replace $vindex by $vptr->$hash, and replace vindex by hash_value. * trans-stmt.c (gfc_trans_allocate): Insert $vptr references, replace $vindex by $vptr. Remove the $size assignment. * trans-types.c (gfc_get_derived_type): Make it non-static. gcc/testsuite/ 2009-11-30 Janus Weil PR fortran/42053 * gfortran.dg/select_type_9.f03: New. 2009-11-30 Janus Weil PR fortran/41631 * gfortran.dg/extends_type_of_1.f03: Fix invalid test case. * gfortran.dg/module_md5_1.f90: Adjusted MD5 sum. * gfortran.dg/select_type_1.f03: Remove FIXMEs. * gfortran.dg/select_type_2.f03: Ditto. * gfortran.dg/select_type_8.f03: New test. 2009-11-30 Janus Weil * gfortran.dg/extends_type_of_1.f03: New test. * gfortran.dg/same_type_as_1.f03: Extended. 2009-11-30 Paul Thomas * gfortran.dg/class_4c.f03: Add dg-additional-sources. * gfortran.dg/class_4d.f03: Rename module. Cleanup modules. libgfortran/ 2009-11-30 Janus Weil * gfortran.map: Add _gfortran_is_extension_of. * Makefile.am: Add intrinsics/extends_type_of.c. * Makefile.in: Regenerated. * intrinsics/extends_type_of.c: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154840 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index cc3ccf5527c..e552203cb91 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -670,9 +670,10 @@ typedef struct unsigned untyped:1; /* No implicit type could be found. */ unsigned is_bind_c:1; /* say if is bound to C. */ - unsigned extension:1; /* extends a derived type. */ + unsigned extension:8; /* extension level of a derived type. */ unsigned is_class:1; /* is a CLASS container. */ unsigned class_ok:1; /* is a CLASS object with correct attributes. */ + unsigned vtab:1; /* is a derived type vtab. */ /* These flags are both in the typespec and attribute. The attribute list is what gets read from/written to a module file. The typespec @@ -1137,8 +1138,8 @@ typedef struct gfc_symbol int entry_id; /* Used in resolve.c for entries. */ - /* CLASS vindex for declared and dynamic types in the class. */ - int vindex; + /* CLASS hashed name for declared and dynamic types in the class. */ + int hash_value; struct gfc_symbol *common_next; /* Links for COMMON syms */ @@ -1599,7 +1600,7 @@ typedef struct gfc_class_esym_list { gfc_symbol *derived; gfc_symbol *esym; - struct gfc_expr *vindex; + struct gfc_expr *hash_value; struct gfc_class_esym_list *next; } gfc_class_esym_list; @@ -2380,6 +2381,7 @@ gfc_try gfc_check_any_c_kind (gfc_typespec *); int gfc_validate_kind (bt, int, bool); int gfc_get_int_kind_from_width_isofortranenv (int size); int gfc_get_real_kind_from_width_isofortranenv (int size); +tree gfc_get_derived_type (gfc_symbol * derived); extern int gfc_index_integer_kind; extern int gfc_default_integer_kind; extern int gfc_max_integer_kind; @@ -2517,6 +2519,9 @@ void gfc_free_dt_list (void); gfc_gsymbol *gfc_get_gsymbol (const char *); gfc_gsymbol *gfc_find_gsymbol (gfc_gsymbol *, const char *); +gfc_try gfc_build_class_symbol (gfc_typespec *, symbol_attribute *, + gfc_array_spec **); +gfc_symbol *gfc_find_derived_vtab (gfc_symbol *); gfc_typebound_proc* gfc_get_typebound_proc (void); gfc_symbol* gfc_get_derived_super_type (gfc_symbol*); gfc_symbol* gfc_get_ultimate_derived_super_type (gfc_symbol*); -- cgit v1.2.1 From 0f77e4b8530980a42d981b38f6295a71ae02bc74 Mon Sep 17 00:00:00 2001 From: ghazi Date: Mon, 7 Dec 2009 15:32:43 +0000 Subject: PR other/40302 * arith.c: Remove HAVE_mpc* checks throughout. * expr.c: Likewise. * gfortran.h: Likewise. * resolve.c: Likewise. * simplify.c: Likewise. * target-memory.c: Likewise. * target-memory.h: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155043 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index e552203cb91..3a13cfe4b26 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1624,19 +1624,7 @@ gfc_class_esym_list; #include #include -#ifdef HAVE_mpc #include -# if MPC_VERSION >= MPC_VERSION_NUM(0,6,1) -# define HAVE_mpc_pow -# endif -# if MPC_VERSION >= MPC_VERSION_NUM(0,7,1) -# define HAVE_mpc_arc -# define HAVE_mpc_pow_z -# endif -#else -#define mpc_realref(X) ((X).r) -#define mpc_imagref(X) ((X).i) -#endif #define GFC_RND_MODE GMP_RNDN #define GFC_MPC_RND_MODE MPC_RNDNN @@ -1695,15 +1683,7 @@ typedef struct gfc_expr mpfr_t real; -#ifdef HAVE_mpc - mpc_t -#else - struct - { - mpfr_t r, i; - } -#endif - complex; + mpc_t complex; struct { -- cgit v1.2.1 From 4b68c8f791fda8f94422fbeadf6b3490e90bcd23 Mon Sep 17 00:00:00 2001 From: domob Date: Tue, 8 Dec 2009 11:39:20 +0000 Subject: 2008-12-08 Daniel Kraft PR fortran/41177 * gfortran.dg/typebound_proc_4.f03: Remove check for wrong error. * gfortran.dg/typebound_proc_13.f03: New test. 2008-12-08 Daniel Kraft PR fortran/41177 * gfortran.h (struct symbol_attribute): New flag `class_pointer'. * symbol.c (gfc_build_class_symbol): Set the new flag. * resolve.c (update_compcall_arglist): Remove wrong check for non-scalar base-object. (check_typebound_baseobject): Add the correct version here as well as some 'not implemented' message check in the old case. (resolve_typebound_procedure): Check that the passed-object dummy argument is scalar, non-pointer and non-allocatable as it should be. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155086 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 3a13cfe4b26..340e0149902 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -654,6 +654,11 @@ typedef struct dummy:1, result:1, assign:1, threadprivate:1, not_always_present:1, implied_index:1, subref_array_pointer:1, proc_pointer:1; + /* For CLASS containers, the pointer attribute is sometimes set internally + even though it was not directly specified. In this case, keep the + "real" (original) value here. */ + unsigned class_pointer:1; + ENUM_BITFIELD (save_state) save:2; unsigned data:1, /* Symbol is named in a DATA statement. */ -- cgit v1.2.1 From 8c2c51e82e7f9bab7ba3eb60b1dc5a7bfbb12673 Mon Sep 17 00:00:00 2001 From: dfranke Date: Fri, 11 Dec 2009 21:08:39 +0000 Subject: 2009-12-11 Daniel Franke PR fortran/40290 * expr.c (gfc_type_convert_binary): Added warn-on-conversion flag, passed on to gfc_convert_type_warn() instead of gfc_convert_type(); enabled warnings on all callers but ... * arith.c (eval_intrinsic): Disabled warnings on implicit type conversion. * gfortran.h gfc_type_convert_binary): Adjusted prototype. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155179 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 340e0149902..9ea5ad17b26 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2588,7 +2588,7 @@ bool is_subref_array (gfc_expr *); void gfc_add_component_ref (gfc_expr *, const char *); gfc_expr *gfc_build_conversion (gfc_expr *); void gfc_free_ref_list (gfc_ref *); -void gfc_type_convert_binary (gfc_expr *); +void gfc_type_convert_binary (gfc_expr *, int); int gfc_is_constant_expr (gfc_expr *); gfc_try gfc_simplify_expr (gfc_expr *, int); int gfc_has_vector_index (gfc_expr *); -- cgit v1.2.1 From e6bbcce0b12982d0df0058104392e6a71e02caee Mon Sep 17 00:00:00 2001 From: domob Date: Sun, 27 Dec 2009 09:30:57 +0000 Subject: 2009-12-27 Francois-Xavier Coudert Daniel Kraft PR fortran/22552 * lang.opt (Wimplicit-procedure): New option. * gfortran.h (struct gfc_option_t): New member `warn_implicit_procedure' * options.c (gfc_handle_option): Handle -Wimplicit-procedure. * interface.c (gfc_procedure_use): Warn about procedure never explicitly declared if requested by the new flag. * invoke.texi: Document new flag -Wimplicit-procedure. 2009-12-27 Francois-Xavier Coudert Daniel Kraft PR fortran/22552 * gfortran.dg/warn_implicit_procedure_1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155479 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 9ea5ad17b26..20f52eaed32 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2103,6 +2103,7 @@ typedef struct int warn_ampersand; int warn_conversion; int warn_implicit_interface; + int warn_implicit_procedure; int warn_line_truncation; int warn_surprising; int warn_tabs; -- cgit v1.2.1 From 738928bee1b9d374e8d3db6508a3975867771734 Mon Sep 17 00:00:00 2001 From: burnus Date: Fri, 8 Jan 2010 09:23:26 +0000 Subject: 2010-01-08 Tobias Burnus Date: Sun, 17 Jan 2010 13:33:11 +0000 Subject: gcc/fortran/ 2010-01-17 Janus Weil PR fortran/42677 * gfortran.h (symbol_attribute): Remove 'ambiguous_interfaces'. * interface.c (check_interface1): Move a warning message here from resolve_fl_procedure. (check_sym_interfaces): Removed 'attr.ambiguous_interfaces'. * module.c (read_module): Remove call to gfc_check_interfaces, since this comes too early here. * resolve.c (resolve_fl_procedure): Move warning message to check_interface1. gcc/testsuite/ 2010-01-17 Janus Weil PR fortran/42677 * gfortran.dg/interface_assignment_5.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155979 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 345a7015dce..320de835ce2 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -714,9 +714,6 @@ typedef struct modification of type or type parameters is permitted. */ unsigned referenced:1; - /* Set if the symbol has ambiguous interfaces. */ - unsigned ambiguous_interfaces:1; - /* Set if this is the symbol for the main program. */ unsigned is_main_program:1; -- cgit v1.2.1 From 4fc5fe463eab0652ad87b8948129fede1abe50b1 Mon Sep 17 00:00:00 2001 From: amylaar Date: Wed, 20 Jan 2010 07:52:18 +0000 Subject: PR bootstrap/42812 * gfortran.h (struct gfc_namespace) : Change to signed bitfield of width 2. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156062 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 320de835ce2..dd86c1554b0 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1372,8 +1372,9 @@ typedef struct gfc_namespace /* Set to 1 if namespace is an interface body with "IMPORT" used. */ unsigned has_import_set:1; - /* Set to 1 if resolved has been called for this namespace. */ - unsigned resolved:1; + /* Set to 1 if resolved has been called for this namespace. + Holds -1 during resolution. */ + signed resolved:2; /* Set to 1 if code has been generated for this namespace. */ unsigned translated:1; -- cgit v1.2.1 From ffc91ac17fb327ea6eb30c38ebc8bb7add445af1 Mon Sep 17 00:00:00 2001 From: pault Date: Sun, 31 Jan 2010 12:05:22 +0000 Subject: 2010-01-31 Paul Thomas PR fortran/38324 * expr.c (gfc_get_full_arrayspec_from_expr): New function. * gfortran.h : Add prototype for above. * trans-expr.c (gfc_trans_alloc_subarray_assign): New function. (gfc_trans_subcomponent_assign): Call new function to replace the code to deal with allocatable components. * trans-intrinsic.c (gfc_conv_intrinsic_bound): Call gfc_get_full_arrayspec_from_expr to replace existing code. 2010-01-31 Paul Thomas PR fortran/38324 * gfortran.dg/alloc_comp_basics_1.f90: Remove option -O2. * gfortran.dg/alloc_comp_bounds_1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156399 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index dd86c1554b0..5b8f9c104e5 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2616,6 +2616,8 @@ gfc_try gfc_check_assign_symbol (gfc_symbol *, gfc_expr *); gfc_expr *gfc_default_initializer (gfc_typespec *); gfc_expr *gfc_get_variable_expr (gfc_symtree *); +gfc_array_spec *gfc_get_full_arrayspec_from_expr (gfc_expr *expr); + bool gfc_traverse_expr (gfc_expr *, gfc_symbol *, bool (*)(gfc_expr *, gfc_symbol *, int*), int); -- cgit v1.2.1 From cd584ef87c4d4e8308e135adbe6bcea2dcaec489 Mon Sep 17 00:00:00 2001 From: burnus Date: Tue, 16 Feb 2010 08:35:05 +0000 Subject: 2010-02-16 Tobias Burnus PR fortran/43040 * gfortran.h (gfc_isym_id): Rename GFS_ISYM_GAMMA to * GFS_ISYM_TGAMMA. * intrinsic.c (add_functions): Ditto. * iresolve.c (gfc_resolve_gamma): Call tgamma instead of gamma. * mathbuiltins.def: Use TGAMMA instead of GAMMA with "tgamma". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156796 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 5b8f9c104e5..71f3fe054ab 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -377,7 +377,7 @@ enum gfc_isym_id GFC_ISYM_FSEEK, GFC_ISYM_FSTAT, GFC_ISYM_FTELL, - GFC_ISYM_GAMMA, + GFC_ISYM_TGAMMA, GFC_ISYM_GERROR, GFC_ISYM_GETARG, GFC_ISYM_GET_COMMAND, -- cgit v1.2.1 From 54564d01b93944df0c0b34daf82e41280e8e3435 Mon Sep 17 00:00:00 2001 From: burnus Date: Sun, 21 Feb 2010 13:06:07 +0000 Subject: 2010-02-21 Tobias Burnus PR fortran/35259 * doc/invoke.texi (-fassociative-math): Document that this option is automatically enabled for Fortran. 2010-02-21 Tobias Burnus PR fortran/35259 * gfortran.h (gfc_option_t): New flag -fprotect-parens. * lang.opt: Ditto. * option.c (gfc_init_options,gfc_handle_option): Ditto. * trans-expr.c (gfc_conv_expr_op): Use the flag. * invoke.texi: Document new -fno-protect-parens flag. 2010-02-21 Tobias Burnus PR fortran/35259 * gfortran.dg/reassoc_5.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156937 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 71f3fe054ab..eeaf0af8b7f 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2150,6 +2150,7 @@ typedef struct char flag_init_character_value; int flag_align_commons; int flag_whole_file; + int flag_protect_parens; int fpe; int rtcheck; -- cgit v1.2.1 From 1384ae99ee84aa34f559ffb29468099e22d88dd2 Mon Sep 17 00:00:00 2001 From: pault Date: Thu, 1 Apr 2010 18:06:05 +0000 Subject: 2010-04-01 Paul Thomas * ioparm.def : Update copyright. * lang.opt : ditto * trans-array.c : ditto * trans-array.h : ditto * expr.c: ditto * trans-types.c: ditto * dependency.c : ditto * gfortran.h : ditto * options.c : ditto * trans-io.c : ditto * trans-intrinsic.c : ditto * libgfortran.h : ditto * invoke.texi : ditto * intrinsic.texi : ditto * trans.c : ditto * trans.h : ditto * intrinsic.c : ditto * interface.c : ditto * iresolve.c : ditto * trans-stmt.c : ditto * trans-stmt.h : ditto * parse,c : ditto * match.h : ditto * error.c : ditto git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157923 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index eeaf0af8b7f..af1f1c69409 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1,5 +1,6 @@ /* gfortran header file - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, + 2009, 2010 Free Software Foundation, Inc. Contributed by Andy Vaught -- cgit v1.2.1 From c6cd3066bcb72a59fecce6bfa99cb4e169a4a751 Mon Sep 17 00:00:00 2001 From: burnus Date: Tue, 6 Apr 2010 16:26:02 +0000 Subject: 2010-04-06 Tobias Burnus PR fortran/39997 * intrinsic.c (add_functions): Add num_images. * decl.c (gfc_match_end): Handle END CRITICAL. * intrinsic.h (gfc_simplify_num_images): Add prototype. * dump-parse-tree.c (show_code_node): Dump CRITICAL, ERROR STOP, and SYNC. * gfortran.h (gfc_statement): Add enum items for those. (gfc_exec_op) Ditto. (gfc_isym_id): Add num_images. * trans-stmt.c (gfc_trans_stop): Handle ERROR STOP. (gfc_trans_sync,gfc_trans_critical): New functions. * trans-stmt.h (gfc_trans_stop,gfc_trans_sync, gfc_trans_critical): Add/update prototypes. * trans.c (gfc_trans_code): Handle CRITICAL, ERROR STOP, and SYNC statements. * trans.h (gfor_fndecl_error_stop_string) Add variable. * resolve.c (resolve_sync): Add function. (gfc_resolve_blocks): Handle CRITICAL. (resolve_code): Handle CRITICAL, ERROR STOP, (resolve_branch): Add CRITICAL constraint check. and SYNC statements. * st.c (gfc_free_statement): Add new statements. * trans-decl.c (gfor_fndecl_error_stop_string): Global variable. (gfc_build_builtin_function_decls): Initialize it. * match.c (gfc_match_if): Handle ERROR STOP and SYNC. (gfc_match_critical, gfc_match_error_stop, sync_statement, gfc_match_sync_all, gfc_match_sync_images, gfc_match_sync_memory): New functions. (match_exit_cycle): Handle CRITICAL constraint. (gfc_match_stopcode): Handle ERROR STOP. * match.h (gfc_match_critical, gfc_match_error_stop, gfc_match_sync_all, gfc_match_sync_images, gfc_match_sync_memory): Add prototype. * parse.c (decode_statement, gfc_ascii_statement, parse_executable): Handle new statements. (parse_critical_block): New function. * parse.h (gfc_compile_state): Add COMP_CRITICAL. * intrinsic.texi (num_images): Document new function. * simplify.c (gfc_simplify_num_images): Add function. 2010-04-06 Tobias Burnus PR fortran/39997 * gfortran.dg/coarray_1.f90: New test. * gfortran.dg/coarray_2.f90: New test. * gfortran.dg/coarray_3.f90: New test. 2010-04-06 Tobias Burnus PR fortran/39997 * runtime/stop.c (error_stop_string): New function. * gfortran.map (_gfortran_error_stop_string): Add. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158008 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index af1f1c69409..1f98824de75 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -214,9 +214,9 @@ typedef enum ST_END_FILE, ST_FINAL, ST_FLUSH, ST_END_FORALL, ST_END_FUNCTION, ST_ENDIF, ST_END_INTERFACE, ST_END_MODULE, ST_END_PROGRAM, ST_END_SELECT, ST_END_SUBROUTINE, ST_END_WHERE, ST_END_TYPE, ST_ENTRY, ST_EQUIVALENCE, - ST_EXIT, ST_FORALL, ST_FORALL_BLOCK, ST_FORMAT, ST_FUNCTION, ST_GOTO, - ST_IF_BLOCK, ST_IMPLICIT, ST_IMPLICIT_NONE, ST_IMPORT, - ST_INQUIRE, ST_INTERFACE, + ST_ERROR_STOP, ST_EXIT, ST_FORALL, ST_FORALL_BLOCK, ST_FORMAT, ST_FUNCTION, + ST_GOTO, ST_IF_BLOCK, ST_IMPLICIT, ST_IMPLICIT_NONE, ST_IMPORT, + ST_INQUIRE, ST_INTERFACE, ST_SYNC_ALL, ST_SYNC_MEMORY, ST_SYNC_IMAGES, ST_PARAMETER, ST_MODULE, ST_MODULE_PROC, ST_NAMELIST, ST_NULLIFY, ST_OPEN, ST_PAUSE, ST_PRIVATE, ST_PROGRAM, ST_PUBLIC, ST_READ, ST_RETURN, ST_REWIND, ST_STOP, ST_SUBROUTINE, ST_TYPE, ST_USE, ST_WHERE_BLOCK, ST_WHERE, ST_WAIT, @@ -231,7 +231,7 @@ typedef enum ST_OMP_PARALLEL, ST_OMP_PARALLEL_DO, ST_OMP_PARALLEL_SECTIONS, ST_OMP_PARALLEL_WORKSHARE, ST_OMP_SECTIONS, ST_OMP_SECTION, ST_OMP_SINGLE, ST_OMP_THREADPRIVATE, ST_OMP_WORKSHARE, ST_OMP_TASK, ST_OMP_END_TASK, - ST_OMP_TASKWAIT, ST_PROCEDURE, ST_GENERIC, + ST_OMP_TASKWAIT, ST_PROCEDURE, ST_GENERIC, ST_CRITICAL, ST_END_CRITICAL, ST_GET_FCN_CHARACTERISTICS, ST_NONE } gfc_statement; @@ -462,6 +462,7 @@ enum gfc_isym_id GFC_ISYM_NINT, GFC_ISYM_NOT, GFC_ISYM_NULL, + GFC_ISYM_NUMIMAGES, GFC_ISYM_OR, GFC_ISYM_PACK, GFC_ISYM_PERROR, @@ -1976,12 +1977,13 @@ gfc_forall_iterator; typedef enum { EXEC_NOP = 1, EXEC_END_BLOCK, EXEC_ASSIGN, EXEC_LABEL_ASSIGN, - EXEC_POINTER_ASSIGN, + EXEC_POINTER_ASSIGN, EXEC_CRITICAL, EXEC_ERROR_STOP, EXEC_GOTO, EXEC_CALL, EXEC_COMPCALL, EXEC_ASSIGN_CALL, EXEC_RETURN, EXEC_ENTRY, EXEC_PAUSE, EXEC_STOP, EXEC_CONTINUE, EXEC_INIT_ASSIGN, EXEC_IF, EXEC_ARITHMETIC_IF, EXEC_DO, EXEC_DO_WHILE, EXEC_SELECT, EXEC_BLOCK, EXEC_FORALL, EXEC_WHERE, EXEC_CYCLE, EXEC_EXIT, EXEC_CALL_PPC, EXEC_ALLOCATE, EXEC_DEALLOCATE, EXEC_END_PROCEDURE, EXEC_SELECT_TYPE, + EXEC_SYNC_ALL, EXEC_SYNC_MEMORY, EXEC_SYNC_IMAGES, EXEC_OPEN, EXEC_CLOSE, EXEC_WAIT, EXEC_READ, EXEC_WRITE, EXEC_IOLENGTH, EXEC_TRANSFER, EXEC_DT_END, EXEC_BACKSPACE, EXEC_ENDFILE, EXEC_INQUIRE, EXEC_REWIND, EXEC_FLUSH, -- cgit v1.2.1 From aff518b0c6c0be70a7a986a3abe418ddc323eaf8 Mon Sep 17 00:00:00 2001 From: burnus Date: Tue, 6 Apr 2010 18:16:13 +0000 Subject: 2010-04-06 Tobias Burnus PR fortran/18918 * array.c (gfc_free_array_spec,gfc_resolve_array_spec, match_array_element_spec,gfc_copy_array_spec, gfc_compare_array_spec): Include corank. (match_array_element_spec,gfc_set_array_spec): Support codimension. * decl.c (build_sym,build_struct,variable_decl, match_attr_spec,attr_decl1,cray_pointer_decl, gfc_match_volatile): Add codimension. (gfc_match_codimension): New function. * dump-parse-tree.c (show_array_spec,show_attr): Support * codimension. * gfortran.h (symbol_attribute,gfc_array_spec): Ditto. (gfc_add_codimension): New function prototype. * match.h (gfc_match_codimension): New function prototype. (gfc_match_array_spec): Update prototype * match.c (gfc_match_common): Update gfc_match_array_spec call. * module.c (MOD_VERSION): Bump. (mio_symbol_attribute): Support coarray attributes. (mio_array_spec): Add corank support. * parse.c (decode_specification_statement,decode_statement, parse_derived): Add coarray support. * resolve.c (resolve_formal_arglist, was_declared, is_non_constant_shape_array, resolve_fl_variable, resolve_fl_derived, resolve_symbol): Add coarray support. * symbol.c (check_conflict, gfc_add_volatile, gfc_copy_attr, gfc_build_class_symbol): Add coarray support. (gfc_add_codimension): New function. 2010-04-06 Tobias Burnus PR fortran/18918 * gfortran.dg/coarray_4.f90: New test. * gfortran.dg/coarray_5.f90: New test. * gfortran.dg/coarray_6.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158012 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 1f98824de75..a2e385d2d31 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -651,7 +651,7 @@ extern const ext_attr_t ext_attr_list[]; typedef struct { /* Variable attributes. */ - unsigned allocatable:1, dimension:1, external:1, intrinsic:1, + unsigned allocatable:1, dimension:1, codimension:1, external:1, intrinsic:1, optional:1, pointer:1, target:1, value:1, volatile_:1, temporary:1, dummy:1, result:1, assign:1, threadprivate:1, not_always_present:1, implied_index:1, subref_array_pointer:1, proc_pointer:1, asynchronous:1; @@ -735,7 +735,7 @@ typedef struct possibly nested. zero_comp is true if the derived type has no component at all. */ unsigned alloc_comp:1, pointer_comp:1, proc_pointer_comp:1, - private_comp:1, zero_comp:1; + private_comp:1, zero_comp:1, coarray_comp:1; /* Attributes set by compiler extensions (!GCC$ ATTRIBUTES). */ unsigned ext_attr:EXT_ATTR_NUM; @@ -867,6 +867,7 @@ gfc_typespec; typedef struct { int rank; /* A rank of zero means that a variable is a scalar. */ + int corank; array_type type; struct gfc_expr *lower[GFC_MAX_DIMENSIONS], *upper[GFC_MAX_DIMENSIONS]; @@ -2400,6 +2401,7 @@ void gfc_set_sym_referenced (gfc_symbol *); gfc_try gfc_add_attribute (symbol_attribute *, locus *); gfc_try gfc_add_ext_attribute (symbol_attribute *, ext_attr_id_t, locus *); gfc_try gfc_add_allocatable (symbol_attribute *, locus *); +gfc_try gfc_add_codimension (symbol_attribute *, const char *, locus *); gfc_try gfc_add_dimension (symbol_attribute *, const char *, locus *); gfc_try gfc_add_external (symbol_attribute *, locus *); gfc_try gfc_add_intrinsic (symbol_attribute *, locus *); -- cgit v1.2.1 From 2d640d61aabac1395dd2f903d406cf037df4cf7e Mon Sep 17 00:00:00 2001 From: burnus Date: Tue, 6 Apr 2010 18:23:56 +0000 Subject: 2010-04-06 Tobias Burnus PR fortran/18918 * gfortran.h (gfc_array_spec): Add cotype. * array.c (gfc_match_array_spec,gfc_set_array_spec): Use it and defer error diagnostic. * resolve.c (resolve_fl_derived): Add missing check. (resolve_symbol): Add cotype/type check. * parse.c (parse_derived): Fix setting of coarray_comp. 2010-04-06 Tobias Burnus PR fortran/18918 * gfortran.dg/coarray_4.f90: Fix test. * gfortran.dg/coarray_6.f90: Add more tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158014 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index a2e385d2d31..2bf0ef856d8 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -868,7 +868,7 @@ typedef struct { int rank; /* A rank of zero means that a variable is a scalar. */ int corank; - array_type type; + array_type type, cotype; struct gfc_expr *lower[GFC_MAX_DIMENSIONS], *upper[GFC_MAX_DIMENSIONS]; /* These two fields are used with the Cray Pointer extension. */ -- cgit v1.2.1 From 76daec3c7eda1449a237a2ff656c08e828d282fa Mon Sep 17 00:00:00 2001 From: burnus Date: Tue, 6 Apr 2010 19:03:10 +0000 Subject: 2010-04-06 Tobias Burnus PR fortran/18918 * array.c (gfc_match_array_spec): Add error for -fcoarray=none. * match.c (gfc_match_critical, sync_statement): Ditto. * gfortran.h (gfc_fcoarray): New enum. (gfc_option_t): Use it. * lang.opt (fcoarray): Add new flag. * invoke.texi (fcoarray): Document it. * options.c (gfc_init_options,gfc_handle_option): Handle * -fcoarray=. (gfc_handle_coarray_option): New function. 2010-04-06 Tobias Burnus PR fortran/18918 * gfortran.dg/coarray_2.f90: Add dg-options -fcoarray=single. * gfortran.dg/coarray_3.f90: Ditto. * gfortran.dg/coarray_4.f90: Ditto. * gfortran.dg/coarray_5.f90: Ditto. * gfortran.dg/coarray_6.f90: Ditto. * gfortran.dg/coarray_7.f90: Ditto. * gfortran.dg/coarray_8.f90: Ditto. * gfortran.dg/coarray_9.f90: New -fcoarray=none test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158016 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 2bf0ef856d8..f4f5d5294e3 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -563,6 +563,13 @@ typedef enum } init_local_integer; +typedef enum +{ + GFC_FCOARRAY_NONE = 0, + GFC_FCOARRAY_SINGLE +} +gfc_fcoarray; + /************************* Structures *****************************/ /* Used for keeping things in balanced binary trees. */ @@ -2158,6 +2165,7 @@ typedef struct int fpe; int rtcheck; + gfc_fcoarray coarray; int warn_std; int allow_std; -- cgit v1.2.1 From e97ac7c06c53487872b7d9d11148725317ef5588 Mon Sep 17 00:00:00 2001 From: burnus Date: Fri, 9 Apr 2010 05:54:29 +0000 Subject: 2010-04-09 Tobias Burnus PR fortran/18918 * decl.c (variable_decl, match_attr_spec): Fix setting the array spec. * array.c (match_subscript,gfc_match_array_ref): Add coarray * support. * data.c (gfc_assign_data_value): Ditto. * expr.c (gfc_check_pointer_assign): Add check for coarray * constraint. (gfc_traverse_expr): Traverse also through codimension expressions. (gfc_is_coindexed, gfc_has_ultimate_allocatable, gfc_has_ultimate_pointer): New functions. * gfortran.h (gfc_array_ref_dimen_type): Add DIMEN_STAR for * coarrays. (gfc_array_ref): Add codimen. (gfc_array_ref): Add in_allocate. (gfc_is_coindexed, gfc_has_ultimate_allocatable, gfc_has_ultimate_pointer): Add prototypes. * interface.c (compare_parameter, compare_actual_formal, check_intents): Add coarray constraints. * match.c (gfc_match_iterator): Add coarray constraint. * match.h (gfc_match_array_ref): Update interface. * primary.c (gfc_match_varspec): Handle codimensions. * resolve.c (coarray_alloc, inquiry_argument): New static * variables. (check_class_members): Return gfc_try instead for error recovery. (resolve_typebound_function,resolve_typebound_subroutine, check_members): Handle return value of check_class_members. (resolve_structure_cons, resolve_actual_arglist, resolve_function, check_dimension, compare_spec_to_ref, resolve_array_ref, resolve_ref, resolve_variable, gfc_resolve_expr, conformable_arrays, resolve_allocate_expr, resolve_ordinary_assign): Add coarray support. * trans-array.c (gfc_conv_array_ref, gfc_walk_variable_expr): Skip over coarray refs. (gfc_array_allocate) Add support for references containing coindexes. * trans-expr.c (gfc_add_interface_mapping): Copy coarray * attribute. (gfc_map_intrinsic_function): Ignore codimensions. 2010-04-09 Tobias Burnus PR fortran/18918 * gfortran.dg/coarray_7.f90: New test. * gfortran.dg/coarray_8.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158149 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index f4f5d5294e3..3668df4a396 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1444,13 +1444,15 @@ extern gfc_interface_info current_interface; enum gfc_array_ref_dimen_type { - DIMEN_ELEMENT = 1, DIMEN_RANGE, DIMEN_VECTOR, DIMEN_UNKNOWN + DIMEN_ELEMENT = 1, DIMEN_RANGE, DIMEN_VECTOR, DIMEN_STAR, DIMEN_UNKNOWN }; typedef struct gfc_array_ref { ar_type type; int dimen; /* # of components in the reference */ + int codimen; + bool in_allocate; /* For coarray checks. */ locus where; gfc_array_spec *as; @@ -2642,6 +2644,11 @@ void gfc_expr_replace_comp (gfc_expr *, gfc_component *); bool gfc_is_proc_ptr_comp (gfc_expr *, gfc_component **); +bool gfc_is_coindexed (gfc_expr *); +bool gfc_has_ultimate_allocatable (gfc_expr *); +bool gfc_has_ultimate_pointer (gfc_expr *); + + /* st.c */ extern gfc_code new_st; -- cgit v1.2.1 From 126387b5b6b5a55db23d87e27562c91cc235c906 Mon Sep 17 00:00:00 2001 From: jvdelisle Date: Tue, 13 Apr 2010 01:59:35 +0000 Subject: 2010-04-12 Jerry DeLisle * array.c (extract_element): Restore function from trunk. (gfc_get_array_element): Restore function from trunk. (gfc_expand_constructor): Restore check against flag_max_array_constructor. * constructor.c (node_copy_and_append): Delete unused. * gfortran.h: Delete comment and extra include. * constructor.h: Bump copyright and clean up TODO comments. * resolve.c: Whitespace. 2010-04-12 Daniel Franke * simplify.c (compute_dot_product): Replaced usage of ADVANCE macro with direct access access to elements. Adjusted prototype, fixed all callers. (gfc_simplify_dot_product): Removed duplicate check for zero-sized array. (gfc_simplify_matmul): Removed usage of ADVANCE macro. (gfc_simplify_spread): Removed workaround, directly insert elements at a given array position. (gfc_simplify_transpose): Likewise. (gfc_simplify_pack): Replaced usage of ADVANCE macro with corresponding function calls. (gfc_simplify_unpack): Likewise. 2010-04-12 Daniel Franke * simplify.c (only_convert_cmplx_boz): Renamed to ... (convert_boz): ... this and moved to start of file. (gfc_simplify_abs): Whitespace fix. (gfc_simplify_acos): Whitespace fix. (gfc_simplify_acosh): Whitespace fix. (gfc_simplify_aint): Whitespace fix. (gfc_simplify_dint): Whitespace fix. (gfc_simplify_anint): Whitespace fix. (gfc_simplify_and): Replaced if-gate by more common switch-over-type. (gfc_simplify_dnint): Whitespace fix. (gfc_simplify_asin): Whitespace fix. (gfc_simplify_asinh): Moved creation of result-expr out of switch. (gfc_simplify_atan): Likewise. (gfc_simplify_atanh): Whitespace fix. (gfc_simplify_atan2): Whitespace fix. (gfc_simplify_bessel_j0): Removed ATTRIBUTE_UNUSED. (gfc_simplify_bessel_j1): Likewise. (gfc_simplify_bessel_jn): Likewise. (gfc_simplify_bessel_y0): Likewise. (gfc_simplify_bessel_y1): Likewise. (gfc_simplify_bessel_yn): Likewise. (gfc_simplify_ceiling): Reorderd statements. (simplify_cmplx): Use convert_boz(), check for constant arguments. Whitespace fix. (gfc_simplify_cmplx): Use correct default kind. Removed check for constant arguments. (gfc_simplify_complex): Replaced if-gate. Removed check for constant arguments. (gfc_simplify_conjg): Whitespace fix. (gfc_simplify_cos): Whitespace fix. (gfc_simplify_cosh): Replaced if-gate by more common switch-over-type. (gfc_simplify_dcmplx): Removed check for constant arguments. (gfc_simplify_dble): Use convert_boz() and gfc_convert_constant(). (gfc_simplify_digits): Whitespace fix. (gfc_simplify_dim): Whitespace fix. (gfc_simplify_dprod): Reordered statements. (gfc_simplify_erf): Whitespace fix. (gfc_simplify_erfc): Whitespace fix. (gfc_simplify_epsilon): Whitespace fix. (gfc_simplify_exp): Whitespace fix. (gfc_simplify_exponent): Use convert_boz(). (gfc_simplify_floor): Reorderd statements. (gfc_simplify_gamma): Whitespace fix. (gfc_simplify_huge): Whitespace fix. (gfc_simplify_iand): Whitespace fix. (gfc_simplify_ieor): Whitespace fix. (simplify_intconv): Use gfc_convert_constant(). (gfc_simplify_int): Use simplify_intconv(). (gfc_simplify_int2): Reorderd statements. (gfc_simplify_idint): Reorderd statements. (gfc_simplify_ior): Whitespace fix. (gfc_simplify_ishftc): Removed duplicate type check. (gfc_simplify_len): Use range_check() instead of manual range check. (gfc_simplify_lgamma): Removed ATTRIBUTE_UNUSED. Whitespace fix. (gfc_simplify_log): Whitespace fix. (gfc_simplify_log10): Whitespace fix. (gfc_simplify_minval): Whitespace fix. (gfc_simplify_maxval): Whitespace fix. (gfc_simplify_mod): Whitespace fix. (gfc_simplify_modulo): Whitespace fix. (simplify_nint): Reorderd statements. (gfc_simplify_not): Whitespace fix. (gfc_simplify_or): Replaced if-gate by more common switch-over-type. (gfc_simplify_radix): Removed unused result-variable. Whitespace fix. (gfc_simplify_range): Removed unused result-variable. Whitespace fix. (gfc_simplify_real): Use convert_boz() and gfc_convert_constant(). (gfc_simplify_realpart): Whitespace fix. (gfc_simplify_selected_char_kind): Removed unused result-variable. (gfc_simplify_selected_int_kind): Removed unused result-variable. (gfc_simplify_selected_real_kind): Removed unused result-variable. (gfc_simplify_sign): Whitespace fix. (gfc_simplify_sin): Whitespace fix. (gfc_simplify_sinh): Replaced if-gate by more common switch-over-type. (gfc_simplify_sqrt): Avoided goto by inlining check. Whitespace fix. (gfc_simplify_tan): Replaced if-gate by more common switch-over-type. (gfc_simplify_tanh): Replaced if-gate by more common switch-over-type. (gfc_simplify_xor): Replaced if-gate by more common switch-over-type. 2010-04-12 Daniel Franke * gfortran.h (gfc_start_constructor): Removed. (gfc_get_array_element): Removed. * array.c (gfc_start_constructor): Removed, use gfc_get_array_expr instead. Fixed all callers. (extract_element): Removed. (gfc_expand_constructor): Temporarily removed check for max-array-constructor. Will be re-introduced later if still required. (gfc_get_array_element): Removed, use gfc_constructor_lookup_expr instead. Fixed all callers. * expr.c (find_array_section): Replaced manual lookup of elements by gfc_constructor_lookup. 2010-04-12 Daniel Franke * gfortran.h (gfc_get_null_expr): New prototype. (gfc_get_operator_expr): New prototype. (gfc_get_character_expr): New prototype. (gfc_get_iokind_expr): New prototype. * expr.c (gfc_get_null_expr): New. (gfc_get_character_expr): New. (gfc_get_iokind_expr): New. (gfc_get_operator_expr): Moved here from matchexp.c (build_node). * matchexp.c (build_node): Renamed and moved to expr.c (gfc_get_operator_expr). Reordered arguments to match other functions. Fixed all callers. (gfc_get_parentheses): Use specific function to build expr. * array.c (gfc_match_array_constructor): Likewise. * arith.c (eval_intrinsic): Likewise. (gfc_hollerith2int): Likewise. (gfc_hollerith2real): Likewise. (gfc_hollerith2complex): Likewise. (gfc_hollerith2logical): Likewise. * data.c (create_character_intializer): Likewise. * decl.c (gfc_match_null): Likewise. (enum_initializer): Likewise. * io.c (gfc_match_format): Likewise. (match_io): Likewise. * match.c (gfc_match_nullify): Likewise. * primary.c (match_string_constant): Likewise. (match_logical_constant): Likewise. (build_actual_constructor): Likewise. * resolve.c (build_default_init_expr): Likewise. * symbol.c (generate_isocbinding_symbol): Likewise. (gfc_build_class_symbol): Likewise. (gfc_find_derived_vtab): Likewise. * simplify.c (simplify_achar_char): Likewise. (gfc_simplify_adjustl): Likewise. (gfc_simplify_adjustr): Likewise. (gfc_simplify_and): Likewise. (gfc_simplify_bit_size): Likewise. (gfc_simplify_is_iostat_end): Likewise. (gfc_simplify_is_iostat_eor): Likewise. (gfc_simplify_isnan): Likewise. (simplify_bound): Likewise. (gfc_simplify_leadz): Likewise. (gfc_simplify_len_trim): Likewise. (gfc_simplify_logical): Likewise. (gfc_simplify_maxexponent): Likewise. (gfc_simplify_minexponent): Likewise. (gfc_simplify_new_line): Likewise. (gfc_simplify_null): Likewise. (gfc_simplify_or): Likewise. (gfc_simplify_precision): Likewise. (gfc_simplify_repeat): Likewise. (gfc_simplify_scan): Likewise. (gfc_simplify_size): Likewise. (gfc_simplify_trailz): Likewise. (gfc_simplify_trim): Likewise. (gfc_simplify_verify): Likewise. (gfc_simplify_xor): Likewise. * trans-io.c (build_dt): Likewise. (gfc_new_nml_name_expr): Removed. 2010-04-12 Daniel Franke * arith.h (gfc_constant_result): Removed prototype. * constructor.h (gfc_build_array_expr): Removed prototype. (gfc_build_structure_constructor_expr): Removed prototype. * gfortran.h (gfc_int_expr): Removed prototype. (gfc_logical_expr): Removed prototype. (gfc_get_array_expr): New prototype. (gfc_get_structure_constructor_expr): New prototype. (gfc_get_constant_expr): New prototype. (gfc_get_int_expr): New prototype. (gfc_get_logical_expr): New prototype. * arith.c (gfc_constant_result): Moved and renamed to expr.c (gfc_get_constant_expr). Fixed all callers. * constructor.c (gfc_build_array_expr): Moved and renamed to expr.c (gfc_get_array_expr). Split gfc_typespec argument to type and kind. Fixed all callers. (gfc_build_structure_constructor_expr): Moved and renamed to expr.c (gfc_get_structure_constructor_expr). Split gfc_typespec argument to type and kind. Fixed all callers. * expr.c (gfc_logical_expr): Renamed to ... (gfc_get_logical_expr): ... this. Added kind argument. Fixed all callers. (gfc_int_expr): Renamed to ... (gfc_get_int_expr): ... this. Added kind and where arguments. Fixed all callers. (gfc_get_constant_expr): New. (gfc_get_array_expr): New. (gfc_get_structure_constructor_expr): New. * simplify.c (int_expr_with_kind): Removed, callers use gfc_get_int_expr instead. 2010-04-12 Daniel Franke * constructor.h: New. * constructor.c: New. * Make-lang.in: Add new files to F95_PARSER_OBJS. * arith.c (reducy_unary): Use constructor API. (reduce_binary_ac): Likewise. (reduce_binary_ca): Likewise. (reduce_binary_aa): Likewise. * check.c (gfc_check_pack): Likewise. (gfc_check_reshape): Likewise. (gfc_check_unpack): Likewise. * decl.c (add_init_expr_to_sym): Likewise. (build_struct): Likewise. * dependency.c (gfc_check_dependency): Likewise. (contains_forall_index_p): Likewise. * dump-parse-tree.c (show_constructor): Likewise. * expr.c (free_expr0): Likewise. (gfc_copy_expr): Likewise. (gfc_is_constant_expr): Likewise. (simplify_constructor): Likewise. (find_array_element): Likewise. (find_component_ref): Likewise. (find_array_section): Likewise. (find_substring_ref): Likewise. (simplify_const_ref): Likewise. (scalarize_intrinsic_call): Likewise. (check_alloc_comp_init): Likewise. (gfc_default_initializer): Likewise. (gfc_traverse_expr): Likewise. * iresolve.c (check_charlen_present): Likewise. (gfc_resolve_reshape): Likewise. (gfc_resolve_transfer): Likewise. * module.c (mio_constructor): Likewise. * primary.c (build_actual_constructor): Likewise. (gfc_match_structure_constructor): Likewise. * resolve.c (resolve_structure_cons): Likewise. * simplify.c (is_constant_array_expr): Likewise. (init_result_expr): Likewise. (transformational_result): Likewise. (simplify_transformation_to_scalar): Likewise. (simplify_transformation_to_array): Likewise. (gfc_simplify_dot_product): Likewise. (simplify_bound): Likewise. (simplify_matmul): Likewise. (simplify_minval_maxval): Likewise. (gfc_simplify_pack): Likewise. (gfc_simplify_reshape): Likewise. (gfc_simplify_shape): Likewise. (gfc_simplify_spread): Likewise. (gfc_simplify_transpose): Likewise. (gfc_simplify_unpack): Likewise.q (gfc_convert_constant): Likewise. (gfc_convert_char_constant): Likewise. * target-memory.c (size_array): Likewise. (encode_array): Likewise. (encode_derived): Likewise. (interpret_array): Likewise. (gfc_interpret_derived): Likewise. (expr_to_char): Likewise. (gfc_merge_initializers): Likewise. * trans-array.c (gfc_get_array_constructor_size): Likewise. (gfc_trans_array_constructor_value): Likewise. (get_array_ctor_strlen): Likewise. (gfc_constant_array_constructor_p): Likewise. (gfc_build_constant_array_constructor): Likewise. (gfc_trans_array_constructor): Likewise. (gfc_conv_array_initializer): Likewise. * trans-decl.c (check_constant_initializer): Likewise. * trans-expr.c (flatten_array_ctors_without_strlen): Likewise. (gfc_apply_interface_mapping_to_cons): Likewise. (gfc_trans_structure_assign): Likewise. (gfc_conv_structure): Likewise. * array.c (check_duplicate_iterator): Likewise. (match_array_list): Likewise. (match_array_cons_element): Likewise. (gfc_match_array_constructor): Likewise. (check_constructor_type): Likewise. (check_constructor): Likewise. (expand): Likewise. (expand_constructor): Likewise. (extract_element): Likewise. (gfc_expanded_ac): Likewise. (resolve_array_list): Likewise. (gfc_resolve_character_array_constructor): Likewise. (copy_iterator): Renamed to ... (gfc_copy_iterator): ... this. (gfc_append_constructor): Removed. (gfc_insert_constructor): Removed unused function. (gfc_get_constructor): Removed. (gfc_free_constructor): Removed. (qgfc_copy_constructor): Removed. * gfortran.h (struct gfc_expr): Removed member 'con_by_offset'. Removed all references. Replaced constructor list by splay-tree. (struct gfc_constructor): Removed member 'next', moved 'offset' from the inner struct, added member 'base'. (gfc_append_constructor): Removed prototype. (gfc_insert_constructor): Removed prototype. (gfc_get_constructor): Removed prototype. (gfc_free_constructor): Removed prototype. (qgfc_copy_constructor): Removed prototype. (gfc_copy_iterator): New prototype. * trans-array.h (gfc_constant_array_constructor_p): Adjusted prototype. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158253 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 3668df4a396..a95134cb59d 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1643,6 +1643,8 @@ gfc_class_esym_list; #define GFC_RND_MODE GMP_RNDN #define GFC_MPC_RND_MODE MPC_RNDNN +typedef splay_tree gfc_constructor_base; + typedef struct gfc_expr { expr_t expr_type; @@ -1674,9 +1676,6 @@ typedef struct gfc_expr a function call in interface.c(gfc_extend_expr). */ unsigned int user_operator : 1; - /* Used to quickly find a given constructor by its offset. */ - splay_tree con_by_offset; - /* If an expression comes from a Hollerith constant or compile-time evaluation of a transfer statement, it may have a prescribed target- memory representation, and these cannot always be backformed from @@ -1745,7 +1744,7 @@ typedef struct gfc_expr } character; - struct gfc_constructor *constructor; + gfc_constructor_base constructor; } value; @@ -2182,19 +2181,21 @@ extern gfc_option_t gfc_option; /* Constructor nodes for array and structure constructors. */ typedef struct gfc_constructor { + gfc_constructor_base base; + mpz_t offset; /* Offset within a constructor, used as + key within base. */ + gfc_expr *expr; gfc_iterator *iterator; locus where; - struct gfc_constructor *next; - struct + + union { - mpz_t offset; /* Record the offset of array element which appears in - data statement like "data a(5)/4/". */ - gfc_component *component; /* Record the component being initialized. */ + gfc_component *component; /* Record the component being initialized. */ } n; mpz_t repeat; /* Record the repeat number of initial values in data - statement like "data a/5*10/". */ + statement like "data a/5*10/". */ } gfc_constructor; @@ -2610,10 +2611,18 @@ gfc_try gfc_simplify_expr (gfc_expr *, int); int gfc_has_vector_index (gfc_expr *); gfc_expr *gfc_get_expr (void); +gfc_expr *gfc_get_array_expr (bt type, int kind, locus *); +gfc_expr *gfc_get_null_expr (locus *); +gfc_expr *gfc_get_operator_expr (locus *, gfc_intrinsic_op,gfc_expr *, gfc_expr *); +gfc_expr *gfc_get_structure_constructor_expr (bt, int, locus *); +gfc_expr *gfc_get_constant_expr (bt, int, locus *); +gfc_expr *gfc_get_character_expr (int, locus *, const char *, int len); +gfc_expr *gfc_get_int_expr (int, locus *, int); +gfc_expr *gfc_get_logical_expr (int, locus *, bool); +gfc_expr *gfc_get_iokind_expr (locus *, io_kind); + void gfc_free_expr (gfc_expr *); void gfc_replace_expr (gfc_expr *, gfc_expr *); -gfc_expr *gfc_int_expr (int); -gfc_expr *gfc_logical_expr (int, locus *); mpz_t *gfc_copy_shape (mpz_t *, int); mpz_t *gfc_copy_shape_excluding (mpz_t *, int, gfc_expr *); gfc_expr *gfc_copy_expr (gfc_expr *); @@ -2677,6 +2686,8 @@ bool gfc_type_is_extensible (gfc_symbol *sym); /* array.c */ +gfc_iterator *gfc_copy_iterator (gfc_iterator *); + void gfc_free_array_spec (gfc_array_spec *); gfc_array_ref *gfc_copy_array_ref (gfc_array_ref *); @@ -2686,9 +2697,6 @@ gfc_try gfc_resolve_array_spec (gfc_array_spec *, int); int gfc_compare_array_spec (gfc_array_spec *, gfc_array_spec *); -gfc_expr *gfc_start_constructor (bt, int, locus *); -void gfc_append_constructor (gfc_expr *, gfc_expr *); -void gfc_free_constructor (gfc_constructor *); void gfc_simplify_iterator_var (gfc_expr *); gfc_try gfc_expand_constructor (gfc_expr *); int gfc_constant_ac (gfc_expr *); @@ -2698,14 +2706,10 @@ gfc_try gfc_resolve_array_constructor (gfc_expr *); gfc_try gfc_check_constructor_type (gfc_expr *); gfc_try gfc_check_iter_variable (gfc_expr *); gfc_try gfc_check_constructor (gfc_expr *, gfc_try (*)(gfc_expr *)); -gfc_constructor *gfc_copy_constructor (gfc_constructor *); -gfc_expr *gfc_get_array_element (gfc_expr *, int); gfc_try gfc_array_size (gfc_expr *, mpz_t *); gfc_try gfc_array_dimen_size (gfc_expr *, int, mpz_t *); gfc_try gfc_array_ref_shape (gfc_array_ref *, mpz_t *); gfc_array_ref *gfc_find_array_ref (gfc_expr *); -void gfc_insert_constructor (gfc_expr *, gfc_constructor *); -gfc_constructor *gfc_get_constructor (void); tree gfc_conv_array_initializer (tree type, gfc_expr *); gfc_try spec_size (gfc_array_spec *, mpz_t *); gfc_try spec_dimen_size (gfc_array_spec *, int, mpz_t *); -- cgit v1.2.1 From a250d5604c330534faa5c2c410c33db5d8253768 Mon Sep 17 00:00:00 2001 From: burnus Date: Wed, 14 Apr 2010 05:43:30 +0000 Subject: 2010-04-14 Tobias Burnus PR fortran/18918 * array.c (gfc_find_array_ref): Handle codimensions. (gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error. * check.c (is_coarray, dim_corank_check, gfc_check_lcobound, gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound): New functions. * gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX, GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE, GFC_ISYM_UCOBOUND. * intrinsic.h (add_functions): Add this_image, image_index, lcobound and ucobound intrinsics. * intrinsic.c (gfc_check_lcobound,gfc_check_ucobound, gfc_check_image_index, gfc_check_this_image, gfc_simplify_image_index, gfc_simplify_lcobound, gfc_simplify_this_image, gfc_simplify_ucobound): New function prototypes. * intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE IMAGE_INDEX): Document new intrinsic functions. * match.c (gfc_match_critical, sync_statement): Make * -fcoarray=none error fatal. * simplify.c (simplify_bound_dim): Handle coarrays. (simplify_bound): Update simplify_bound_dim call. (gfc_simplify_num_images): Add -fcoarray=none check. (simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound, gfc_simplify_ucobound, gfc_simplify_ucobound): New functions. 2010-04-14 Tobias Burnus PR fortran/18918 * gfortran.dg/coarray_9.f90: Update dg-errors. * gfortran.dg/coarray_10.f90: New test. * gfortran.dg/coarray_11.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158292 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index a95134cb59d..48e80f637ee 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -404,6 +404,7 @@ enum gfc_isym_id GFC_ISYM_IDATE, GFC_ISYM_IEOR, GFC_ISYM_IERRNO, + GFC_ISYM_IMAGE_INDEX, GFC_ISYM_INDEX, GFC_ISYM_INT, GFC_ISYM_INT2, @@ -423,6 +424,7 @@ enum gfc_isym_id GFC_ISYM_KILL, GFC_ISYM_KIND, GFC_ISYM_LBOUND, + GFC_ISYM_LCOBOUND, GFC_ISYM_LEADZ, GFC_ISYM_LEN, GFC_ISYM_LEN_TRIM, @@ -509,6 +511,7 @@ enum gfc_isym_id GFC_ISYM_SYSTEM_CLOCK, GFC_ISYM_TAN, GFC_ISYM_TANH, + GFC_ISYM_THIS_IMAGE, GFC_ISYM_TIME, GFC_ISYM_TIME8, GFC_ISYM_TINY, @@ -518,6 +521,7 @@ enum gfc_isym_id GFC_ISYM_TRIM, GFC_ISYM_TTYNAM, GFC_ISYM_UBOUND, + GFC_ISYM_UCOBOUND, GFC_ISYM_UMASK, GFC_ISYM_UNLINK, GFC_ISYM_UNPACK, -- cgit v1.2.1 From 09c509edcc2f6e6859f02de43ce0fe10a941a8d7 Mon Sep 17 00:00:00 2001 From: pault Date: Thu, 29 Apr 2010 19:10:48 +0000 Subject: 2010-04-29 Janus Weil PR fortran/43896 * symbol.c (add_proc_component,copy_vtab_proc_comps): Remove initializers for PPC members of the vtabs. 2010-04-29 Janus Weil PR fortran/42274 * symbol.c (add_proc_component,add_proc_comps): Correctly set the 'ppc' attribute for all PPC members of the vtypes. (copy_vtab_proc_comps): Copy the correct interface. * trans.h (gfc_trans_assign_vtab_procs): Modified prototype. * trans-expr.c (gfc_trans_assign_vtab_procs): Pass the derived type as a dummy argument and make sure all PPC members of the vtab are initialized correctly. (gfc_conv_derived_to_class,gfc_trans_class_assign): Additional argument in call to gfc_trans_assign_vtab_procs. * trans-stmt.c (gfc_trans_allocate): Ditto. 2010-04-29 Paul Thomas PR fortran/43326 * resolve.c (resolve_typebound_function): Renamed resolve_class_compcall.Do all the detection of class references here. (resolve_typebound_subroutine): resolve_class_typebound_call renamed. Otherwise same as resolve_typebound_function. (gfc_resolve_expr): Call resolve_typebound_function. (resolve_code): Call resolve_typebound_subroutine. 2010-04-29 Janus Weil PR fortran/43492 * resolve.c (resolve_typebound_generic_call): For CLASS methods pass back the specific symtree name, rather than the target name. 2010-04-29 Paul Thomas PR fortran/42353 * resolve.c (resolve_structure_cons): Make the initializer of the vtab component 'extends' the same type as the component. 2010-04-29 Jerry DeLisle PR fortran/42680 * interface.c (check_interface1): Pass symbol name rather than NULL to gfc_compare_interfaces.(gfc_compare_interfaces): Add assert to trap MULL. (gfc_compare_derived_types): Revert previous change incorporated incorrectly during merge from trunk, r155778. * resolve.c (check_generic_tbp_ambiguity): Pass symbol name rather than NULL to gfc_compare_interfaces. * symbol.c (add_generic_specifics): Likewise. 2010-02-29 Janus Weil PR fortran/42353 * interface.c (gfc_compare_derived_types): Add condition for vtype. * symbol.c (gfc_find_derived_vtab): Sey access to private. (gfc_find_derived_vtab): Likewise. * module.c (ab_attribute): Add enumerator AB_VTAB. (mio_symbol_attribute): Use new attribute, AB_VTAB. (check_for_ambiguous): Likewise. 2010-04-29 Paul Thomas Janus Weil PR fortran/41829 * trans-expr.c (select_class_proc): Remove function. (conv_function_val): Delete reference to previous. (gfc_conv_derived_to_class): Add second argument to the call to gfc_find_derived_vtab. (gfc_conv_structure): Exclude proc_pointer components when accessing $data field of class objects. (gfc_trans_assign_vtab_procs): New function. (gfc_trans_class_assign): Add second argument to the call to gfc_find_derived_vtab. * symbol.c (gfc_build_class_symbol): Add delayed_vtab arg and implement holding off searching for the vptr derived type. (add_proc_component): New function. (add_proc_comps): New function. (add_procs_to_declared_vtab1): New function. (copy_vtab_proc_comps): New function. (add_procs_to_declared_vtab): New function. (void add_generic_specifics): New function. (add_generics_to_declared_vtab): New function. (gfc_find_derived_vtab): Add second argument to the call to gfc_find_derived_vtab. Add the calls to add_procs_to_declared_vtab and add_generics_to_declared_vtab. * decl.c (build_sym, build_struct): Use new arg in calls to gfc_build_class_symbol. * gfortran.h : Add vtype bitfield to symbol_attr. Remove the definition of struct gfc_class_esym_list. Modify prototypes of gfc_build_class_symbol and gfc_find_derived_vtab. * trans-stmt.c (gfc_trans_allocate): Add second argument to the call to gfc_find_derived_vtab. * module.c : Add the vtype attribute. * trans.h : Add prototype for gfc_trans_assign_vtab_procs. * resolve.c (resolve_typebound_generic_call): Add second arg to pass along the generic name for class methods. (resolve_typebound_call): The same. (resolve_compcall): Use the second arg to carry the generic name from the above. Remove the reference to class_esym. (check_members, check_class_members, resolve_class_esym, hash_value_expr): Remove functions. (resolve_class_compcall, resolve_class_typebound_call): Modify to use vtable rather than member by member calls. (gfc_resolve_expr): Modify second arg in call to resolve_compcall. (resolve_select_type): Add second arg in call to gfc_find_derived_vtab. (resolve_code): Add second arg in call resolve_typebound_call. (resolve_fl_derived): Exclude vtypes from check for late procedure definitions. Likewise for checking of explicit interface and checking of pass arg. * iresolve.c (gfc_resolve_extends_type_of): Add second arg in calls to gfc_find_derived_vtab. * match.c (select_type_set_tmp): Use new arg in call to gfc_build_class_symbol. * trans-decl.c (gfc_get_symbol_decl): Complete vtable if necessary. * parse.c (endType): Finish incomplete classes. 2010-04-29 Janus Weil PR fortran/42274 * gfortran.dg/class_16.f03: New test. 2010-04-29 Janus Weil PR fortran/42274 * gfortran.dg/class_15.f03: New. 2010-04-29 Paul Thomas PR fortran/43326 * gfortran.dg/dynamic_dispatch_9.f03: New test. 2010-04-29 Janus Weil PR fortran/43492 * gfortran.dg/generic_22.f03 : New test. 2010-04-29 Paul Thomas PR fortran/42353 * gfortran.dg/class_14.f03: New test. 2010-04-29 Jerry DeLisle PR fortran/42680 * gfortran.dg/interface_32.f90: New test. 2009-04-29 Paul Thomas Janus Weil PR fortran/41829 * gfortran.dg/dynamic_dispatch_5.f03 : Change to "run". * gfortran.dg/dynamic_dispatch_7.f03 : New test. * gfortran.dg/dynamic_dispatch_8.f03 : New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158910 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 48e80f637ee..11ce974b7b8 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -691,7 +691,8 @@ typedef struct unsigned extension:8; /* extension level of a derived type. */ unsigned is_class:1; /* is a CLASS container. */ unsigned class_ok:1; /* is a CLASS object with correct attributes. */ - unsigned vtab:1; /* is a derived type vtab. */ + unsigned vtab:1; /* is a derived type vtab, pointed to by CLASS objects. */ + unsigned vtype:1; /* is a derived type of a vtab. */ /* These flags are both in the typespec and attribute. The attribute list is what gets read from/written to a module file. The typespec @@ -1615,17 +1616,6 @@ typedef struct gfc_intrinsic_sym gfc_intrinsic_sym; -typedef struct gfc_class_esym_list -{ - gfc_symbol *derived; - gfc_symbol *esym; - struct gfc_expr *hash_value; - struct gfc_class_esym_list *next; -} -gfc_class_esym_list; - -#define gfc_get_class_esym_list() XCNEW (gfc_class_esym_list) - /* Expression nodes. The expression node types deserve explanations, since the last couple can be easily misconstrued: @@ -1717,7 +1707,6 @@ typedef struct gfc_expr const char *name; /* Points to the ultimate name of the function */ gfc_intrinsic_sym *isym; gfc_symbol *esym; - gfc_class_esym_list *class_esym; } function; @@ -2526,8 +2515,8 @@ gfc_gsymbol *gfc_get_gsymbol (const char *); gfc_gsymbol *gfc_find_gsymbol (gfc_gsymbol *, const char *); gfc_try gfc_build_class_symbol (gfc_typespec *, symbol_attribute *, - gfc_array_spec **); -gfc_symbol *gfc_find_derived_vtab (gfc_symbol *); + gfc_array_spec **, bool); +gfc_symbol *gfc_find_derived_vtab (gfc_symbol *, bool); gfc_typebound_proc* gfc_get_typebound_proc (void); gfc_symbol* gfc_get_derived_super_type (gfc_symbol*); gfc_symbol* gfc_get_ultimate_derived_super_type (gfc_symbol*); -- cgit v1.2.1 From 53ee584785ce94d834c0679ed8a6abb6a7c89e99 Mon Sep 17 00:00:00 2001 From: dfranke Date: Wed, 5 May 2010 18:53:23 +0000 Subject: gcc/fortran/: 2010-05-05 Daniel Franke PR fortran/24978 * gfortran.h: Removed repeat count from constructor, removed all usages. * data.h (gfc_assign_data_value_range): Changed return value from void to gfc_try. * data.c (gfc_assign_data_value): Add location to constructor element. (gfc_assign_data_value_range): Call gfc_assign_data_value() for each element in range. Return early if an error was generated. * resolve.c (check_data_variable): Stop early if range assignment generated an error. gcc/testsuite/: 2010-05-05 Daniel Franke PR fortran/24978 * gfortran.dg/data_invalid.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159076 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 11ce974b7b8..827a13f4dc2 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2187,8 +2187,6 @@ typedef struct gfc_constructor gfc_component *component; /* Record the component being initialized. */ } n; - mpz_t repeat; /* Record the repeat number of initial values in data - statement like "data a/5*10/". */ } gfc_constructor; -- cgit v1.2.1 From 1f3db819ff589fec50544ce334ae0200afade36f Mon Sep 17 00:00:00 2001 From: manu Date: Thu, 6 May 2010 10:12:36 +0000 Subject: =?UTF-8?q?2010-05-06=20=20Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez=20?= =?UTF-8?q?=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR 40989 * doc/invoke.texi (Wimplicit): Document as C only. * opts.c (common_handle_option): Add argument kind. (handle_option): Rename as read_cmdline_option. Factor out code to... (handle_option): ... here. New. (handle_options): Rename as read_cmdline_options. (decode_options): Update call. (set_option): Use option index instead of option pointer. Classify diagnostics correctly. (enable_warning_as_error): Call handle_option. * opts.h (set_option): Update declaration. (handle_option): Declare. * langhooks.h (struct lang_hooks): Add argument kind to handle_option. * c.opt (Wimplicit,Wimplicit-int): Initialize to -1. * c-opts.c (set_Wimplicit): Delete. (c_family_lang_mask): New static constant. (c_common_handle_option): Add argument kind. Use handle_option instead of set_Wimplicit. (c_common_post_options): warn_implicit and warn_implicit_int are disabled by default. * c-common.c (warn_implicit): Do not define here. * c-common.h (warn_implicit): Do not declare here. (c_common_handle_option): Update declaration. * lto-opts.c (lto_reissue_options): Update call to set_option. java/ * lang.c (java_handle_option): Add argument kind. fortran/ * options.c (gfc_handle_option): Add argument kind. * gfortran.h (gfc_handle_option): Update declaration. ada/ * gcc-interface/misc.c (gnat_handle_option): Add argument kind. testsuite/ * gcc.dg/pr40989.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159102 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 827a13f4dc2..580ba3589ab 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2310,7 +2310,7 @@ int get_c_kind (const char *, CInteropKind_t *); /* options.c */ unsigned int gfc_init_options (unsigned int, const char **); -int gfc_handle_option (size_t, const char *, int); +int gfc_handle_option (size_t, const char *, int, int); bool gfc_post_options (const char **); /* f95-lang.c */ -- cgit v1.2.1 From 148aaa7fa6884e257d205df009ea315b6b521c9c Mon Sep 17 00:00:00 2001 From: dfranke Date: Thu, 13 May 2010 14:08:05 +0000 Subject: gcc/fortran/: 2010-05-13 Daniel Franke PR fortran/35779 * intrinsic.c (gfc_init_expr): Renamed to gfc_init_expr_flag. Updated all usages. * expr.c (init_flag): Removed; use gfc_init_expr_flag everywhere. * array.c (match_array_list): Pass on gfc_init_expr_flag when matching iterators. gcc/testsuite/: 2010-05-13 Daniel Franke PR fortran/35779 * gfortran.dg/initialization_25.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159366 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 580ba3589ab..91c8b80ba64 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2537,8 +2537,8 @@ void gfc_free_finalizer (gfc_finalizer *el); /* Needed in resolve.c, too */ gfc_try gfc_check_symbol_typed (gfc_symbol*, gfc_namespace*, bool, locus); -/* intrinsic.c */ -extern int gfc_init_expr; +/* intrinsic.c -- true if working in an init-expr, false otherwise. */ +extern bool gfc_init_expr_flag; /* Given a symbol that we have decided is intrinsic, mark it as such by placing it into a special module that is otherwise impossible to -- cgit v1.2.1 From bcc41e511c80b8b8aa549a438ffcac69481db979 Mon Sep 17 00:00:00 2001 From: janus Date: Sat, 15 May 2010 13:52:33 +0000 Subject: 2010-05-15 Janus Weil PR fortran/43207 PR fortran/43969 * gfortran.h (gfc_class_null_initializer): New prototype. * expr.c (gfc_class_null_initializer): New function to build a NULL initializer for CLASS pointers. * symbol.c (gfc_build_class_symbol): Modify internal naming of class containers. Remove default NULL initialization of $data component. * trans.c (gfc_allocate_array_with_status): Fix wording of an error message. * trans-expr.c (gfc_conv_initializer,gfc_trans_subcomponent_assign): Use new function 'gfc_class_null_initializer'. * trans-intrinsic.c (gfc_conv_allocated): Handle allocatable scalar class variables. 2010-05-15 Janus Weil PR fortran/43207 PR fortran/43969 * gfortran.dg/class_18.f03: New. * gfortran.dg/class_19.f03: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159431 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 91c8b80ba64..96acaa4574e 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2630,6 +2630,7 @@ gfc_try gfc_check_pointer_assign (gfc_expr *, gfc_expr *); gfc_try gfc_check_assign_symbol (gfc_symbol *, gfc_expr *); gfc_expr *gfc_default_initializer (gfc_typespec *); +gfc_expr *gfc_class_null_initializer (gfc_typespec *); gfc_expr *gfc_get_variable_expr (gfc_symtree *); gfc_array_spec *gfc_get_full_arrayspec_from_expr (gfc_expr *expr); -- cgit v1.2.1 From b823b0c64afba9f22c659014d67843f440f886db Mon Sep 17 00:00:00 2001 From: janus Date: Mon, 17 May 2010 18:45:32 +0000 Subject: 2010-05-17 Janus Weil * class.c (gfc_add_component_ref,gfc_class_null_initializer, gfc_build_class_symbol,add_proc_component,add_proc_comps, add_procs_to_declared_vtab1,copy_vtab_proc_comps, add_procs_to_declared_vtab,add_generic_specifics, add_generics_to_declared_vtab,gfc_find_derived_vtab, find_typebound_proc_uop,gfc_find_typebound_proc, gfc_find_typebound_user_op,gfc_find_typebound_intrinsic_op, gfc_get_tbp_symtree): Moved here from other places. * expr.c (gfc_add_component_ref,gfc_class_null_initializer): Move to class.c. * gfortran.h (gfc_build_class_symbol,gfc_find_derived_vtab, gfc_find_typebound_proc,gfc_find_typebound_user_op, gfc_find_typebound_intrinsic_op,gfc_get_tbp_symtree, gfc_add_component_ref, gfc_class_null_initializer): Moved to class.c. * Make-lang.in: Add class.o. * symbol.c (gfc_build_class_symbol,add_proc_component,add_proc_comps, add_procs_to_declared_vtab1,copy_vtab_proc_comps, add_procs_to_declared_vtab,add_generic_specifics, add_generics_to_declared_vtab,gfc_find_derived_vtab, find_typebound_proc_uop,gfc_find_typebound_proc, gfc_find_typebound_user_op,gfc_find_typebound_intrinsic_op, gfc_get_tbp_symtree): Move to class.c. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159506 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 96acaa4574e..c14bcce9423 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2512,22 +2512,11 @@ void gfc_free_dt_list (void); gfc_gsymbol *gfc_get_gsymbol (const char *); gfc_gsymbol *gfc_find_gsymbol (gfc_gsymbol *, const char *); -gfc_try gfc_build_class_symbol (gfc_typespec *, symbol_attribute *, - gfc_array_spec **, bool); -gfc_symbol *gfc_find_derived_vtab (gfc_symbol *, bool); gfc_typebound_proc* gfc_get_typebound_proc (void); gfc_symbol* gfc_get_derived_super_type (gfc_symbol*); gfc_symbol* gfc_get_ultimate_derived_super_type (gfc_symbol*); bool gfc_type_is_extension_of (gfc_symbol *, gfc_symbol *); bool gfc_type_compatible (gfc_typespec *, gfc_typespec *); -gfc_symtree* gfc_find_typebound_proc (gfc_symbol*, gfc_try*, - const char*, bool, locus*); -gfc_symtree* gfc_find_typebound_user_op (gfc_symbol*, gfc_try*, - const char*, bool, locus*); -gfc_typebound_proc* gfc_find_typebound_intrinsic_op (gfc_symbol*, gfc_try*, - gfc_intrinsic_op, bool, - locus*); -gfc_symtree* gfc_get_tbp_symtree (gfc_symtree**, const char*); void gfc_copy_formal_args (gfc_symbol *, gfc_symbol *); void gfc_copy_formal_args_intr (gfc_symbol *, gfc_intrinsic_sym *); @@ -2593,7 +2582,6 @@ gfc_actual_arglist *gfc_copy_actual_arglist (gfc_actual_arglist *); const char *gfc_extract_int (gfc_expr *, int *); bool is_subref_array (gfc_expr *); -void gfc_add_component_ref (gfc_expr *, const char *); gfc_expr *gfc_build_conversion (gfc_expr *); void gfc_free_ref_list (gfc_ref *); void gfc_type_convert_binary (gfc_expr *, int); @@ -2630,7 +2618,6 @@ gfc_try gfc_check_pointer_assign (gfc_expr *, gfc_expr *); gfc_try gfc_check_assign_symbol (gfc_symbol *, gfc_expr *); gfc_expr *gfc_default_initializer (gfc_typespec *); -gfc_expr *gfc_class_null_initializer (gfc_typespec *); gfc_expr *gfc_get_variable_expr (gfc_symtree *); gfc_array_spec *gfc_get_full_arrayspec_from_expr (gfc_expr *expr); @@ -2785,4 +2772,19 @@ int gfc_is_data_pointer (gfc_expr *); /* check.c */ gfc_try gfc_check_same_strlen (const gfc_expr*, const gfc_expr*, const char*); +/* class.c */ +void gfc_add_component_ref (gfc_expr *, const char *); +gfc_expr *gfc_class_null_initializer (gfc_typespec *); +gfc_try gfc_build_class_symbol (gfc_typespec *, symbol_attribute *, + gfc_array_spec **, bool); +gfc_symbol *gfc_find_derived_vtab (gfc_symbol *, bool); +gfc_symtree* gfc_find_typebound_proc (gfc_symbol*, gfc_try*, + const char*, bool, locus*); +gfc_symtree* gfc_find_typebound_user_op (gfc_symbol*, gfc_try*, + const char*, bool, locus*); +gfc_typebound_proc* gfc_find_typebound_intrinsic_op (gfc_symbol*, gfc_try*, + gfc_intrinsic_op, bool, + locus*); +gfc_symtree* gfc_get_tbp_symtree (gfc_symtree**, const char*); + #endif /* GCC_GFORTRAN_H */ -- cgit v1.2.1 From 0826251092361171d72575cd36d4578e22cf9e9e Mon Sep 17 00:00:00 2001 From: dfranke Date: Wed, 19 May 2010 13:07:25 +0000 Subject: gcc/fortran/: 2010-05-19 Daniel Franke PR fortran/42360 * gfortran.h (gfc_has_default_initializer): New. * expr.c (gfc_has_default_initializer): New. * resolve.c (has_default_initializer): Removed, use gfc_has_default_initializer() instead. Updated all callers. * trans-array.c (has_default_initializer): Removed, use gfc_has_default_initializer() instead. Updated all callers. * trans-decl.c (generate_local_decl): Do not check the first component only to check for initializers, but use gfc_has_default_initializer() instead. gcc/testsuite/: 2010-05-19 Daniel Franke PR fortran/42360 * gfortran.dg/warn_intent_out_not_set.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159562 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index c14bcce9423..903f05ca9d8 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2617,6 +2617,7 @@ gfc_try gfc_check_assign (gfc_expr *, gfc_expr *, int); gfc_try gfc_check_pointer_assign (gfc_expr *, gfc_expr *); gfc_try gfc_check_assign_symbol (gfc_symbol *, gfc_expr *); +bool gfc_has_default_initializer (gfc_symbol *); gfc_expr *gfc_default_initializer (gfc_typespec *); gfc_expr *gfc_get_variable_expr (gfc_symtree *); -- cgit v1.2.1 From 721f64bf120bb5e0466594a695fd7b475ceefeb7 Mon Sep 17 00:00:00 2001 From: dfranke Date: Wed, 19 May 2010 16:35:34 +0000 Subject: gcc/fortran/: 2010-05-19 Daniel Franke PR fortran/44055 * lang.opt (Wconversion-extra): New option. * gfortran.h (gfc_option_t): Add warn_conversion_extra. * options.c (gfc_init_options): Disable -Wconversion-extra by default. (set_Wall): Enable -Wconversion. (gfc_handle_option): Set warn_conversion_extra. * intrinsic.c (gfc_convert_type_warn): Ignore kind conditions introduced for -Wconversion if -Wconversion-extra is present. * invoke.texi: Add -Wconversion to -Wall; document new behaviour of -Wconversion; document -Wconversion-extra. gcc/testsuite/: 2010-05-19 Daniel Franke PR fortran/44055 * gfortran.dg/c_sizeof_2.f90: Add -Wno-conversion to dg-options; Fixed scope of C_SIZEOF. * gfortran.dg/warn_conversion_2.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159586 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 903f05ca9d8..15f2728f228 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2105,6 +2105,7 @@ typedef struct int warn_aliasing; int warn_ampersand; int warn_conversion; + int warn_conversion_extra; int warn_implicit_interface; int warn_implicit_procedure; int warn_line_truncation; -- cgit v1.2.1 From 4acad347aaba2c76346dfd1de7f34fb2056a15e2 Mon Sep 17 00:00:00 2001 From: dfranke Date: Thu, 20 May 2010 21:49:07 +0000 Subject: gcc/fortran/: 2010-05-20 Daniel Franke PR fortran/38407 * lang.opt (Wunused-dummy-argument): New option. * gfortran.h (gfc_option_t): Add warn_unused_dummy_argument. * options.c (gfc_init_options): Disable warn_unused_dummy_argument. (set_Wall): Enable warn_unused_dummy_argument. (gfc_handle_option): Set warn_unused_dummy_argument according to command line. * trans-decl.c (generate_local_decl): Separate warnings about unused variables and unused dummy arguments. * invoke.texi: Documented new option. gcc/testsuite/: 2010-05-20 Daniel Franke PR fortran/38407 * warn_unused_dummy_argument_1.f90: New. * warn_unused_dummy_argument_2.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159641 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 15f2728f228..ec334c5a13f 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2117,6 +2117,7 @@ typedef struct int warn_character_truncation; int warn_array_temp; int warn_align_commons; + int warn_unused_dummy_argument; int max_errors; int flag_all_intrinsics; -- cgit v1.2.1 From dca58d219480ce3c10fbc7442128ece6cc724d8f Mon Sep 17 00:00:00 2001 From: burnus Date: Sun, 23 May 2010 17:18:24 +0000 Subject: 2010-05-21 Tobias Burnus * gfortran.h: Do not include system.h. * bbt.c: Include system.h. * data.c: Ditto. * dependency.c: Ditto. * dump-parse-tree.c: Ditto. * arith.h: Do not include gfortran.h. * constructor.h: Do not include gfortran.h and splay-tree.h. * match.h: Do not include gfortran.h. * parse.h: Ditto. * target-memory.h: Ditto. * openmp.c: Do not include toplev.h and target.h. * trans-stmt.c: Ditto not include toplev.h. * primary.c: Ditto. * trans-common.c: Tell why toplev.h is needed. And do not include target.h. * trans-expr.c: Tell why toplev.h is needed. * trans-array.c: Ditto. * trans-openmp.c: Ditto. * trans-const.c: Ditto. * trans.c: Ditto. * trans-types.c: Ditto. * trans-io.c: Ditto. * trans-decl.c: Ditto. * scanner.c: Ditto. * convert.c: Ditto. * trans-intrinsic.c: Ditto. * options.c: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159763 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 1 - 1 file changed, 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index ec334c5a13f..0ffcfae9a55 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -34,7 +34,6 @@ along with GCC; see the file COPYING3. If not see #include "libgfortran.h" -#include "system.h" #include "intl.h" #include "coretypes.h" #include "input.h" -- cgit v1.2.1 From 50b4b37ba4128b5e02d6b8af5f872770063c1d2b Mon Sep 17 00:00:00 2001 From: janus Date: Sun, 30 May 2010 21:56:11 +0000 Subject: 2010-05-30 Janus Weil * gcc/fortran/gfortran.h (CLASS_DATA): New macro for accessing the $data component of a class container. * gcc/fortran/decl.c (attr_decl1): Use macro CLASS_DATA. * gcc/fortran/expr.c (gfc_check_pointer_assign,gfc_check_assign_symbol, gfc_has_ultimate_allocatable,gfc_has_ultimate_pointer): Ditto. * gcc/fortran/interface.c (matching_typebound_op): Ditto. * gcc/fortran/match.c (gfc_match_allocate, gfc_match_deallocate): Ditto. * gcc/fortran/parse.c (parse_derived): Ditto. * gcc/fortran/primary.c (gfc_match_varspec, gfc_variable_attr, gfc_expr_attr): Ditto. * gcc/fortran/resolve.c (resolve_structure_cons, find_array_spec, resolve_deallocate_expr, resolve_allocate_expr, resolve_select_type, resolve_fl_var_and_proc, resolve_typebound_procedure, resolve_fl_derived): Ditto. * gcc/fortran/symbol.c (gfc_type_compatible): Restructured. * gcc/fortran/trans-array.c (structure_alloc_comps): Use macro CLASS_DATA. * gcc/fortran/trans-decl.c (gfc_get_symbol_decl, gfc_trans_deferred_vars): Ditto. * gcc/fortran/trans-stmt.c (gfc_trans_allocate): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160060 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 0ffcfae9a55..9762cddfaa8 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2789,4 +2789,6 @@ gfc_typebound_proc* gfc_find_typebound_intrinsic_op (gfc_symbol*, gfc_try*, locus*); gfc_symtree* gfc_get_tbp_symtree (gfc_symtree**, const char*); +#define CLASS_DATA(sym) sym->ts.u.derived->components + #endif /* GCC_GFORTRAN_H */ -- cgit v1.2.1 From d18a512a42d8072efb8b9f2bb82ea97536b4cea3 Mon Sep 17 00:00:00 2001 From: domob Date: Thu, 10 Jun 2010 14:47:49 +0000 Subject: 2010-06-10 Daniel Kraft PR fortran/38936 * gfortran.h (enum gfc_statement): Add ST_ASSOCIATE, ST_END_ASSOCIATE. (struct gfc_symbol): New field `assoc'. (struct gfc_association_list): New struct. (struct gfc_code): New struct `block' in union, move `ns' there and add association list. (gfc_free_association_list): New method. (gfc_has_vector_subscript): Made public; * match.h (gfc_match_associate): New method. * parse.h (enum gfc_compile_state): Add COMP_ASSOCIATE. * decl.c (gfc_match_end): Handle ST_END_ASSOCIATE. * interface.c (gfc_has_vector_subscript): Made public. (compare_actual_formal): Rename `has_vector_subscript' accordingly. * match.c (gfc_match_associate): New method. (gfc_match_select_type): Change reference to gfc_code's `ns' field. * primary.c (match_variable): Don't allow names associated to expr here. * parse.c (decode_statement): Try matching ASSOCIATE statement. (case_exec_markers, case_end): Add ASSOCIATE statement. (gfc_ascii_statement): Hande ST_ASSOCIATE and ST_END_ASSOCIATE. (parse_associate): New method. (parse_executable): Handle ST_ASSOCIATE. (parse_block_construct): Change reference to gfc_code's `ns' field. * resolve.c (resolve_select_type): Ditto. (resolve_code): Ditto. (resolve_block_construct): Ditto and add comment. (resolve_select_type): Set association list in generated BLOCK to NULL. (resolve_symbol): Resolve associate names. * st.c (gfc_free_statement): Change reference to gfc_code's `ns' field and free association list. (gfc_free_association_list): New method. * symbol.c (gfc_new_symbol): NULL new field `assoc'. * trans-stmt.c (gfc_trans_block_construct): Change reference to gfc_code's `ns' field. 2010-06-10 Daniel Kraft PR fortran/38936 * gfortran.dg/associate_1.f03: New test. * gfortran.dg/associate_2.f95: New test. * gfortran.dg/associate_3.f03: New test. * gfortran.dg/associate_4.f08: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160550 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 9762cddfaa8..2a553d198fa 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -205,11 +205,12 @@ arith; /* Statements. */ typedef enum { - ST_ARITHMETIC_IF, ST_ALLOCATE, ST_ATTR_DECL, ST_BACKSPACE, - ST_BLOCK, ST_BLOCK_DATA, + ST_ARITHMETIC_IF, ST_ALLOCATE, ST_ATTR_DECL, ST_ASSOCIATE, + ST_BACKSPACE, ST_BLOCK, ST_BLOCK_DATA, ST_CALL, ST_CASE, ST_CLOSE, ST_COMMON, ST_CONTINUE, ST_CONTAINS, ST_CYCLE, ST_DATA, ST_DATA_DECL, ST_DEALLOCATE, ST_DO, ST_ELSE, ST_ELSEIF, - ST_ELSEWHERE, ST_END_BLOCK, ST_END_BLOCK_DATA, ST_ENDDO, ST_IMPLIED_ENDDO, + ST_ELSEWHERE, ST_END_ASSOCIATE, ST_END_BLOCK, ST_END_BLOCK_DATA, + ST_ENDDO, ST_IMPLIED_ENDDO, ST_END_FILE, ST_FINAL, ST_FLUSH, ST_END_FORALL, ST_END_FUNCTION, ST_ENDIF, ST_END_INTERFACE, ST_END_MODULE, ST_END_PROGRAM, ST_END_SELECT, ST_END_SUBROUTINE, ST_END_WHERE, ST_END_TYPE, ST_ENTRY, ST_EQUIVALENCE, @@ -1201,6 +1202,9 @@ typedef struct gfc_symbol char binding_label[GFC_MAX_BINDING_LABEL_LEN + 1]; /* Store a reference to the common_block, if this symbol is in one. */ struct gfc_common_head *common_block; + + /* Link to corresponding association-list if this is an associate name. */ + struct gfc_association_list *assoc; } gfc_symbol; @@ -1974,6 +1978,25 @@ typedef struct gfc_forall_iterator gfc_forall_iterator; +/* Linked list to store associations in an ASSOCIATE statement. */ + +typedef struct gfc_association_list +{ + struct gfc_association_list *next; + + /* Whether this is association to a variable that can be changed; otherwise, + it's association to an expression and the name may not be used as + lvalue. */ + unsigned variable:1; + + char name[GFC_MAX_SYMBOL_LEN + 1]; + gfc_symtree *st; /* Symtree corresponding to name. */ + gfc_expr *target; +} +gfc_association_list; +#define gfc_get_association_list() XCNEW (gfc_association_list) + + /* Executable statements that fill gfc_code structures. */ typedef enum { @@ -2026,6 +2049,13 @@ typedef struct gfc_code } alloc; + struct + { + gfc_namespace *ns; + gfc_association_list *assoc; + } + block; + gfc_open *open; gfc_close *close; gfc_filepos *filepos; @@ -2040,7 +2070,6 @@ typedef struct gfc_code const char *omp_name; gfc_namelist *omp_namelist; bool omp_bool; - gfc_namespace *ns; } ext; /* Points to additional structures required by statement */ @@ -2647,6 +2676,7 @@ gfc_code *gfc_get_code (void); gfc_code *gfc_append_code (gfc_code *, gfc_code *); void gfc_free_statement (gfc_code *); void gfc_free_statements (gfc_code *); +void gfc_free_association_list (gfc_association_list *); /* resolve.c */ gfc_try gfc_resolve_expr (gfc_expr *); @@ -2719,6 +2749,7 @@ void gfc_set_current_interface_head (gfc_interface *); gfc_symtree* gfc_find_sym_in_symtree (gfc_symbol*); bool gfc_arglist_matches_symbol (gfc_actual_arglist**, gfc_symbol*); bool gfc_check_operator_interface (gfc_symbol*, gfc_intrinsic_op, locus); +int gfc_has_vector_subscript (gfc_expr*); /* io.c */ extern gfc_st_label format_asterisk; -- cgit v1.2.1 From de6229046ca7a9d04c27f1d5427258d272f8bdbf Mon Sep 17 00:00:00 2001 From: janus Date: Tue, 15 Jun 2010 18:33:58 +0000 Subject: 2010-06-15 Janus Weil PR fortran/43388 * gfortran.h (gfc_expr): Add new member 'mold'. * match.c (gfc_match_allocate): Implement the MOLD tag. * resolve.c (resolve_allocate_expr): Ditto. * trans-stmt.c (gfc_trans_allocate): Ditto. 2010-06-15 Janus Weil PR fortran/43388 * gfortran.dg/allocate_alloc_opt_8.f90: New. * gfortran.dg/allocate_alloc_opt_9.f90: New. * gfortran.dg/allocate_alloc_opt_10.f90: New. * gfortran.dg/class_allocate_2.f03: Modified an error message. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160801 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 2a553d198fa..8867e58d5b8 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1669,10 +1669,13 @@ typedef struct gfc_expr it from recurring. */ unsigned int error : 1; - /* Mark and expression where a user operator has been substituted by + /* Mark an expression where a user operator has been substituted by a function call in interface.c(gfc_extend_expr). */ unsigned int user_operator : 1; + /* Mark an expression as being a MOLD argument of ALLOCATE. */ + unsigned int mold : 1; + /* If an expression comes from a Hollerith constant or compile-time evaluation of a transfer statement, it may have a prescribed target- memory representation, and these cannot always be backformed from -- cgit v1.2.1 From 4a12b9ba04a45f09308052f1b1fcd57c98a1f259 Mon Sep 17 00:00:00 2001 From: janus Date: Wed, 16 Jun 2010 12:54:54 +0000 Subject: 2010-06-16 Janus Weil PR fortran/44549 * gfortran.h (gfc_get_typebound_proc): Modified Prototype. * decl.c (match_procedure_in_type): Give a unique gfc_typebound_proc structure to each procedure in a procedure list. * module.c (mio_typebound_proc): Add NULL argument to 'gfc_get_typebound_proc'. * symbol.c (gfc_get_typebound_proc): Add a new argument, which is used to initialize the new structure. 2010-06-16 Janus Weil PR fortran/44549 * gfortran.dg/typebound_proc_16.f03: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160834 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 8867e58d5b8..d77a6c5fdb9 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2545,7 +2545,7 @@ void gfc_free_dt_list (void); gfc_gsymbol *gfc_get_gsymbol (const char *); gfc_gsymbol *gfc_find_gsymbol (gfc_gsymbol *, const char *); -gfc_typebound_proc* gfc_get_typebound_proc (void); +gfc_typebound_proc* gfc_get_typebound_proc (gfc_typebound_proc*); gfc_symbol* gfc_get_derived_super_type (gfc_symbol*); gfc_symbol* gfc_get_ultimate_derived_super_type (gfc_symbol*); bool gfc_type_is_extension_of (gfc_symbol *, gfc_symbol *); -- cgit v1.2.1 From b3c3927c05d8ad190b76c56ae6020e1650b85a97 Mon Sep 17 00:00:00 2001 From: burnus Date: Mon, 21 Jun 2010 14:15:56 +0000 Subject: 2010-06-20 Tobias Burnus PR fortran/40632 * interface.c (compare_parameter): Add gfc_is_simply_contiguous checks. * symbol.c (gfc_add_contiguous): New function. (gfc_copy_attr, check_conflict): Handle contiguous attribute. * decl.c (match_attr_spec): Ditto. (gfc_match_contiguous): New function. * resolve.c (resolve_fl_derived, resolve_symbol): Handle contiguous. * gfortran.h (symbol_attribute): Add contiguous. (gfc_is_simply_contiguous): Add prototype. (gfc_add_contiguous): Add prototype. * match.h (gfc_match_contiguous): Add prototype. * parse.c (decode_specification_statement, decode_statement): Handle contiguous attribute. * expr.c (gfc_is_simply_contiguous): New function. * dump-parse-tree.c (show_attr): Handle contiguous. * module.c (ab_attribute, attr_bits, mio_symbol_attribute): Ditto. * trans-expr.c (gfc_add_interface_mapping): Copy attr.contiguous. * trans-array.c (gfc_conv_descriptor_stride_get, gfc_conv_array_parameter): Handle contiguous arrays. * trans-types.c (gfc_build_array_type, gfc_build_array_type, gfc_sym_type, gfc_get_derived_type, gfc_get_array_descr_info): Ditto. * trans.h (gfc_array_kind): Ditto. * trans-decl.c (gfc_get_symbol_decl): Ditto. 2010-06-20 Tobias Burnus PR fortran/40632 * gfortran.dg/contiguous_1.f90: New. * gfortran.dg/contiguous_2.f90: New. * gfortran.dg/contiguous_3.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161079 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index d77a6c5fdb9..4a9b5f0226b 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -665,7 +665,8 @@ typedef struct unsigned allocatable:1, dimension:1, codimension:1, external:1, intrinsic:1, optional:1, pointer:1, target:1, value:1, volatile_:1, temporary:1, dummy:1, result:1, assign:1, threadprivate:1, not_always_present:1, - implied_index:1, subref_array_pointer:1, proc_pointer:1, asynchronous:1; + implied_index:1, subref_array_pointer:1, proc_pointer:1, asynchronous:1, + contiguous:1; /* For CLASS containers, the pointer attribute is sometimes set internally even though it was not directly specified. In this case, keep the @@ -2437,6 +2438,7 @@ gfc_try gfc_add_attribute (symbol_attribute *, locus *); gfc_try gfc_add_ext_attribute (symbol_attribute *, ext_attr_id_t, locus *); gfc_try gfc_add_allocatable (symbol_attribute *, locus *); gfc_try gfc_add_codimension (symbol_attribute *, const char *, locus *); +gfc_try gfc_add_contiguous (symbol_attribute *, const char *, locus *); gfc_try gfc_add_dimension (symbol_attribute *, const char *, locus *); gfc_try gfc_add_external (symbol_attribute *, locus *); gfc_try gfc_add_intrinsic (symbol_attribute *, locus *); @@ -2614,6 +2616,7 @@ void gfc_free_actual_arglist (gfc_actual_arglist *); gfc_actual_arglist *gfc_copy_actual_arglist (gfc_actual_arglist *); const char *gfc_extract_int (gfc_expr *, int *); bool is_subref_array (gfc_expr *); +bool gfc_is_simply_contiguous (gfc_expr *, bool); gfc_expr *gfc_build_conversion (gfc_expr *); void gfc_free_ref_list (gfc_ref *); -- cgit v1.2.1 From cbb21b9fe851924cd389425830ce09e16cf4cc9e Mon Sep 17 00:00:00 2001 From: froydnj Date: Sun, 27 Jun 2010 20:00:50 +0000 Subject: * gfortran.h (gfc_code): Split backend_decl field into cycle_label and exit_label fields. * trans-openmp.c (gfc_trans_omp_do): Assign to new fields individually. * trans-stmt.c (gfc_trans_simple_do): Likewise. (gfc_trans_do): Likewise. (gfc_trans_do_while): Likewise. (gfc_trans_cycle): Use cycle_label directly. (gfc_trans_exit): Use exit_label directly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161473 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 4a9b5f0226b..0c96bf40e6e 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2077,9 +2077,9 @@ typedef struct gfc_code } ext; /* Points to additional structures required by statement */ - /* Backend_decl is used for cycle and break labels in do loops, and - probably for other constructs as well, once we translate them. */ - tree backend_decl; + /* Cycle and break labels in do loops. */ + tree cycle_label; + tree exit_label; } gfc_code; -- cgit v1.2.1 From 58b069a099182c5367587d098eda613ee3947fec Mon Sep 17 00:00:00 2001 From: burnus Date: Tue, 6 Jul 2010 20:56:07 +0000 Subject: 2010-07-06 Tobias Burnus PR fortran/44742 * array.c (gfc_expand_constructor): Add optional diagnostic. * gfortran.h (gfc_expand_constructor): Update prototype. * expr.c (gfc_simplify_expr, check_init_expr, gfc_reduce_init_expr): Update gfc_expand_constructor call. * resolve.c (gfc_resolve_expr): Ditto. 2010-07-06 Tobias Burnus PR fortran/44742 * gfortran.dg/parameter_array_init_6.f90: New. * gfortran.dg/initialization_20.f90: Update dg-error. * gfortran.dg/initialization_24.f90: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161888 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 0c96bf40e6e..a63f97e24bf 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2715,7 +2715,7 @@ gfc_try gfc_resolve_array_spec (gfc_array_spec *, int); int gfc_compare_array_spec (gfc_array_spec *, gfc_array_spec *); void gfc_simplify_iterator_var (gfc_expr *); -gfc_try gfc_expand_constructor (gfc_expr *); +gfc_try gfc_expand_constructor (gfc_expr *, bool); int gfc_constant_ac (gfc_expr *); int gfc_expanded_ac (gfc_expr *); gfc_try gfc_resolve_character_array_constructor (gfc_expr *); -- cgit v1.2.1 From 1da1826b7789821567dedb4a5418c6d61c915d1c Mon Sep 17 00:00:00 2001 From: burnus Date: Thu, 8 Jul 2010 15:17:25 +0000 Subject: 2010-07-08 Tobias Burnus PR fortran/18918 * array.c (gfc_match_array_ref): Better error message for coarrays with too few ranks. (match_subscript): Move one diagnostic to caller. * gfortran.h (gfc_get_corank): Add prottype. * expr.c (gfc_get_corank): New function. * iresolve.c (resolve_bound): Fix rank for cobounds. (gfc_resolve_lbound,gfc_resolve_lcobound, gfc_resolve_ubound, gfc_resolve_ucobound, gfc_resolve_this_image): Update resolve_bound call. 2010-07-08 Tobias Burnus PR fortran/18918 * gfortran.dg/coarray_10.f90: Add an additional test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161960 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index a63f97e24bf..82703e65c59 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2670,6 +2670,7 @@ void gfc_expr_replace_comp (gfc_expr *, gfc_component *); bool gfc_is_proc_ptr_comp (gfc_expr *, gfc_component **); bool gfc_is_coindexed (gfc_expr *); +bool gfc_get_corank (gfc_expr *); bool gfc_has_ultimate_allocatable (gfc_expr *); bool gfc_has_ultimate_pointer (gfc_expr *); -- cgit v1.2.1 From 95bf00d57a5dddd773b91d637479d17a4ca5fd76 Mon Sep 17 00:00:00 2001 From: janus Date: Thu, 8 Jul 2010 21:29:56 +0000 Subject: 2010-07-08 Janus Weil PR fortran/44649 * gfortran.h (gfc_isym_id): Add GFC_ISYM_C_SIZEOF,GFC_ISYM_STORAGE_SIZE. * intrinsic.h (gfc_check_c_sizeof,gfc_check_storage_size, gfc_resolve_storage_size): New prototypes. * check.c (gfc_check_c_sizeof,gfc_check_storage_size): New functions. * intrinsic.c (add_functions): Add STORAGE_SIZE. * iresolve.c (gfc_resolve_storage_size): New function. * trans-intrinsic.c (gfc_conv_intrinsic_sizeof): Handle polymorphic arguments. (gfc_conv_intrinsic_storage_size): New function. (gfc_conv_intrinsic_function): Handle STORAGE_SIZE. 2010-07-08 Janus Weil PR fortran/44649 * gfortran.dg/c_sizeof_1.f90: Modified. * gfortran.dg/storage_size_1.f08: New. * gfortran.dg/storage_size_2.f08: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161977 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 82703e65c59..37979268c65 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -348,6 +348,7 @@ enum gfc_isym_id GFC_ISYM_CPU_TIME, GFC_ISYM_CSHIFT, GFC_ISYM_CTIME, + GFC_ISYM_C_SIZEOF, GFC_ISYM_DATE_AND_TIME, GFC_ISYM_DBLE, GFC_ISYM_DIGITS, @@ -504,6 +505,7 @@ enum gfc_isym_id GFC_ISYM_SRAND, GFC_ISYM_SR_KIND, GFC_ISYM_STAT, + GFC_ISYM_STORAGE_SIZE, GFC_ISYM_SUM, GFC_ISYM_SYMLINK, GFC_ISYM_SYMLNK, -- cgit v1.2.1 From e20c5d834d5edde630d46ea1e1bc5cb6f673f3bd Mon Sep 17 00:00:00 2001 From: pault Date: Sat, 10 Jul 2010 14:57:25 +0000 Subject: 2010-07-10 Paul Thomas PR fortran/44773 * trans-expr.c (arrayfunc_assign_needs_temporary): No temporary if the lhs has never been host associated, as well as not being use associated, a pointer or a target. * resolve.c (resolve_variable): Mark variables that are host associated. * gfortran.h: Add the host_assoc bit to the symbol_attribute structure. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162038 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 37979268c65..60864807db6 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -682,7 +682,8 @@ typedef struct use_assoc:1, /* Symbol has been use-associated. */ use_only:1, /* Symbol has been use-associated, with ONLY. */ use_rename:1, /* Symbol has been use-associated and renamed. */ - imported:1; /* Symbol has been associated by IMPORT. */ + imported:1, /* Symbol has been associated by IMPORT. */ + host_assoc:1; /* Symbol has been host associated. */ unsigned in_namelist:1, in_common:1, in_equivalence:1; unsigned function:1, subroutine:1, procedure:1; -- cgit v1.2.1 From 09276310eee7ca1b0205abdb47fc612bec7ba51d Mon Sep 17 00:00:00 2001 From: janus Date: Tue, 13 Jul 2010 06:57:17 +0000 Subject: 2010-07-13 Janus Weil PR fortran/44434 PR fortran/44565 PR fortran/43945 PR fortran/44869 * gfortran.h (gfc_find_derived_vtab): Modified prototype. * class.c (gfc_build_class_symbol): Modified call to 'gfc_find_derived_vtab'. (add_proc_component): Removed, moved code into 'add_proc_comp'. (add_proc_comps): Renamed to 'add_proc_comp', removed treatment of generics. (add_procs_to_declared_vtab1): Removed unnecessary argument 'resolved'. Removed treatment of generics. (copy_vtab_proc_comps): Removed unnecessary argument 'resolved'. Call 'add_proc_comp' instead of duplicating code. (add_procs_to_declared_vtab): Removed unnecessary arguments 'resolved' and 'declared'. (add_generic_specifics,add_generics_to_declared_vtab): Removed. (gfc_find_derived_vtab): Removed unnecessary argument 'resolved'. Removed treatment of generics. * iresolve.c (gfc_resolve_extends_type_of): Modified call to 'gfc_find_derived_vtab'. * resolve.c (resolve_typebound_function,resolve_typebound_subroutine): Removed treatment of generics. (resolve_select_type,resolve_fl_derived): Modified call to 'gfc_find_derived_vtab'. * trans-decl.c (gfc_get_symbol_decl): Ditto. * trans-expr.c (gfc_conv_derived_to_class,gfc_trans_class_assign): Ditto. * trans-stmt.c (gfc_trans_allocate): Ditto. 2010-07-13 Janus Weil PR fortran/44434 PR fortran/44565 PR fortran/43945 PR fortran/44869 * gfortran.dg/dynamic_dispatch_1.f03: Fixed invalid test case. * gfortran.dg/dynamic_dispatch_2.f03: Ditto. * gfortran.dg/dynamic_dispatch_3.f03: Ditto. * gfortran.dh/typebound_call_16.f03: New. * gfortran.dg/typebound_generic_6.f03: New. * gfortran.dg/typebound_generic_7.f03: New. * gfortran.dg/typebound_generic_8.f03: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162125 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 60864807db6..cf14bb46af2 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2820,7 +2820,7 @@ void gfc_add_component_ref (gfc_expr *, const char *); gfc_expr *gfc_class_null_initializer (gfc_typespec *); gfc_try gfc_build_class_symbol (gfc_typespec *, symbol_attribute *, gfc_array_spec **, bool); -gfc_symbol *gfc_find_derived_vtab (gfc_symbol *, bool); +gfc_symbol *gfc_find_derived_vtab (gfc_symbol *); gfc_symtree* gfc_find_typebound_proc (gfc_symbol*, gfc_try*, const char*, bool, locus*); gfc_symtree* gfc_find_typebound_user_op (gfc_symbol*, gfc_try*, -- cgit v1.2.1 From f10a970e36b75ac92c8d636846e0a7da6af97d1f Mon Sep 17 00:00:00 2001 From: janus Date: Wed, 14 Jul 2010 08:09:05 +0000 Subject: 2010-07-14 Janus Weil PR fortran/44925 * gfortran.h (gfc_is_data_pointer): Remove prototype. * dependency.c (gfc_is_data_pointer): Make it static. * intrinsic.texi: Update documentation on C_LOC. * resolve.c (gfc_iso_c_func_interface): Fix pointer and target checks and add a check for polymorphic variables. 2010-07-14 Janus Weil PR fortran/44925 * gfortran.dg/c_loc_tests_15.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162169 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 1 - 1 file changed, 1 deletion(-) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index cf14bb46af2..11ff594f59b 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2810,7 +2810,6 @@ void gfc_global_used (gfc_gsymbol *, locus *); /* dependency.c */ int gfc_dep_compare_expr (gfc_expr *, gfc_expr *); -int gfc_is_data_pointer (gfc_expr *); /* check.c */ gfc_try gfc_check_same_strlen (const gfc_expr*, const gfc_expr*, const char*); -- cgit v1.2.1 From 98f8bf075936982049c512465c37c6283cf85693 Mon Sep 17 00:00:00 2001 From: domob Date: Fri, 23 Jul 2010 09:53:45 +0000 Subject: 2010-07-23 Daniel Kraft PR fortran/44709 * gfortran.h (gfc_find_symtree_in_proc): New method. * symbol.c (gfc_find_symtree_in_proc): New method. * match.c (match_exit_cycle): Look for loop name also in parent namespaces within current procedure. 2010-07-23 Daniel Kraft PR fortran/44709 * gfortran.dg/exit_1.f08: New test. * gfortran.dg/exit_2.f08: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162450 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 11ff594f59b..401e501c41d 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2512,6 +2512,7 @@ gfc_user_op *gfc_get_uop (const char *); gfc_user_op *gfc_find_uop (const char *, gfc_namespace *); void gfc_free_symbol (gfc_symbol *); gfc_symbol *gfc_new_symbol (const char *, gfc_namespace *); +gfc_symtree* gfc_find_symtree_in_proc (const char *, gfc_namespace *); int gfc_find_symbol (const char *, gfc_namespace *, int, gfc_symbol **); int gfc_find_sym_tree (const char *, gfc_namespace *, int, gfc_symtree **); int gfc_get_symbol (const char *, gfc_namespace *, gfc_symbol **); -- cgit v1.2.1 From 25f9f93d9623117368f63ab9001ef2703c454d85 Mon Sep 17 00:00:00 2001 From: pault Date: Fri, 23 Jul 2010 14:25:55 +0000 Subject: 2009-07-23 Paul Thomas PR fortran/24524 * trans-array.c (gfc_init_loopinfo): Initialize the reverse field. gfc_trans_scalarized_loop_end: If reverse set in dimension n, reverse the scalarization loop. gfc_conv_resolve_dependencies: Pass the reverse field of the loopinfo to gfc_dep_resolver. trans-expr.c (gfc_trans_assignment_1): Enable loop reversal for assignment by resetting loop.reverse. gfortran.h : Add the gfc_reverse enum. trans.h : Add the reverse field to gfc_loopinfo. dependency.c (gfc_check_dependency): Pass null to the new arg of gfc_dep_resolver. (gfc_check_section_vs_section): Check for reverse dependencies. (gfc_dep_resolver): Add reverse argument and deal with the loop reversal logic. dependency.h : Modify prototype for gfc_dep_resolver to include gfc_reverse *. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162462 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/gfortran.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gcc/fortran/gfortran.h') diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 401e501c41d..a493866ab36 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -576,6 +576,15 @@ typedef enum } gfc_fcoarray; +typedef enum +{ + GFC_REVERSE_NOT_SET, + GFC_REVERSE_SET, + GFC_CAN_REVERSE, + GFC_CANNOT_REVERSE +} +gfc_reverse; + /************************* Structures *****************************/ /* Used for keeping things in balanced binary trees. */ -- cgit v1.2.1