aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
AgeCommit message (Collapse)AuthorFilesLines
2012-08-24dwarf2out.c (gen_producer_string): Omit command line switch if ↵Simon Baldwin2-1/+5
CL_NO_DWARF_RECORD flag set. gcc/ChangeLog * dwarf2out.c (gen_producer_string): Omit command line switch if CL_NO_DWARF_RECORD flag set. * opts.h (CL_NO_DWARF_RECORD): New. * opt-functions.awk (switch_flags): Add NoDWARFRecord. * doc/options.texi: Document NoDWARFRecord option flag. gcc/fortran/ChangeLog * lang.opt (-cpp=): Mark flag NoDWARFRecord. From-SVN: r190648
2012-08-24re PR fortran/54350 (FAIL: gfortran.dg/realloc_on_assign_*.f90 -O ↵Tobias Burnus7-229/+213
(internal compiler error) at r190586) 2012-08-24 Tobias Burnus <burnus@net-b.de> PR fortran/54350 * trans-array.c (free_ss_info): Free data.array.subscript. (gfc_free_ss): No longer free data.array.subscript. (walk_coarray): New function, moved from trans-intrinsic.c (gfc_conv_expr_descriptor): Walk array descriptor instead of taking passed "ss". (get_array_ctor_all_strlen, gfc_add_loop_ss_code, gfc_conv_array_parameter): Update call and cleanup ss handling. * trans-array.h (gfc_conv_expr_descriptor, gfc_conv_array_parameter): Update prototype. * trans-expr.c (gfc_conv_derived_to_class, conv_isocbinding_procedure, gfc_conv_procedure_call, gfc_trans_alloc_subarray_assign, gfc_trans_subcomponent_assign, gfc_trans_pointer_assignment, gfc_trans_arrayfunc_assign): Update call to gfc_conv_expr_descriptor and gfc_conv_array_parameter, and clean up. * trans-intrinsic.c (walk_coarray): Moved to trans-array.c (trans_this_image, trans_image_index, gfc_conv_intrinsic_rank gfc_conv_intrinsic_bound, gfc_conv_intrinsic_cobound, gfc_conv_intrinsic_len, gfc_conv_intrinsic_size, gfc_conv_intrinsic_sizeof, gfc_conv_intrinsic_storage_size, gfc_conv_intrinsic_transfer, gfc_conv_allocated, gfc_conv_associated, gfc_conv_intrinsic_loc, conv_intrinsic_move_alloc): Update calls. * trans-io.c (gfc_convert_array_to_string, set_internal_unit, gfc_trans_transfer): Ditto. * trans-stmt.c (gfc_conv_elemental_dependencies, gfc_trans_sync, trans_associate_var, gfc_trans_pointer_assign_need_temp): Ditto. From-SVN: r190641
2012-08-23tree.c (copy_node_stat): Clear DECL_STRUCT_FUNCTION.Jakub Jelinek2-4/+10
* tree.c (copy_node_stat): Clear DECL_STRUCT_FUNCTION. fortran/ * trans-decl.c (trans_function_start, generate_coarray_init, create_main_function, gfc_generate_constructors): Call allocate_struct_function instead of init_function_start. From-SVN: r190619
2012-08-22trans-expr.c (gfc_copy_class_to_class, [...]): Free loop and ss data.Tobias Burnus3-0/+10
2012-08-22 Tobias Burnus <burnus@net-b.de> * trans-expr.c (gfc_copy_class_to_class, gfc_trans_arrayfunc_assign): Free loop and ss data. * trans-intrinsic.c (gfc_trans_arrayfunc_assign): Free ss data. From-SVN: r190586
2012-08-21parse.c (parse_contained): Include EXEC_END_PROCEDURE in ns->code to make ↵Tobias Burnus2-0/+6
sure the gfc_code is freed. 2012-08-21 Tobias Burnus <burnus@net-b.de> * parse.c (parse_contained): Include EXEC_END_PROCEDURE in ns->code to make sure the gfc_code is freed. From-SVN: r190575
2012-08-20re PR fortran/54301 (Add optional warning if pointer assigning a local ↵Tobias Burnus2-0/+7
variable to a nonlocal pointer) 2012-08-20 Tobias Burnus <burnus@net-b.de> PR fortran/54301 * expr.c (gfc_check_pointer_assign): Warn when a pointer, which is a function result, might outlive its target. 2012-08-20 Tobias Burnus <burnus@net-b.de> PR fortran/54301 * gfortran.dg/warn_target_lifetime_2.f90: New. From-SVN: r190542
2012-08-20re PR fortran/54301 (Add optional warning if pointer assigning a local ↵Tobias Burnus6-3/+63
variable to a nonlocal pointer) 2012-08-20 Tobias Burnus <burnus@net-b.de> PR fortran/54301 * expr.c (gfc_check_pointer_assign): Warn when the pointer might outlive its target. * gfortran.h (struct gfc_option_t): Add warn_target_lifetime. * options.c (gfc_init_options, set_wall, gfc_handle_option): handle it. * invoke.texi (-Wtarget-lifetime): Document it. (-Wall): Implied it. * lang.opt (-Wtarget-lifetime): New flag. 2012-08-20 Tobias Burnus <burnus@net-b.de> PR fortran/54301 * gfortran.dg/warn_target_lifetime_1.f90: New. From-SVN: r190522
2012-08-19re PR fortran/54298 (Add warning when doing equal/nonequal floating-point ↵Thomas Koenig6-4/+55
comparisons) 2012-08-19 Thomas König <tkoenig@gcc.gnu.org> PR fortran/54298 * gfortran.h (struct gfc_option_t): Add warn_compare_reals. * lang.opt: Add Wcompare-reals. * invoke.texi: Document -Wcompare-reals. * resolve.c (resolve_operator): If -Wcompare-reals is in effect, warn about equality/inequality comparisions for REAL and COMPLEX. * options.c (gfc_init_options): Set warn_compare_reals. (set_Wall): Include warn_compare_reals in Wall. (gfc_handle_option): Handle Wcompare_reals. 2012-08-19 Thomas König <tkoenig@gcc.gnu.org> PR fortran/54298 * gfortran.dg/real_compare_1.f90: New test case. * gfortran.dg/bessel_5.f90 Add -Wno-compare-reals to options. From-SVN: r190516
2012-08-17invoke.texi (-Wsizeof-pointer-memaccess): Document.Jakub Jelinek2-3/+7
* doc/invoke.texi (-Wsizeof-pointer-memaccess): Document. c/ * c-tree.h (c_last_sizeof_arg): Declare. * c-parser.c (struct c_tree_loc_pair): New type. (c_parser_expr_list): Add sizeof_arg argument. Fill it in if non-NULL. (c_parser_attributes, c_parser_objc_keywordexpr): Adjust callers. (c_parser_postfix_expression_after_primary): Likewise. Call sizeof_pointer_memaccess_warning if needed. (sizeof_ptr_memacc_comptypes): New function. * c-typeck.c (c_last_sizeof_arg): New global variable. (c_expr_sizeof_expr, c_expr_sizeof_type): Initialize it. cp/ * cp-tree.def (SIZEOF_EXPR): Move to c-common.def. c-family/ * c-common.c (sizeof_pointer_memaccess_warning): New function. * c.opt (-Wsizeof-pointer-memaccess): Add new option. * c-opts.c (c_common_handle_option): Enable it for -Wall. * c-common.h (sizeof_pointer_memaccess_warning): Add prototype. * c-common.def (SIZEOF_EXPR): Moved here from cp-tree.def. fortran/ * array.c (gfc_match_array_ref): Fix up memset arguments. testsuite/ * gcc.dg/torture/Wsizeof-pointer-memaccess1.c: New test. From-SVN: r190467
2012-08-16revert: re PR bootstrap/54281 (Fails to bootstrap with --disable-nls)Diego Novillo2-0/+8
2012-08-16 Diego Novillo <dnovillo@google.com> Revert PR bootstrap/54281 * double-int.h: Move including of gmp.h ... * system.h: ... here. * realmpfr.h: Do not include gmp.h. * tree-ssa-loop-niter.c: Do not include gmp.h. From-SVN: r190449
2012-08-16re PR bootstrap/54281 (Fails to bootstrap with --disable-nls)Diego Novillo2-1/+5
2012-08-16 Diego Novillo <dnovillo@google.com> PR bootstrap/54281 * double-int.h: Move including of gmp.h ... * system.h: ... here. * realmpfr.h: Do not include gmp.h. * tree-ssa-loop-niter.c: Do not include gmp.h. fortran/ChangeLog * gfortran.h: Do not include gmp.h. From-SVN: r190444
2012-08-16re PR fortran/54243 ([OOP] ICE (segfault) in gfc_type_compatible for invalid ↵Janus Weil2-0/+13
BT_CLASS) 2012-08-15 Janus Weil <janus@gcc.gnu.org> PR fortran/54243 PR fortran/54244 * resolve.c (check_typebound_baseobject): Check for class_ok attribute. (resolve_procedure_interface,resolve_fl_derived0): Copy class_ok attribute. 2012-08-15 Janus Weil <janus@gcc.gnu.org> PR fortran/54243 PR fortran/54244 * gfortran.dg/typebound_call_24.f03: New. From-SVN: r190420
2012-08-14re PR fortran/47586 ([F03] allocatable components: deep copy missing)Mikael Morin2-0/+51
fortran/ PR fortran/47586 * trans-expr.c (expr_is_variable): Handle regular, procedure pointer, and typebound functions returning a data pointer. testsuite/ PR fortran/47586 * gfortran.dg/typebound_proc_20.f90: Enable runtime test. * gfortran.dg/typebound_proc_27.f03: New test. From-SVN: r190394
2012-08-14decl.c (match_ppc_decl): Copy the procedure interface's symbol as procedure ↵Mikael Morin2-0/+6
interface's result. fortran/ * decl.c (match_ppc_decl): Copy the procedure interface's symbol as procedure interface's result. From-SVN: r190393
2012-08-14trans-expr.c (gfc_trans_scalar_assign): Rename argument, extend comment.Mikael Morin2-6/+34
fortran/ * trans-expr.c (gfc_trans_scalar_assign): Rename argument, extend comment. From-SVN: r190392
2012-08-14gfortran.h (gfc_get_proc_ptr_comp): New prototype.Mikael Morin11-49/+80
fortran/ * gfortran.h (gfc_get_proc_ptr_comp): New prototype. (gfc_is_proc_ptr_comp): Update prototype. * expr.c (gfc_get_proc_ptr_comp): New function based on the old gfc_is_proc_ptr_comp. (gfc_is_proc_ptr_comp): Call gfc_get_proc_ptr_comp. (gfc_specification_expr, gfc_check_pointer_assign): Use gfc_get_proc_ptr_comp. * trans-array.c (gfc_walk_function_expr): Likewise. * resolve.c (resolve_structure_cons, update_ppc_arglist, resolve_ppc_call, resolve_expr_ppc): Likewise. (resolve_function): Update call to gfc_is_proc_ptr_comp. * dump-parse-tree.c (show_expr): Likewise. * interface.c (compare_actual_formal): Likewise. * match.c (gfc_match_pointer_assignment): Likewise. * primary.c (gfc_match_varspec): Likewise. * trans-io.c (gfc_trans_transfer): Likewise. * trans-expr.c (gfc_conv_variable, conv_function_val, conv_isocbinding_procedure, gfc_conv_procedure_call, gfc_trans_pointer_assignment): Likewise. (gfc_conv_procedure_call, gfc_trans_array_func_assign): Use gfc_get_proc_ptr_comp. From-SVN: r190391
2012-08-14re PR fortran/40881 ([F03] warn for obsolescent features)Tobias Burnus8-13/+53
2012-08-14 Tobias Burnus <burnus@net-b.de> PR fortran/40881 * error.c (gfc_notify_std): Reset cur_error_buffer->flag flag when the error/warning has been printed. * gfortran.h (gfc_sl_type): Add ST_LABEL_DO_TARGET. * match.c (gfc_match_do): Use ST_LABEL_DO_TARGET. * parse.c (check_statement_label): Use ST_LABEL_DO_TARGET. (parse_executable): Add obsolescence check for DATA. * resolve.c (resolve_branch): Handle ST_LABEL_DO_TARGET. * symbol.c (gfc_define_st_label, gfc_reference_st_label): Add obsolescence diagnostics. * trans-stmt.c (gfc_trans_label_assign): Handle * ST_LABEL_DO_TARGET. 2012-08-14 Tobias Burnus <burnus@net-b.de> PR fortran/40881 * gfortran.dg/data_constraints_3.f90: New. * gfortran.dg/data_constraints_1.f90: Add dg-options "" to disable -pedantic compilation. * gfortran.dg/pr37243.f: Ditto. * gfortran.dg/g77/19990826-3.f: Ditto. * gfortran.dg/g77/20020307-1.f : Ditto. * gfortran.dg/g77/980310-3.f: Ditto. From-SVN: r190379
2012-08-14re PR fortran/54234 (-Wconversion or -Wconversion-extra should warn for ↵Tobias Burnus2-0/+18
CMPLX(dp,dp)) 2012-08-14 Tobias Burnus <burnus@net-b.de> PR fortran/54234 * check.c (gfc_check_cmplx): Add -Wconversion warning when converting higher-precision REAL to default-precision CMPLX without kind= parameter. 2012-08-14 Tobias Burnus <burnus@net-b.de> PR fortran/54234 * gfortran.dg/warn_conversion_4.f90: New. From-SVN: r190378
2012-08-12re PR fortran/54221 (Explicit private access specifier signals "unexpected ↵Tobias Burnus2-0/+18
defined but not used [-Wunused-function]" warning) 2012-08-12 Tobias Burnus <burnus@net-b.de> PR fortran/54221 * trans-decl.c (gfc_finish_var_decl, build_function_decl): Fix setting private module vars/procs as TREE_PUBLIC(...) = 0. 2012-08-12 Tobias Burnus <burnus@net-b.de> PR fortran/54221 * vect/vect-gems.f90: Don't mark module vars as PRIVATE as they appear uninitialized on the RHS. * gfortran.dg/public_private_module_6.f90: New. From-SVN: r190325
2012-08-09re PR fortran/54199 (Superfluous diagnostic "is also the name of an ↵Tobias Burnus2-1/+7
intrinsic" for internal procedures) 2012-08-09 Tobias Burnus <burnus@net-b.de> PR fortran/54199 * intrinsic.c (gfc_warn_intrinsic_shadow): Better warning for internal procedures. 2012-08-09 Tobias Burnus <burnus@net-b.de> PR fortran/54199 * gfortran.dg/intrinsic_shadow_4.f90: New. From-SVN: r190251
2012-08-06re PR fortran/35831 ([F95] Shape mismatch check missing for dummy procedure ↵Janus Weil2-53/+165
argument) 2012-08-06 Janus Weil <janus@gcc.gnu.org> PR fortran/35831 * interface.c (check_result_characteristics): New function, which checks the characteristics of function results. (gfc_compare_interfaces,gfc_check_typebound_override): Call it. 2012-08-06 Janus Weil <janus@gcc.gnu.org> PR fortran/35831 * gfortran.dg/dummy_procedure_5.f90: Modified. * gfortran.dg/dummy_procedure_8.f90: New. * gfortran.dg/interface_26.f90: Modified. * gfortran.dg/proc_ptr_11.f90: Modified. * gfortran.dg/proc_ptr_15.f90: Modified. * gfortran.dg/proc_ptr_result_5.f90: Modified. * gfortran.dg/typebound_override_1.f90: Modified. * gfortran.dg/typebound_proc_6.f03: Modified. From-SVN: r190187
2012-08-04Fix PR 54033, problems with -I, with test casesThomas Koenig3-8/+21
PR fortran/54033 * scanner.c (add_path_to_list): New argument warn. Don't warn if it is true. (gfc_add_include_path): Warn if directory is missing. (gfc_add_intrinsic_modules_path): Do not warn if directory is missing. * optinons.c (gfc_handle_option): Do not add directory for intrinsic modules to normal include path. From-SVN: r190144
2012-08-03re PR fortran/54166 (ICE rank-1 assignment to rank-2 array section)Mikael Morin2-2/+7
fortran/ PR fortran/54166 * trans-array.c (set_loop_bounds): Access specinfo using spec_dim. testsuite/ PR fortran/54166 * gfortran.dg/array_5.f90: New test. From-SVN: r190130
2012-08-02Add the bug number in the ChangeLogMikael Morin1-0/+1
From-SVN: r190099
2012-08-02re PR fortran/48820 (TR 29113: Implement parts needed for MPI 3)Mikael Morin2-0/+54
fortran/ PR fortran/48820 * trans-array.c (gfc_conv_ss_startstride): Set the intrinsic result's lower and upper bounds according to the rank. (set_loop_bounds): Set the loop upper bound in the intrinsic case. testsuite/ PR fortran/48820 * gfortran.dg/assumed_rank_bounds_1.f90: New test. * gfortran.dg/assumed_rank_bounds_2.f90: New test. From-SVN: r190098
2012-08-02trans-array.c (set_loop_bounds): Allow non-array-section to be chosen using ↵Mikael Morin2-11/+5
the stride and lower bound criteria. * trans-array.c (set_loop_bounds): Allow non-array-section to be chosen using the stride and lower bound criteria. From-SVN: r190097
2012-08-02trans-array.c (set_loop_bounds): Remove useless dimension check.Mikael Morin2-3/+11
* trans-array.c (set_loop_bounds): Remove useless dimension check. Don't update loopspec if it would loose the wanted stride criterion. From-SVN: r190096
2012-08-02trans-array.h (gfc_conv_descriptor_rank): New prototype.Mikael Morin4-17/+27
* trans-array.h (gfc_conv_descriptor_rank): New prototype. * trans-array.c (gfc_conv_descriptor_rank): New function moved and renamed ... * trans-intrinsic.c (get_rank_from_desc): ... from this one. (gfc_conv_intrinsic_rank, gfc_conv_intrinsic_bound, gfc_conv_associated): Also rename function calls. From-SVN: r190095
2012-08-02iresolve.c (resolve_bound, [...]): Don't set the shape for assumed rank arrays.Mikael Morin3-5/+22
* iresolve.c (resolve_bound, gfc_resolve_shape): Don't set the shape for assumed rank arrays. * simplify.c (gfc_simplify_shape): Don't try to simplify if the argument is assumed rank. From-SVN: r190094
2012-08-02array.c (gfc_copy_array_ref): Don't copy the offset field.Mikael Morin5-10/+10
* array.c (gfc_copy_array_ref): Don't copy the offset field. * expr.c (find_array_section): Ignore the offset field. * trans-expr.c (gfc_find_interface_mapping_to_ref): Don't apply any interface mapping to the offset field. * gfortran.h (struct gfc_array_ref): Remove the offset field. From-SVN: r190092
2012-08-02re PR fortran/54147 ([F03] Interface checks for PPCs & deferred TBPs)Janus Weil2-59/+71
2012-08-02 Janus Weil <janus@gcc.gnu.org> PR fortran/54147 * resolve.c (check_proc_interface): New routine for PROCEDURE interface checks. (resolve_procedure_interface,resolve_typebound_procedure, resolve_fl_derived0): Call it. 2012-08-02 Janus Weil <janus@gcc.gnu.org> PR fortran/54147 * gfortran.dg/abstract_type_6.f03: Modified. * gfortran.dg/proc_ptr_comp_3.f90: Modified. * gfortran.dg/proc_ptr_comp_35.f90: New. * gfortran.dg/typebound_proc_9.f03: Modified. * gfortran.dg/typebound_proc_26.f90: New. From-SVN: r190069
2012-08-01re PR fortran/54033 (gfortran: Passing file as include directory - add ↵Thomas Koenig2-1/+25
diagnostic and ICE with -cpp) 2012-08-01 Thomas König <tkoenig@gcc.gnu.org> PR fortran/54033 * scanner.c (add_path_to_list): Emit warning if an error occurs for an include path, if it is not present or if it is not a directory. Do not add the path in these cases. 2012-08-01 Thomas König <tkoenig@gcc.gnu.org> PR fortran/54033 * gfortran.dg/include_6.f90: New test case. * gfortran.dg/include_7.f90: New test case. * gfortran.dg/include_3.f90: Add dg-warning for missing directory. From-SVN: r190054
2012-07-31re PR fortran/42418 (PROCEDURE: Rejects interface which is both specific and ↵Janus Weil5-52/+76
generic procedure) 2012-07-31 Janus Weil <janus@gcc.gnu.org> PR fortran/42418 * decl.c (match_procedure_interface): Move some checks to 'resolve_procedure_interface'. Set flavor if appropriate. * expr.c (gfc_check_pointer_assign): Cleanup of 'gfc_is_intrinsic'. * intrinsic.c (gfc_is_intrinsic): Additional checks for attributes which identify a procedure as being non-intrinsic. * resolve.c (resolve_procedure_interface): Checks moved here from 'match_procedure_interface'. Minor cleanup. (resolve_formal_arglist,resolve_symbol): Cleanup of 'resolve_procedure_interface' (resolve_actual_arglist,is_external_proc): Cleanup of 'gfc_is_intrinsic'. 2012-07-31 Janus Weil <janus@gcc.gnu.org> PR fortran/42418 * gfortran.dg/proc_decl_29.f90: New. From-SVN: r190017
2012-07-31re PR fortran/54134 ([OOP] ICE overriding derived type bound function with ↵Janus Weil2-0/+8
allocatable character as result) 2012-07-31 Janus Weil <janus@gcc.gnu.org> PR fortran/54134 * dependency.c (gfc_dep_compare_expr): Check if arguments are NULL. 2012-07-31 Janus Weil <janus@gcc.gnu.org> PR fortran/54134 * gfortran.dg/typebound_override_3.f90: New. From-SVN: r190010
2012-07-31interface.c (gfc_procedure_use): Return gfc_try instead ofTobias Burnus4-21/+64
2012-07-31 Tobias Burnus <burnus@net-b.de> * interface.c (gfc_procedure_use): Return gfc_try instead of * void. * gfortran.h (gfc_procedure_use): Update prototype. * resolve.c (gfc_iso_c_func_interface): Allow noninteroperable procedures for c_funloc for TS29113. * (gfc_iso_c_sub_interface): Ditto for c_f_procpointer. Add diagnostic for c_ptr vs. c_funptr for c_f_(proc)pointer. 2012-07-31 Tobias Burnus <burnus@net-b.de> * gfortran.dg/c_funloc_tests_6.f90: New. * gfortran.dg/c_funloc_tests_7.f90: New. * gfortran.dg/c_funloc_tests_5.f03: Compile with -std=f2003. From-SVN: r190003
2012-07-30re PR fortran/51081 ([F03] Proc-pointer assignment: Rejects valid internal proc)Janus Weil5-12/+51
2012-07-30 Janus Weil <janus@gcc.gnu.org> PR fortran/51081 * gfortran.h (gfc_resolve_intrinsic): Add prototype. * expr.c (gfc_check_pointer_assign): Set INTRINSIC attribute if needed. Check for invalid intrinsics. * primary.c (gfc_match_rvalue): Check for intrinsics came too early. Set procedure flavor if appropriate. * resolve.c (resolve_intrinsic): Renamed to gfc_resolve_intrinsic. (resolve_procedure_interface,resolve_procedure_expression, resolve_function,resolve_fl_derived0,resolve_symbol): Ditto. 2012-07-30 Janus Weil <janus@gcc.gnu.org> PR fortran/51081 * gfortran.dg/proc_ptr_37.f90: New. From-SVN: r189985
2012-07-26re PR fortran/44354 (implied do loop with its own variable name as upper bound)Mikael Morin2-18/+35
fortran/ PR fortran/44354 * trans-array.c (gfc_trans_array_constructor_value): Evaluate the iteration bounds before the inner variable shadows the outer. testsuite/ PR fortran/44354 * gfortran.dg/array_constructor_39.f90: New test. From-SVN: r189883
2012-07-26re PR fortran/44354 (implied do loop with its own variable name as upper bound)Mikael Morin2-3/+88
fortran/ PR fortran/44354 * array.c (sought_symbol): New variable. (expr_is_sought_symbol_ref, find_symbol_in_expr): New functions. (resolve_array_list): Check for references to the induction variable in the iteration bounds and issue a diagnostic if some are found. testsuite/ PR fortran/44354 * gfortran.dg/array_constructor_38.f90: New test. From-SVN: r189882
2012-07-26module.c (mio_array_spec): Don't read as->lower for assumed-rank arrays.Alessandro Fanfarillo2-6/+21
2012-07-26 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com> Tobias Burnus <burnus@net-b.de> * module.c (mio_array_spec): Don't read as->lower for assumed-rank arrays. Co-Authored-By: Tobias Burnus <burnus@net-b.de> From-SVN: r189881
2012-07-25trans-types.c (gfc_real16_is_float128): Fix spelling in a comment.Tobias Burnus11-15/+31
2012-07-25 Tobias Burnus <burnus@net-b.de> * trans-types.c (gfc_real16_is_float128): Fix spelling in a comment. * trans.h (struct gfc_array_info): Ditto. * gfortran.h (gfc_expr): Ditto. * simplify.c (gfc_count): Ditto. * trans-expr.c (gfc_copy_class_to_class, conv_parent_component_references, gfc_trans_pointer_assignment): Ditto. * expr.c (check_pointer_assign): Fix diagnostic spelling. * interface.c (compare_parameter): Ditto. * parse.c (use_modules, parse_associate): Ditto. * decl.c (match_char_length): Fix spelling of the an function argument. From-SVN: r189859
2012-07-21iso-c-binding.def (C_PTRDIFF_T): New TS29113 parameter.Tobias Burnus3-5/+13
2012-07-21 Tobias Burnus <burnus@net-b.de> * iso-c-binding.def (C_PTRDIFF_T): New TS29113 parameter. * intrinsic.texi (ISO_C_BINDING): Document it. From-SVN: r189746
2012-07-21re PR fortran/48820 (TR 29113: Implement parts needed for MPI 3)Tobias Burnus4-14/+73
2012-07-21 Tobias Burnus <burnus@net-b.de> PR fortran/48820 * trans-intrinsic.c (gfc_conv_intrinsic_bound): Support lbound/ubound with dim= for assumed-rank arrays. * array.c (gfc_set_array_spec): Reject coarrays with assumed shape. * decl.c (merge_array_spec): Ditto. Return gfc_try. (match_attr_spec, match_attr_spec): Update call. 2012-07-21 Tobias Burnus <burnus@net-b.de> PR fortran/48820 * gfortran.dg/assumed_rank_3.f90: New. * gfortran.dg/assumed_rank_11.f90: New. * gfortran.dg/assumed_rank_1.f90: Update dg-error. * gfortran.dg/assumed_rank_2.f90: Update dg-error. * gfortran.dg/assumed_rank_7.f90: Update dg-error. From-SVN: r189743
2012-07-21resolve.c (resolve_formal_arglist): Put variable declaration before the ↵Tobias Burnus2-1/+7
first assignment. 2012-07-21 Tobias Burnus <burnus@net-b.de> * resolve.c (resolve_formal_arglist): Put variable declaration before the first assignment. From-SVN: r189740
2012-07-21trans-expr.c (gfc_conv_derived_to_class): Fix argument passed to ↵Tobias Burnus2-2/+6
class_array_data_assign. 2012-07-21 Tobias Burnus <burnus@net-b.de> * trans-expr.c (gfc_conv_derived_to_class): Fix argument passed to class_array_data_assign. From-SVN: r189739
2012-07-20decl.c (gfc_verify_c_interop_param): Allow assumed-shape with -std=f2008ts.Tobias Burnus2-23/+14
2012-07-20 Tobias Burnus <burnus@net-b.de> * decl.c (gfc_verify_c_interop_param): Allow assumed-shape with -std=f2008ts. 2012-07-20 Tobias Burnus <burnus@net-b.de> * gfortran.dg/bind_c_array_params_2.f90: New. * gfortran.dg/bind_c_array_params.f03: Add -std=f2003 and update dg-error. From-SVN: r189726
2012-07-20re PR fortran/48820 (TR 29113: Implement parts needed for MPI 3)Tobias Burnus19-118/+566
2012-07-20 Tobias Burnus <burnus@net-b.de> PR fortran/48820 * array.c (match_array_element_spec, gfc_match_array_spec, spec_size, gfc_array_dimen_size): Add support for assumed-rank arrays. * check.c (dim_rank_check): Ditto. * class.c (gfc_add_component_ref): Ditto. (gfc_build_class_symbol): Regard assumed-rank arrays as having GFC_MAX_DIMENSIONS. And build extra class container for a scalar pointer class. * decl.c (merge_array_spec): Add assert. * dump-parse-tree.c (show_array_spec): Add support for assumed-rank arrays. * expr.c (gfc_is_simply_contiguous): Ditto. * gfortran.h (array_type): Ditto. (gfc_array_spec, gfc_expr): Add comment to "rank" field. * interface.c (compare_type_rank, argument_rank_mismatch, compare_parameter, gfc_procedure_use): Ditto. (compare_actual_formal): Fix NULL() to optional-dummy handling for polymorphic dummies. * module.c (mio_typespec): Add support for assumed-rank arrays. * resolve.c (resolve_formal_arglist, resolve_actual_arglist, resolve_elemental_actual, resolve_global_procedure, expression_shape, resolve_variable, update_ppc_arglist, check_typebound_baseobject, gfc_resolve_expr, resolve_fl_var_and_proc, gfc_resolve_finalizers, resolve_typebound_procedure, resolve_symbol): Ditto. (assumed_type_expr_allowed): Remove static variable. (actual_arg, first_actual_arg): New static variables. * simplify.c (simplify_bound, gfc_simplify_range): Add support for assumed-rank arrays. * trans-array.c (gfc_conv_array_parameter): Ditto. (gfc_get_descriptor_dimension): New function, which returns the descriptor. (gfc_conv_descriptor_dimension): Use it. (gfc_conv_descriptor_stride_get, gfc_conv_array_parameter): Handle GFC_ARRAY_ASSUMED_RANK_CONT and AS_ASSUMED_RANK. * trans-array.h (gfc_get_descriptor_dimension): New prototype. * trans-decl. (gfc_build_dummy_array_decl, gfc_trans_deferred_vars, add_argument_checking): Add support for assumed-rank arrays. * trans-expr.c (gfc_conv_expr_present, gfc_conv_variable, gfc_conv_procedure_call): Ditto. (get_scalar_to_descriptor_type, class_array_data_assign, conv_scalar_to_descriptor): New static functions. (gfc_conv_derived_to_class, gfc_conv_class_to_class): Use them. * trans-intrinsic.c (get_rank_from_desc): New function. (gfc_conv_intrinsic_rank, gfc_conv_associated): Use it. * trans-types.c (gfc_array_descriptor_base_caf, gfc_array_descriptor_base): Make space for scalar array. (gfc_is_nodesc_array, gfc_is_nodesc_array, gfc_build_array_type, gfc_get_array_descriptor_base): Add support for assumed-rank arrays. * trans.h (gfc_array_kind): Add GFC_ARRAY_ASSUMED_RANK and GFC_ARRAY_ASSUMED_RANK_CONT. 2012-07-20 Tobias Burnus <burnus@net-b.de> PR fortran/48820 * gfortran.dg/assumed_type_3.f90: Update dg-error. * gfortran.dg/assumed_rank_1.f90: New. * gfortran.dg/assumed_rank_1_c.c: New. * gfortran.dg/assumed_rank_2.f90: New. * gfortran.dg/assumed_rank_4.f90: New. * gfortran.dg/assumed_rank_5.f90: New. * gfortran.dg/assumed_rank_6.f90: New. * gfortran.dg/assumed_rank_7.f90: New. * gfortran.dg/assumed_rank_8.f90: New. * gfortran.dg/assumed_rank_8_c.c: New. * gfortran.dg/assumed_rank_9.f90: New. * gfortran.dg/assumed_rank_10.f90: New. * gfortran.dg/assumed_rank_12.f90: New. From-SVN: r189700
2012-07-19trans-expr.c (gfc_conv_procedure_call): Fix handling of polymorphic arguments.Tobias Burnus3-10/+33
2012-07-19 Tobias Burnus <burnus@net-b.de> * trans-expr.c (gfc_conv_procedure_call): Fix handling of polymorphic arguments. * resolve.c (resolve_formal_arglist): Ditto, mark polymorphic assumed-shape arrays as such. From-SVN: r189678
2012-07-19interface.c (compare_parameter, [...]): Fix handling of polymorphic arguments.Tobias Burnus2-6/+21
2012-07-19 Tobias Burnus <burnus@net-b.de> * interface.c (compare_parameter, compare_actual_formal): Fix handling of polymorphic arguments. From-SVN: r189669
2012-07-17re PR fortran/51081 ([F03] Proc-pointer assignment: Rejects valid internal proc)Janus Weil17-193/+283
2012-07-17 Janus Weil <janus@gcc.gnu.org> PR fortran/51081 * error.c (gfc_notify_std): Automatically print the relevant Fortran standard version. * arith.c (arith_power): Remove explicit standard reference string. * array.c (gfc_match_array_spec, gfc_match_array_constructor): Ditto. * check.c (gfc_check_a_p, gfc_check_besn, gfc_check_count, gfc_check_float, gfc_check_fn_rc2008, gfc_check_iand, gfc_check_ichar_iachar, gfc_check_ieor, gfc_check_index, gfc_check_ior, gfc_check_lbound, gfc_check_len_lentrim, check_rest, gfc_check_min_max, gfc_check_null, gfc_check_scan, gfc_check_selected_real_kind, gfc_check_shape, gfc_check_size, gfc_check_sngl, gfc_check_ubound, gfc_check_verify): Ditto. * data.c (gfc_assign_data_value): Ditto. * decl.c (var_element, char_len_param_value, match_char_length, gfc_verify_c_interop_param, match_pointer_init, variable_decl, gfc_match_decl_type_spec, gfc_match_import, match_attr_spec, gfc_match_prefix, gfc_match_suffix, match_ppc_decl, match_procedure_in_interface, gfc_match_procedure,gfc_match_entry, gfc_match_subroutine, gfc_match_end, gfc_match_codimension, gfc_match_protected, gfc_match_value, gfc_match_volatile, gfc_match_asynchronous, gfc_match_modproc, gfc_get_type_attr_spec, gfc_match_enum, match_procedure_in_type): Ditto. * expr.c (check_elemental, gfc_check_assign, gfc_check_pointer_assign): Ditto. * interface.c (gfc_match_abstract_interface, check_interface0): Ditto. * intrinsic.c (gfc_intrinsic_func_interface): Ditto. * io.c (format_lex, resolve_tag_format, resolve_tag, compare_to_allowed_values, gfc_match_open, gfc_match_rewind, gfc_resolve_dt, gfc_match_wait): Ditto. * match.c (match_arithmetic_if, gfc_match_if, gfc_match_critical, gfc_match_do, match_exit_cycle, gfc_match_pause, gfc_match_stop, gfc_match_lock, sync_statement, gfc_match_assign, gfc_match_goto, gfc_match_allocate, gfc_match_return, gfc_match_st_function): Ditto. * module.c (gfc_match_use, gfc_use_module): Ditto. * parse.c (parse_derived_contains, parse_block_construct, parse_associate, parse_contained): Ditto. * primary.c (match_hollerith_constant, match_boz_constant, match_real_constant, match_sym_complex_part, match_arg_list_function, build_actual_constructor, gfc_convert_to_structure_constructor): Ditto. * resolve.c (resolve_formal_arglist, resolve_entries, resolve_common_blocks, resolve_actual_arglist, gfc_resolve_index_1, gfc_resolve_iterator_expr, resolve_ordinary_assign, resolve_fl_var_and_proc, resolve_fl_variable_derived, resolve_fl_procedure, resolve_fl_derived0, resolve_fl_derived, resolve_fl_namelist, resolve_symbol, resolve_fntype): Ditto. * symbol.c (check_conflict, conflict, gfc_add_is_bind_c, gfc_add_extension, gfc_check_symbol_typed): Ditto. From-SVN: r189589
2012-07-17re PR fortran/53985 (-Wno-c-binding-type still prints a warning)Tobias Burnus2-2/+8
2012-07-17 Tobias Burnus <burnus@net-b.de> PR fortran/53985 * decl.c (gfc_verify_c_interop_param): Make warning conditional on -Wc-binding-type works and improve the wording. 2012-07-17 Tobias Burnus <burnus@net-b.de> PR fortran/53985 * gfortran.dg/bind_c_usage_26.f90: New. * gfortran.dg/bind_c_procs.f03: Add dg-options * "-Wc-binding-type". * gfortran.dg/bind_c_usage_13.f03: Ditto. * gfortran.dg/bind_c_usage_18.f90: Ditto. * gfortran.dg/interop_params.f03: Ditto. From-SVN: r189586