aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
AgeCommit message (Collapse)AuthorFilesLines
2018-12-23re PR fortran/77703 (ICE on assignment to pointer function)Paul Thomas1-0/+5
2018-12-23 Paul Thomas <pault@gcc.gnu.org> PR fortran/77703 * resolve.c (get_temp_from_expr): Use the string length of constant character expressions. 2018-12-23 Paul Thomas <pault@gcc.gnu.org> PR fortran/77703 * gfortran.dg/ptr_func_assign_5.f08 : New test. From-SVN: r267379
2018-12-19re PR fortran/87992 (ICE in resolve_fl_variable, at fortran/resolve.c:12314)Steven G. Kargl1-1/+5
2018-12-19 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/87992 * resolve.c (resolve_fl_variable): Avoid a NULL pointer. 2018-12-19 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/87992 * gfortran.dg/pr87992.f90: New test. From-SVN: r267288
2018-12-17re PR fortran/85314 (gcc/fortran/resolve.c:9222: unreachable code ?)Steven G. Kargl1-4/+1
2018-12-16 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/85314 * resolve.c (resolve_transfer): Remove dead code. From-SVN: r267196
2018-12-11re PR fortran/88249 (ICE in gfc_resolve_filepos, at fortran/io.c:2853)Steven G. Kargl1-1/+1
2018-12-11 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/88249 * gfortran.h: Update prototype for gfc_resolve_filepos(). * io.c (gfc_resolve_filepos): Check for UNIT number if ERR= is present. Use passed in locus for error message. * resolve.c (gfc_resolve_code): Pass locus in gfc_resolve_filepos() call. 2018-12-11 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/88249 * gfortran.dg/pr88249.f90: New test. From-SVN: r267035
2018-12-09[multiple changes]Steven G. Kargl1-2/+2
2018-12-09 Fritz Reese <fritzoreese@gmail.com> PR fortran/88228 * resolve.c (resolve_operator): Do not call resolve_function. Break like other cases. 2018-12-09 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/88228 * gfortran.dg/pr88228.f90: New test. From-SVN: r266926
2018-12-09re PR fortran/88048 (ICE in check_data_variable, at fortran/resolve.c:15491)Steven G. Kargl1-1/+5
2018-12-08 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/88048 * resolve.c (check_data_variable): Named constant cannot be a data object. 2018-12-08 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/88048 * gfortran.dg/pr88048.f90: New test. From-SVN: r266916
2018-12-08re PR fortran/88357 (ICE in parse_associate, at fortran/parse.c:4568)Steven G. Kargl1-1/+2
2018-12-08 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/88357 * class.c (insert_component_ref): Check for NULL pointer and previous error message issued. * parse.c (parse_associate): Check for NULL pointer. * resolve.c (resolve_assoc_var): Check for NULL pointer. 2018-12-08 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.dg/pr88357_1.f90: New test. * gfortran.dg/pr88357_2.f90: New test. From-SVN: r266908
2018-11-242018-11-24 Paul Thomas <pault@gcc.gnu.org>Paul Thomas1-1/+1
PR fortran/888143 * resolve.c (resolve_variable): Check for associate names with NULL target. 2018-11-24 Paul Thomas <pault@gcc.gnu.org> PR fortran/888143 * gfortran.dg/associate_46.f90: New test. From-SVN: r266427
2018-11-18re PR fortran/70260 (ICE: gimplification failed)Thomas Koenig1-2/+6
2018-11-18 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/70260 * expr.c (gfc_check_assign): Reject assigning to an external symbol. (gfc_check_pointer_assign): Add suppress_type_test argument. Insert line after if. A non-proc pointer can not point to a constant. Only check types if suppress_type_test is false. * gfortran.h (gfc_check_pointer_assign): Add optional suppress_type_test argument. * resolve.c (gfc_resolve_code): Move up gfc_check_pointer_assign and give it the extra argument. (resolve_fl_procedure): Set error on value for a function with an inizializer. 2018-11-18 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/70260 * gfortran.dg/proc_ptr_result_5.f90: Add dg-error directive. * gfortran.dg/protected_4.f90: Split line to allow for extra error. * gfortran.dg/protected_6.f90: Likewise. * gfortran.dg/assign_11.f90: New test. * gfortran.dg/pointer_assign_12.f90: New test. From-SVN: r266248
2018-11-01re PR fortran/40196 ([F03] [F08] Type parameter inquiry (str%len, a%kind) ↵Paul Thomas1-3/+8
and Complex parts (z%re, z%im)) 2018-11-01 Paul Thomas <pault@gcc.gnu.org> PR fortran/40196 * dependency.c (are_identical_variables): Return false if the inquiry refs are not the same. (gfc_ref_needs_temporary_p): Break on an inquiry ref. * dump_parse_tree.c (show_ref): Show the inquiry ref type. * expr.c (gfc_free_ref_list): Break on an inquiry ref. (gfc_copy_ref): Copy the inquiry ref types. (find_inquiry_ref): New function. (simplify_const_ref, simplify_ref_chain): Call it. Add new arg to simplify_ref_chain. (gfc_simplify_expr): Use the new arg in call to simplify_ref_chain. (gfc_get_full_arrayspec_from_expr, gfc_is_coarray): Break on inquiry ref. (gfc_traverse_expr): Return true for inquiry ref. * frontend-passes.c (gfc_expr_walker): Break on inquiry ref. * gfortran.h : Add enums and union member in gfc_ref to implement inquiry refs. * intrinsic.c : Fix white nois. * match.c (gfc_match_assignment): A constant lavlue is an error. * module.c : Add DECL_MIO_NAME for inquiry_type and the mstring for inquiry_types. (mio_ref): Handle inquiry refs. * primary.c (is_inquiry_ref): New function. (gfc_match_varspec): Handle inquiry refs calling new function. (gfc_variable_attr): Detect inquiry ref for disambiguation with components. (caf_variable_attr): Treat inquiry and substring refs in the same way. * resolve.c (find_array_spec): ditto. (gfc_resolve_substring_charlen): If there is neither a charlen ref not an inquiry ref, return. (resolve_ref): Handle inqiry refs as appropriate. (resolve_allocate_expr): Entities with an inquiry ref cannot be allocated. * simplify.c (simplify_bound, simplify_cobound): Punt on inquiry refs. * trans-array.c (get_array_ctor_var_strlen): Break on inquiry ref. *trans-expr.c (conv_inquiry): New function. (gfc_conv_variable): Retain the last typespec to pass to conv_inquiry on detecting an inquiry ref. 2018-11-01 Paul Thomas <pault@gcc.gnu.org> PR fortran/40196 * gfortran.dg/inquiry_part_ref_1.f08: New test. * gfortran.dg/inquiry_part_ref_2.f90: New test. * gfortran.dg/inquiry_part_ref_3.f90: New test. From-SVN: r265729
2018-10-17Fix select-type regressionTobias Burnus1-1/+1
PR fortran/87632 * resolve.c (resolve_select_type): Use correct variable. PR fortran/87632 * gfortran.dg/select_type_47.f90: New. From-SVN: r265248
2018-10-17re PR fortran/56386 ([F03] ICE with ASSOCIATE construct and an derived type ↵Paul Thomas1-0/+18
array component) 2018-10-17 Paul Thomas <pault@gcc.gnu.org> PR fortran/56386 PR fortran/58906 PR fortran/77385 PR fortran/80260 PR fortran/82077 * resolve.c (resolve_variable): Fix up expressions with array associate names, where the parser did not detect that this is array and there was no array part_ref in the expression. 2018-10-17 Paul Thomas <pault@gcc.gnu.org> PR fortran/56386 PR fortran/58906 PR fortran/77385 * gfortran.dg/associate_44.f90 : New test. PR fortran/80260 * gfortran.dg/select_type_45.f90 : New test. PR fortran/82077 * gfortran.dg/select_type_46.f90 : New test. From-SVN: r265232
2018-10-15re PR fortran/87566 (ICE with class(*) and select)Paul Thomas1-3/+30
2018-10-15 Paul Thomas <pault@gcc.gnu.org> Tobias Burnus <burnus@gcc.gnu.org> PR fortran/87566 * resolve.c (resolve_assoc_var): Add missing array spec for class associate names. (resolve_select_type): Handle case where last typed component of the selector has a different type to the expression. * trans-expr.c (gfc_find_and_cut_at_last_class_ref): Replace call to gfc_expr_to_initialize with call to gfc_copy_expr. (gfc_conv_class_to_class): Guard assignment to 'len' field against case where zero constant is supplied. 2018-10-15 Paul Thomas <pault@gcc.gnu.org> Tobias Burnus <burnus@gcc.gnu.org> PR fortran/87566 * gfortran.dg/select_type_44.f90: New test. * gfortran.dg/associate_42.f90: New test. Co-Authored-By: Tobias Burnus <burnus@gcc.gnu.org> From-SVN: r265171
2018-10-11revert: re PR fortran/83522 (ICE on allocatable string reference, string(:)(:))Tobias Burnus1-7/+0
2018-10-11 Tobias Burnus <burnus@net-b.de> Revert: 2018-10-09 Tobias Burnus <burnus@net-b.de> PR fortran/83522 * resolve.c (resolve_ref): Reject nonscalar substring references. 2018-10-11 Tobias Burnus <burnus@net-b.de> Revert: 2018-10-09 Tobias Burnus <burnus@net-b.de> PR fortran/83522 * gfortran.dg/actual_array_substr_1.f90: Add dg-error, change to dg-do compile. * gfortran.dg/actual_array_substr_2.f90: Ditto. * gfortran.dg/array_initializer_1.f90: Use array element not size-one section. * gfortran.dg/array_substring.f90: New. From-SVN: r265059
2018-10-09re PR fortran/83522 (ICE on allocatable string reference, string(:)(:))Tobias Burnus1-0/+7
2018-10-09 Tobias Burnus <burnus@net-b.de> PR fortran/83522 * resolve.c (resolve_ref): Reject nonscalar substring references. PR fortran/83522 * gfortran.dg/actual_array_substr_1.f90: Add dg-error, change to dg-do compile. * gfortran.dg/actual_array_substr_2.f90: Ditto. * gfortran.dg/array_initializer_1.f90: Use array element not size-one section. * gfortran.dg/array_substring.f90: New. From-SVN: r264990
2018-10-06re PR fortran/83999 (ICE in gfc_trans_assignment_1, at ↵Paul Thomas1-1/+2
fortran/trans-expr.c:10233) 2018-10-06 Paul Thomas <pault@gcc.gnu.org> PR fortran/83999 * resolve.c (resolve_fl_procedure): Include class functions in the test that elemental function results be scalar. 2018-10-06 Paul Thomas <pault@gcc.gnu.org> PR fortran/83999 * gfortran.dg/elemental_function_4.f90 : New test. From-SVN: r264899
2018-09-20gfortran.h (gfc_str_startswith): New macro.Janus Weil1-3/+3
2018-09-20 Janus Weil <janus@gcc.gnu.org> * gfortran.h (gfc_str_startswith): New macro. * decl.c (variable_decl, gfc_match_end): Use it. * iresolve.c (is_trig_resolved): Ditto. * module.c (load_omp_udrs, read_module): Ditto. * options.c (gfc_handle_runtime_check_option): Ditto. * primary.c (match_arg_list_function): Ditto. * trans-decl.c (gfc_get_symbol_decl): Ditto. * trans-expr.c (gfc_conv_procedure_call): Ditto. * interface.c (dtio_op): Replace strncmp by strcmp. * resolve.c (resolve_actual_arglist, resolve_function): Ditto. * trans-expr.c (conv_arglist_function): Ditto. * trans-intrinsic.c (gfc_conv_ieee_arithmetic_function): Replace macro STARTS_WITH by gfc_str_startswith. From-SVN: r264448
2018-09-17re PR fortran/85954 (ICE in make_ssa_name_fn, at tree-ssanames.c:266)Paul Thomas1-1/+9
2018-09-17 Paul Thomas <pault@gcc.gnu.org> PR fortran/85954 * resolve.c (resolve_assoc_var): If the target expression is a deferred charlen dummy and the associate name shares the charlen, generate a new one. Make sure that new charlens are in the namespace list so that they get cleaned up. * trans-array.c (gfc_is_reallocatable_lhs): Associate names are not reallocatable. * trans-decl.c (gfc_get_symbol_decl): Put deferred character length dummy and result arrays on the deferred initialization list so that the variable length arrays can be correctly dealt with. * trans-expr.c (gfc_conv_string_length): Return if 'expr' is NULL rather than ICEing.. 2018-09-17 Paul Thomas <pault@gcc.gnu.org> PR fortran/85954 * gfortran.dg/deferred_character_21.f90 : New test. From-SVN: r264358
2018-09-11re PR fortran/87172 (Spurious "Derived type 'c_funptr' at (1) has not been ↵Janus Weil1-1/+1
declared" error after r263782) fix PR 87172 2018-09-11 Janus Weil <janus@gcc.gnu.org> PR fortran/87172 * resolve.c (resolve_fl_derived): If a type has the 'use_assoc' attribute, then it was declared in another module, so there should be no error that it has not been declared. 2018-09-11 Janus Weil <janus@gcc.gnu.org> PR fortran/87172 * gfortran.dg/iso_c_binding_only_2.f90: New test case. From-SVN: r264214
2018-08-25re PR fortran/86545 (ICE in transfer_expr on invalid WRITE statement)Janus Weil1-2/+3
fix PR 86545 2018-08-25 Janus Weil <janus@gcc.gnu.org> PR fortran/86545 * resolve.c (resolve_transfer): Correctly determine typespec for generic function calls, in order to throw a proper error. 2018-08-25 Janus Weil <janus@gcc.gnu.org> PR fortran/86545 * gfortran.dg/generic_35.f90: New test case. From-SVN: r263854
2018-08-23re PR fortran/86863 ([OOP][F2008] type-bound module procedure name not ↵Paul Thomas1-3/+11
recognized) 2017-08-23 Paul Thomas <pault@gcc.gnu.org> PR fortran/86863 * resolve.c (resolve_typebound_call): If the TBP is not marked as a subroutine, check the specific symbol. 2017-08-23 Paul Thomas <pault@gcc.gnu.org> PR fortran/86863 * gfortran.dg/submodule_32.f08: New test. From-SVN: r263799
2018-08-22re PR fortran/86888 ([F08] allocatable components of indirectly recursive type)Janus Weil1-22/+7
fix PR 86888 2018-08-22 Janus Weil <janus@gcc.gnu.org> PR fortran/86888 * decl.c (gfc_match_data_decl): Allow allocatable components of indirectly recursive type. * resolve.c (resolve_component): Remove two errors messages ... (resolve_fl_derived): ... and replace them by a new one. 2018-08-22 Janus Weil <janus@gcc.gnu.org> PR fortran/86888 * gfortran.dg/alloc_comp_basics_6.f90: Update an error message and add an additional case. * gfortran.dg/alloc_comp_basics_7.f90: New test case. * gfortran.dg/class_17.f03: Update error message. * gfortran.dg/class_55.f90: Ditto. * gfortran.dg/dtio_11.f90: Update error messages. * gfortran.dg/implicit_actual.f90: Add an error message. * gfortran.dg/typebound_proc_12.f90: Update error message. From-SVN: r263782
2018-08-12re PR fortran/86906 (erroneous name clash with renaming in use statement)Paul Thomas1-0/+1
2018-08-12 Paul Thomas <pault@gcc.gnu.org> PR fortran/86906 * resolve.c (resolve_fl_variable_derived): Check if the derived type is use associated before checking for the host association error. 2018-08-12 Paul Thomas <pault@gcc.gnu.org> PR fortran/86906 * gfortran.dg/use_rename_9.f90: New test. From-SVN: r263494
2018-08-10re PR fortran/57160 (short-circuit IF only with -ffrontend-optimize)Janus Weil1-1/+2
2018-08-10 Janus Weil <janus@gcc.gnu.org> PR fortran/57160 * invoke.texi (frontend-optimize): Mention short-circuiting. * options.c (gfc_post_options): Disable -ffrontend-optimize with -Og. * resolve.c (resolve_operator): Warn about short-circuiting only with -ffrontend-optimize. * trans-expr.c (gfc_conv_expr_op): Use short-circuiting operators only with -ffrontend-optimize. Without that flag, make sure that both operands are evaluated. 2018-08-10 Janus Weil <janus@gcc.gnu.org> PR fortran/57160 * gfortran.dg/actual_pointer_function_1.f90: Fix invalid test case. * gfortran.dg/inline_matmul_23.f90: Add option "-ffrontend-optimize". * gfortran.dg/short_circuiting_2.f90: New test case. * gfortran.dg/short_circuiting_3.f90: New test case. From-SVN: r263471
2018-07-20gfortran.h (gfc_symbol): Add pointer to next derived type.Andrew Benson1-11/+14
2018-07-20 Andrew Benson <abenson@carnegiescience.edu> * gfortran.h (gfc_symbol): Add pointer to next derived type. (gfc_dt_list, gfc_get_dt_list): Remove. (gfc_namespace): Replace gfc_dt_list with gfc_symbol. * parse.c (resolve_all_program_units): Replace gfc_free_dt_list() with simple nullification of gfc_derived_types. * resolve.c (resolve_global_procedure): Replace gfc_dt_list with gfc_symbol. (add_dt_to_dt_list): Change derived type linked list insertion to utilize dt_next pointers in gfc_symbol. * symbol.c (gfc_new_symbol, gfc_free_dt_list, gfc_symbol_done2) (get_iso_c_binding_dt, generate_isocbinding_symbol): Remove gfc_free_dt_list as gfc_dt_list is obsoleted. Change derived type linked list search/insertion to utilize dt_next pointers in gfc_symbol. * trans-types.c (gfc_get_derived_type): Change derived type linked list search to utilize dt_next pointers in gfc_symbol. From-SVN: r262909
2018-07-18re PR fortran/85599 (warn about short-circuiting of logical expressions for ↵Janus Weil1-5/+64
non-pure functions) 2018-07-18 Janus Weil <janus@gcc.gnu.org> Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/85599 * dump-parse-tree.c (show_attr): Add handling of implicit_pure. * frontend-passes.c (do_warn_function_elimination): Do not warn for pure functions. * gfortran.h: Add prototypes for gfc_pure_function and gfc_implicit_pure_function. * gfortran.texi: Add chapter on evaluation of logical expressions. * invoke.texi: Mention that -Wfunction-elimination is implied by -Wextra. * lang.opt: Make -Wextra imply -Wfunction-elimination. * resolve.c (pure_function): Rename to gfc_pure_function. (gfc_implicit_pure_function): New function. (check_pure_function): Use it here. (impure_function_callback): New function. (resolve_operator): Call it via gfc_expr_walker. 2018-07-18 Janus Weil <janus@gcc.gnu.org> PR fortran/85599 * gfortran.dg/function_optimize_5.f90: Add option '-faggressive-function-elimination' and update dg-warning clauses. * gfortran.dg/short_circuiting.f90: New test. Co-Authored-By: Thomas Koenig <tkoenig@gcc.gnu.org> From-SVN: r262860
2018-07-05re PR fortran/86408 (bogus error: ABSTRACT INTERFACE must not have an ↵Paul Thomas1-3/+4
assumed character length result (F2003: C418)) 2018-07-05 Paul Thomas <pault@gcc.gnu.org> PR fortran/86408 * resolve.c.c (resolve_contained_fntype): Reference to C418 is in F2008 and not F2003. (resolve_function): Ditto in error message. Also, exclude deferred character length results from the error. 2018-07-05 Paul Thomas <pault@gcc.gnu.org> PR fortran/86408 * gfortran.dg/deferred_character_20.f90: New test. From-SVN: r262445
2018-06-22re PR fortran/86281 (SEGV in fortran/resolve.c:resolve_function)Paul Thomas1-0/+1
2018-06-22 Paul Thomas <pault@gcc.gnu.org> Rainer Orth <ro@gcc.gnu.org> PR fortran/86281 * resolve.c (resolve_contained_fntype): Check for the charlen before testing the length. 2018-06-22 Paul Thomas <pault@gcc.gnu.org> PR fortran/86281 * gfortran.dg/assumed_charlen_function_7.f90: Add -std=legacy. Co-Authored-By: Rainer Orth <ro@gcc.gnu.org> From-SVN: r261975
2018-06-21re PR fortran/49630 ([OOP] ICE on obsolescent deferred-length type bound ↵Paul Thomas1-3/+15
character function) 2018-06-21 Paul Thomas <pault@gcc.gnu.org> PR fortran/49630 * resolve.c (resolve_contained_fntype): Change standard ref. from F95 to F2003: C418. Correct a spelling error in a comment. It is an error for an abstract interface to have an assumed character length result. * trans-expr.c (gfc_conv_procedure_call): Likewise change the standard reference. 2018-06-21 Paul Thomas <pault@gcc.gnu.org> PR fortran/49630 * gfortran.dg/assumed_charlen_function_7.f90: New test. From-SVN: r261868
2018-06-21re PR fortran/83118 (Bad intrinsic assignment of class(*) array component of ↵Paul Thomas1-0/+5
derived type) 2018-06-21 Paul Thomas <pault@gcc.gnu.org> PR fortran/83118 * resolve.c (resolve_ordinary_assign): Force the creation of a vtable for assignment of non-polymorphic expressions to an unlimited polymorphic object. * trans-array.c (gfc_alloc_allocatable_for_assignment): Use the size of the rhs type for such assignments. Set the dtype, _len and vptrs appropriately. * trans-expr.c (gfc_trans_assignment): Force the use of the _copy function for these assignments. 2018-06-21 Paul Thomas <pault@gcc.gnu.org> PR fortran/83118 * gfortran.dg/unlimited_polymorphic_30.f03: New test. From-SVN: r261857
2018-06-09re PR fortran/38351 (Poor error message for rank mismatch in operator args)Steven G. Kargl1-1/+7
2018-06-09 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/38351 * resolve.c (resolve_operator): Provide better error message for derived type entity used in an binary intrinsic numeric operator. 2018-06-09 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/38351 * gfortran.dg/pr38351.f90: New test. * gfortran.dg/typebound_operator_4.f03: Adjust for new error message. From-SVN: r261363
2018-06-04re PR fortran/85981 (ICE in gfc_trans_string_copy, at fortran/trans-expr.c:6539)Steven G. Kargl1-2/+7
2018-06-04 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/85981 * resolve.c (resolve_allocate_deallocate): Check errmsg is default character kind. 2018-06-04 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/85981 * gfortran.dg/allocate_alloc_opt_14.f90: New test. * gfortran.dg/allocate_alloc_opt_1.f90: Update error string. * gfortran.dg/allocate_stat_2.f90: Ditto. * gfortran.dg/deallocate_alloc_opt_1.f90: Ditto. From-SVN: r261154
2018-05-25re PR fortran/85839 ([F2018] warn for obsolescent features)Janus Weil1-0/+7
2018-05-25 Janus Weil <janus@gcc.gnu.org> PR fortran/85839 * match.c (gfc_match_block_data): Call gfc_notify_std to warn about an obsolescent feature in Fortran 2018. (gfc_match_equivalence): Ditto. * resolve.c (resolve_common_blocks): Ditto. (gfc_resolve_forall): Ditto. * symbol.c (gfc_define_st_label): Ditto. 2018-05-25 Janus Weil <janus@gcc.gnu.org> PR fortran/85839 * gfortran.dg/f2018_obs.f90: New test case. From-SVN: r260705
2018-05-25re PR fortran/85543 (ICE in update_current_proc_array_outer_dependency, at ↵Steven G. Kargl1-2/+2
fortran/resolve.c:3060) 2018-05-24 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/85543 * resolve.c (update_current_proc_array_outer_dependency): Avoid NULL pointer dereference. 2018-05-24 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/85543 * gfortran.dg/pr85543.f90: New test. From-SVN: r260704
2018-05-24re PR fortran/85780 (ICE in resolve_fl_procedure, at fortran/resolve.c:12504)Steven G. Kargl1-1/+1
2018-05-24 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/85780 * resolve.c (resolve_fl_procedure): Avoid NULL dereference. 2018-05-24 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/85780 * gfortran.dg/pr85780.f90: New test. From-SVN: r260698
2018-05-24re PR fortran/85895 (ICE in gfc_conv_array_ref, at fortran/trans-array.c:3518)Steven G. Kargl1-0/+2
2018-05-24 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/85895 * resolve.c (resolve_sync): Resolve expression before checking for an error. 2018-05-24 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/85895 * gfortran.dg/coarray_3.f90: Fix invalid testcase. * gfortran.dg/pr85895.f90: New test. From-SVN: r260696
2018-05-20re PR fortran/80657 (Loop in character function declaration)Paul Thomas1-2/+9
2018-05-19 Paul Thomas <pault@gcc.gnu.org> PR fortran/80657 * resolve.c (flag_fn_result_spec): Use the 'sym' argument to test for self refs to the function result in the character len expression. If a self reference is found, emit an error and return true. (resolve_fntype): Use the function symbol in the calls to the above. 2018-05-19 Paul Thomas <pault@gcc.gnu.org> PR fortran/80657 * gfortran.dg/char_result_18.f90: New test. From-SVN: r260415
2018-05-10re PR fortran/68846 (Pointer function as LValue doesn't work when the ↵Paul Thomas1-0/+2
assignment regards a dummy argument.) 2018-05-10 Paul Thomas <pault@gcc.gnu.org> PR fortran/68846 PR fortran/70864 * resolve.c (get_temp_from_expr): The temporary must not have dummy or intent attributes. 2018-05-10 Paul Thomas <pault@gcc.gnu.org> PR fortran/68846 * gfortran.dg/temporary_3.f90 : New test. PR fortran/70864 * gfortran.dg/temporary_2.f90 : New test. From-SVN: r260113
2018-04-09re PR fortran/51260 (PARAMETER array with constructor initializer: ↵Thomas Koenig1-0/+10
Compile-time simplify single element access) 2018-04-09 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/51260 * resolve.c (resolve_variable): Simplify cases where access to a parameter array results in a single constant. 2018-04-09 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/51260 * gfortran.dg/parameter_array_element_3.f90: New test. From-SVN: r259256
2018-03-11re PR fortran/83939 (Constraint C1290 (elemental function cannot be ↵Steven G. Kargl1-0/+13
allocatable) not enforced) 2018-03-11 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/83939 * resolve.c (resolve_fl_procedure): Enforce F2018:C15100. 2018-03-11 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/83939 * gfortran.dg/pr83939.f90 From-SVN: r258437
2018-03-03re PR fortran/80965 (ICE with class argument and -O2 optimization)Paul Thomas1-1/+1
2018-03-03 Paul Thomas <pault@gcc.gnu.org> PR fortran/80965 * resolve.c (build_loc_call): Change symtree name from 'loc' to '_loc'. 2018-03-03 Paul Thomas <pault@gcc.gnu.org> PR fortran/80965 * gfortran.dg/select_type_41.f90: New test. From-SVN: r258195
2018-02-25re PR fortran/78238 ([OOP] ICE: verify_gimple failed, with -fdefault-integer-8)Thomas Koenig1-1/+8
2018-02-25 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/78238 * gfortran.h (gfc_integer_4_kind): Define. * resolve.c (resolve_select_type): Make sure that the kind of c->high is gfc_integer_4_kind. 2018-02-25 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/78238 * gfortran.dg/select_type_40.f90: New test. From-SVN: r257968
2018-02-19re PR fortran/83344 (Use of uninitialized memory with ASSOCIATE and strings)Paul Thomas1-21/+17
2018-02-19 Paul Thomas <pault@gcc.gnu.org> PR fortran/83344 PR fortran/83975 * resolve.c (resolve_assoc_var): Rearrange the logic for the determination of the character length of associate names. If the associate name is missing a length expression or the length expression is not a constant and the target is not a variable, make the associate name allocatable and deferred length. * trans-decl.c (gfc_get_symbol_decl): Null the character length backend_decl for deferred length associate names that are not variables. Set 'length' to gfc_index_zero_node for character associate names, whose character length is a PARM_DECL. 2018-02-19 Paul Thomas <pault@gcc.gnu.org> PR fortran/83344 PR fortran/83975 * gfortran.dg/associate_22.f90: Enable commented out test. * gfortran.dg/associate_36.f90: New test. From-SVN: r257827
2018-02-17re PR fortran/84115 (Failure in associate construct with concatenated ↵Paul Thomas1-1/+14
character target) 2018-02-17 Paul Thomas <pault@gcc.gnu.org> PR fortran/84115 * resolve.c (resolve_assoc_var): If a non-constant target expr. has no string length expression, make the associate variable into a deferred length, allocatable symbol. * trans-decl.c (gfc_is_reallocatable_lhs): Add and use a ptr to the symbol. * trans-stmt.c (trans_associate_var): Null and free scalar associate names that are allocatable. After assignment, remove the allocatable attribute to prevent reallocation. 2018-02-17 Paul Thomas <pault@gcc.gnu.org> PR fortran/84115 * gfortran.dg/associate_35.f90: Remove error, add stop n's and change to run. From-SVN: r257781
2018-02-12re PR fortran/84273 ([F03] Reject allocatable passed-object dummy argument ↵Janus Weil1-4/+4
(proc_ptr_47.f90)) 2018-02-12 Janus Weil <janus@gcc.gnu.org> PR fortran/84273 * resolve.c (resolve_component): Fix checks of passed argument in procedure-pointer components. 2018-02-12 Janus Weil <janus@gcc.gnu.org> PR fortran/84273 * gfortran.dg/proc_ptr_47.f90: Fix invalid test case. * gfortran.dg/proc_ptr_comp_pass_4.f90: Fix and extend test case. From-SVN: r257590
2018-02-11re PR fortran/35299 (scope of variables in statement function do not acquire ↵Francois-Xavier Coudert1-2/+5
rank from host) 2018-02-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> PR fortran/35299 * gfortran.dg/statement_function_3.f: New test. 2018-02-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> PR fortran/35299 * resolve.c (resolve_formal_arglist): Update error message. From-SVN: r257566
2018-02-01PR 83975 Associate target with non-constant character lengthJanne Blomqvist1-5/+10
When associating a variable of type character, if the length of the target isn't known at compile time, generate an error. See PR 83344 for more details. Regtested on x86_64-pc-linux-gnu. gcc/fortran/ChangeLog: 2018-02-01 Janne Blomqvist <jb@gcc.gnu.org> PR 83975 PR 83344 * resolve.c (resolve_assoc_var): Generate an error if target length unknown. From-SVN: r257310
2018-01-29re PR fortran/84073 (In -fc-prototypes fixed (nonzero) length strings are ↵Thomas Koenig1-0/+20
mapped to plain char in prototype.) 2017-01-29 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/84073 * resolve.c (resolve_component): Ensure BIND(C) character components have length one. (resolve_symbol): Likewise for variables. 2017-01-29 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/84073 * gfortran.dg/bind_c_usage_31.f90: New test. From-SVN: r257138
2018-01-26Partial Failed Images patchDamian Rouson1-0/+4
Co-Authored-By: Alessandro Fanfarillo <fanfarillo.gcc@gmail.com> Co-Authored-By: Soren Rasmussen <s.c.rasmussen@gmail.com> From-SVN: r257105
2018-01-22PR 78534, 83704 Large character lengthsJanne Blomqvist1-6/+5
This patch fixes various parts of the code to use a larger type than int for the character length. Depending on the situation, HOST_WIDE_INT, size_t, or gfc_charlen_t is appropriate. Regtested on x86_64-pc-linux-gnu and i686-pc-linux-gnu. gcc/fortran/ChangeLog: 2018-01-22 Janne Blomqvist <jb@gcc.gnu.org> PR 78534 PR 83704 * arith.c (gfc_arith_concat): Use size_t for string length. (gfc_compare_string): Likewise. (gfc_compare_with_Cstring): Likewise. * array.c (gfc_resolve_character_array_constructor): Use HOST_WIDE_INT, gfc_mpz_get_hwi. * check.c (gfc_check_fe_runtime_error): Use size_t. * data.c (create_character_initializer): Use HOST_WIDE_INT, gfc_extract_hwi. * decl.c (gfc_set_constant_character_len): Use gfc_charlen_t. (add_init_expr_to_sym): Use HOST_WIDE_INT. * expr.c (gfc_build_init_expr): Use HOST_WIDE_INT, gfc_extract_hwi. (gfc_apply_init): Likewise. * match.h (gfc_set_constant_character_len): Update prototype. * primary.c (match_string_constant): Use size_t. * resolve.c (resolve_ordinary_assign): Use HOST_WIDE_INT, gfc_mpz_get_hwi. * simplify.c (init_result_expr): Likewise. (gfc_simplify_len_trim): Use size_t. * target-memory.c (gfc_encode_character): Use size_t. (gfc_target_encode_expr): Use HOST_WIDE_INT, gfc_mpz_get_hwi. (interpret_array): Use size_t. (gfc_interpret_character): Likewise. * target-memory.h (gfc_encode_character): Update prototype. (gfc_interpret_character): Likewise. (gfc_target_interpret_expr): Likewise. * trans-const.c (gfc_build_string_const): Use size_t for length argument. (gfc_build_wide_string_const): Likewise. * trans-const.h (gfc_build_string_const): Likewise. (gfc_build_wide_string_const): Likewise. 2018-01-22 Janne Blomqvist <jb@gcc.gnu.org> PR 78534 PR 83704 * gfortran.dg/string_1.f90: Remove printing the length. From-SVN: r256944