aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/array.c
AgeCommit message (Collapse)AuthorFilesLines
2008-11-01re PR fortran/19925 (Implied do-loop in an initialization expression is broken)Steven G. Kargl1-8/+1
2008-11-01 Steven G. Kargl <kargls@comcast.net> PR fortran/19925 * trans-array.c (gfc_trans_array_constructor_value): Fix comment. (gfc_conv_array_initializer): Convert internal_error() to gfc_error_now. * array.c: Remove GFC_MAX_AC_EXPAND macro. (gfc_expand_constructor): Use gfc_option.flag_max_array_constructor. * gfortran.h (gfc_option): Add flag_max_array_constructor member. * lang.opt: Add -fmax-array-constructor option. * expr.c (gfc_match_init_expr): Fix error message to mention new option. * invoke.texi: Document new option. * options.c (gfc_init_options): Set default value for new option. (gfc_handle_option): Deal with commandline. From-SVN: r141518
2008-10-09re PR fortran/35723 (Can't use run-time array element in character declaration)Daniel Kraft1-4/+4
2008-10-09 Daniel Kraft <d@domob.eu> PR fortran/35723 * gfortran.h (gfc_suppress_error): Removed from header. (gfc_push_suppress_errors), (gfc_pop_suppress_errors): New methods. * array.c (gfc_array_size): Use new gfc_push/pop_suppress_errors instead of directly changing gfc_suppress_error. * intrinsic.c (gfc_intrinsic_func_interface): Ditto. (gfc_intrinsic_sub_interface): Ditto. * error.c (suppress_errors): Made static from `gfc_suppress_error'. (gfc_push_suppress_errors), (gfc_pop_suppress_errors): New methods. (gfc_notify_std), (gfc_error): Use new static name of global. * expr.c (check_arglist), (check_references): New methods. (check_restricted): Check arglists and references of EXPR_FUNCTIONs and EXPR_VARAIBALEs, respectively. Allow PARAMETER symbols. 2008-10-09 Daniel Kraft <d@domob.eu> PR fortran/35723 * gfortran.dg/restricted_expression_1.f90: New test. * gfortran.dg/restricted_expression_2.f90: New test. * gfortran.dg/restricted_expression_3.f90: New test. From-SVN: r141001
2008-08-22re PR fortran/32095 (Accepts invalid character(len(a)),dimension(1) :: a)Daniel Kraft1-0/+4
2008-08-22 Daniel Kraft <d@domob.eu> PR fortran/32095 PR fortran/34228 * gfortran.h (in_prefix): New global. (gfc_check_symbol_typed), (gfc_check_expr_typed): New methods. * array.c (match_array_element_spec): Check that bounds-expressions don't have symbols not-yet-typed in them. * decl.c (var_element): Check that variable used is already typed. (char_len_param_value): Check that expression does not contain not-yet-typed symbols. (in_prefix): New global. (gfc_match_prefix): Record using `in_prefix' if we're at the moment parsing a prefix or not. * expr.c (gfc_expr_check_typed): New method. * parse.c (verify_st_order): New argument to disable error output. (check_function_result_typed): New helper method. (parse_spec): Check that the function-result declaration, if given in a prefix, contains no not-yet-typed symbols when the IMPLICIT rules are parsed. * symbol.c (gfc_check_symbol_typed): Check that a symbol already has a type associated to it, otherwise use the IMPLICIT rules or signal an error. 2008-08-22 Daniel Kraft <d@domob.eu> PR fortran/32095 PR fortran/34228 * gfortran.dg/used_before_typed_1.f90: New test. * gfortran.dg/used_before_typed_2.f90: New test. * gfortran.dg/used_before_typed_3.f90: New test. * gfortran.dg/array_constructor_26.f03: Add -std=gnu to not enable legacy-behaviour for the new check. * gfortran.dg/array_constructor_27.f03: Ditto. * gfortran.dg/blockdata_4.f90: Ditto. * gfortran.dg/bound_2.f90: Reordered declarations to satisfy the check. * gfortran.dg/result_in_spec_1.f90: Ditto. * gfortran.dg/argument_checking_7.f90: Adapted expected error messages. From-SVN: r139425
2008-07-29gfortran.h (try): Remove macro.Kaveh R. Ghazi1-42/+42
* gfortran.h (try): Remove macro. Replace try with gfc_try throughout. * array.c: Likewise. * check.c: Likewise. * cpp.c: Likewise. * cpp.h: Likewise. * data.c: Likewise. * data.h: Likewise. * decl.c: Likewise. * error.c: Likewise. * expr.c: Likewise. * interface.c: Likewise. * intrinsic.c: Likewise. * intrinsic.h: Likewise. * io.c: Likewise. * match.h: Likewise. * parse.c: Likewise. * parse.h: Likewise. * resolve.c: Likewise. * scanner.c: Likewise. * simplify.c: Likewise. * symbol.c: Likewise. * trans-openmp.c: Likewise. * trans-types.c: Likewise. From-SVN: r138226
2008-07-21fmt_g0_3.f08: Fix typo in expected error message.Ralf Wildenhues1-2/+2
gcc/testsuite/ * gfortran.dg/fmt_g0_3.f08: Fix typo in expected error message. gcc/fortran/ * expr.c (gfc_check_pointer_assign): Fix typo in string. * io.c (check_format): Fix typo in string. Fix comment typos. * parse.c (gfc_global_used): Likewise. * resolve.c (resolve_allocate_expr): Likewise. * symbol.c (gfc_set_default_type): Likewise. * arith.c: Fix typos in comments. * array.c: Likewise. * data.c: Likewise. * decl.c: Likewise. * dependency.c: Likewise. * f95-lang.c: Likewise. * gfortran.h: Likewise. * matchexp.c: Likewise. * module.c: Likewise. * primary.c: Likewise. * scanner.c: Likewise. * trans-array.c: Likewise. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-expr.c: Likewise. * trans-intrinsic.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. * trans.h: Likewise. From-SVN: r138040
2008-07-19gfortran.h (new): Remove macro.Kaveh R. Ghazi1-12/+12
* gfortran.h (new): Remove macro. * array.c (gfc_append_constructor, match_array_list, gfc_match_array_constructor): Likewise. * bbt.c (insert, gfc_insert_bbt): Likewise. * decl.c (var_element, top_var_list, top_val_list, gfc_match_data, get_proc_name): Likewise. * expr.c (gfc_copy_actual_arglist): Likewise. * interface.c (compare_actual_formal, check_new_interface, gfc_add_interface): Likewise. * intrinsic.c gfc_convert_type_warn, gfc_convert_chartype): Likewise. * io.c (match_io_iterator, match_io_list): Likewise. * match.c (match_forall_header): Likewise. * matchexp.c (build_node): Likewise. * module.c (gfc_match_use): Likewise. * scanner.c (load_file): Likewise. * st.c (gfc_append_code): Likewise. * symbol.c (save_symbol_data, gfc_get_sym_tree, gfc_undo_symbols, gfc_commit_symbols): Likewise. * trans-common.c (build_field): Likewise. * trans-decl.c (gfc_finish_var_decl): Likewise. * trans-expr.c (gfc_free_interface_mapping, gfc_get_interface_mapping_charlen, gfc_add_interface_mapping, gfc_finish_interface_mapping, gfc_apply_interface_mapping_to_expr): Likewise. * trans.h (gfc_interface_sym_mapping): Likewise. From-SVN: r137982
2008-07-17re PR fortran/36825 ([F08] Rank > 7 arrays [will break library ABI] ↵Tobias Burnus1-1/+1
libgfortran I/O+intrinsics:) 2008-07-17 Tobias Burnus <burnus@net-b.de> PR fortran/36825 PR fortran/36824 * array.c (gfc_match_array_spec): Fix array-rank check. * resolve.c (resolve_fl_derived): Fix constentness check for the array dimensions. 2008-07-17 Tobias Burnus <burnus@net-b.de> PR fortran/36825 PR fortran/36824 * gfortran.dg/rank_2.f90: Add additional array-rank test. * gfortran.dg/array_4.f90: New. From-SVN: r137910
2008-06-20arith.c (hollerith2representation): Fix for -Wc++-compat.Kaveh R. Ghazi1-1/+1
* arith.c (hollerith2representation): Fix for -Wc++-compat. * array.c (gfc_get_constructor): Likewise. * decl.c (gfc_get_data_variable, gfc_get_data_value, gfc_get_data, create_enum_history, gfc_match_final_decl): Likewise. * error.c (error_char): Likewise. * expr.c (gfc_get_expr, gfc_copy_expr): Likewise. * gfortran.h (gfc_get_charlen, gfc_get_array_spec, gfc_get_component, gfc_get_formal_arglist, gfc_get_actual_arglist, gfc_get_namelist, gfc_get_omp_clauses, gfc_get_interface, gfc_get_common_head, gfc_get_dt_list, gfc_get_array_ref, gfc_get_ref, gfc_get_equiv, gfc_get_case, gfc_get_iterator, gfc_get_alloc, gfc_get_wide_string): Likewise. * interface.c (count_types_test): Likewise. * intrinsic.c (add_char_conversions, gfc_intrinsic_init_1): Likewise. * io.c (gfc_match_open, gfc_match_close, match_filepos, match_io, gfc_match_inquire, gfc_match_wait): Likewise. * match.c (gfc_match, match_forall_iterator): Likewise. * module.c (gfc_get_pointer_info, gfc_get_use_rename, add_fixup, add_true_name, parse_string, write_atom, quote_string, mio_symtree_ref, mio_gmp_real, write_common_0): Likewise. * options.c (gfc_post_options): Likewise. * primary.c (match_integer_constant, match_hollerith_constant, match_boz_constant, match_real_constant, gfc_get_structure_ctor_component, gfc_match_structure_constructor): Likewise. * scanner.c (gfc_widechar_to_char, add_path_to_list, add_file_change, load_line, get_file, preprocessor_line, load_file, unescape_filename, gfc_read_orig_filename): Likewise. * simplify.c (gfc_simplify_ibits, gfc_simplify_ishft, gfc_simplify_ishftc): Likewise. * symbol.c (gfc_get_st_label, gfc_get_namespace, gfc_new_symtree, gfc_get_uop, gfc_new_symbol, save_symbol_data, gfc_get_gsymbol): Likewise. * target-memory.c (gfc_target_interpret_expr): Likewise. * trans-const.c (gfc_build_wide_string_const): Likewise. * trans-expr.c (gfc_add_interface_mapping): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_conversion, gfc_conv_intrinsic_int, gfc_conv_intrinsic_lib_function, gfc_conv_intrinsic_cmplx, gfc_conv_intrinsic_ctime, gfc_conv_intrinsic_fdate, gfc_conv_intrinsic_ttynam, gfc_conv_intrinsic_minmax, gfc_conv_intrinsic_minmax_char, gfc_conv_intrinsic_ishftc, gfc_conv_intrinsic_index_scan_verify, gfc_conv_intrinsic_merge, gfc_conv_intrinsic_trim): Likewise. * trans.c (gfc_get_backend_locus): Likewise. * trans.h (gfc_get_ss): Likewise. From-SVN: r136982
2008-06-18PR fortran/36517, fortran/36492Daniel Kraft1-19/+23
2008-06-18 Daniel Kraft <d@domob.eu> PR fortran/36517, fortran/36492 * gfortran.dg/array_constructor_25.f03: New test. * gfortran.dg/array_constructor_26.f03: New test. * gfortran.dg/array_constructor_27.f03: New test. * gfortran.dg/array_constructor_28.f03: New test. * gfortran.dg/array_constructor_29.f03: New test. * gfortran.dg/array_constructor_30.f03: New test. * gfortran.dg/array_constructor_type_19.f03: New test. * gfortran.dg/array_constructor_type_20.f03: New test. * gfortran.dg/array_constructor_type_21.f03: New test. 2008-06-18 Daniel Kraft <d@domob.eu> PR fortran/36517, fortran/36492 * array.c (gfc_resolve_character_array_constructor): Call gfc_set_constant_character_len with changed length-chec argument. * decl.c (gfc_set_constant_character_len): Changed array argument to be a generic length-checking argument that can be used for correct checking with typespec and in special cases where the should-be length is different from the target length. (build_struct): Call gfc_set_constant_character_len with changed length checking argument and introduced additional checks for exceptional conditions on invalid code. (add_init_expr_to_sym), (do_parm): Call gfc_set_constant_character_len with changed argument. * match.h (gfc_set_constant_character_len): Changed third argument to int for the should-be length rather than bool. From-SVN: r136894
2008-06-17re PR fortran/36112 (Bounds-checking on character length not working for ↵Daniel Kraft1-51/+64
array-constructors) 2008-06-17 Daniel Kraft <d@domob.eu> PR fortran/36112 * array.c (gfc_resolve_character_array_constructor): Check that all elements with constant character length have the same one rather than fixing it if no typespec is given, emit an error if they don't. Changed return type to "try" and return FAILURE for the case above. (gfc_resolve_array_constructor): Removed unneeded call to gfc_resolve_character_array_constructor in this function. * gfortran.h (gfc_resolve_character_array_constructor): Returns try. * trans-array.c (get_array_ctor_strlen): Return length of first element rather than last element. * resolve.c (gfc_resolve_expr): Handle FAILURE return from gfc_resolve_character_array_constructor. 2008-06-17 Daniel Kraft <d@domob.eu> PR fortran/36112 * gfortran.dg/bounds_check_array_ctor_1.f90: New test. * gfortran.dg/bounds_check_array_ctor_2.f90: New test. * gfortran.dg/bounds_check_array_ctor_3.f90: New test. * gfortran.dg/bounds_check_array_ctor_4.f90: New test. * gfortran.dg/bounds_check_array_ctor_5.f90: New test. * gfortran.dg/bounds_check_array_ctor_6.f90: New test. * gfortran.dg/bounds_check_array_ctor_7.f90: New test. * gfortran.dg/bounds_check_array_ctor_8.f90: New test. * gfortran.dg/arrayio_0.f90: Fixed invalid array constructor. * gfortran.dg/char_cons_len.f90: Ditto. * gfortran.dg/char_initializer_actual.f90: Ditto. * gfortran.dg/pr15959.f90: Ditto. * gfortran.dg/transfer_simplify_2.f90: Ditto. * gfortran.dg/char_length_1.f90: Changed expected error messages. From-SVN: r136872
2008-05-16libgfortran.h: Increase GFC_MAX_DIMENSIONS to 15.Tobias Burnus1-0/+6
2008-05-16 Tobias Burnus <burnus@net-b.de> * libgfortran.h: Increase GFC_MAX_DIMENSIONS to 15. * array.c (gfc_match_array_spec): Error with -std=f2003 if rank > 7. 2008-05-16 Tobias Burnus <burnus@net-b.de> * gfortran.dg/rank_1.f90 * gfortran.dg/rank_2.f90 From-SVN: r135442
2008-05-16re PR fortran/27997 (Fortran 2003: Support type-spec for array constructor)Daniel Kraft1-14/+97
2008-04-16 Daniel Kraft <d@domob.eu> PR fortran/27997 * gfortran.h: Added field "length_from_typespec" to gfc_charlength. * aray.c (gfc_match_array_constructor): Added code to parse * typespec. (check_element_type, check_constructor_type, gfc_check_constructor_type): Extended to support explicit typespec on constructor. (gfc_resolve_character_array_constructor): Pad strings correctly for explicit, constant character length. * trans-array.c: New static global variable * "typespec_chararray_ctor" (gfc_trans_array_constructor): New code to support explicit but dynamic character lengths. 2008-04-16 Daniel Kraft <d@domob.eu> PR fortran/27997 * gfortran.dg/array_constructor_type_1.f03: New test * gfortran.dg/array_constructor_type_2.f03: New test * gfortran.dg/array_constructor_type_3.f03: New test * gfortran.dg/array_constructor_type_4.f03: New test * gfortran.dg/array_constructor_type_5.f03: New test * gfortran.dg/array_constructor_type_6.f03: New test * gfortran.dg/array_constructor_type_7.f03: New test * gfortran.dg/array_constructor_type_8.f03: New test * gfortran.dg/array_constructor_type_9.f: New test * gfortran.dg/array_constructor_type_10.f03: New test * gfortran.dg/array_constructor_type_11.f03: New test * gfortran.dg/array_constructor_type_12.f03: New test * gfortran.dg/array_constructor_type_13.f90: New test * gfortran.dg/array_constructor_type_14.f03: New test * gfortran.dg/array_constructor_type_15.f03: New test * gfortran.dg/array_constructor_type_16.f03: New test * gfortran.dg/array_constructor_type_17.f03: New test * gfortran.dg/array_constructor_type_18.f03: New test From-SVN: r135439
2008-02-24arith.c: Update copyright years.Tobias Schlüter1-1/+1
* arith.c: Update copyright years. * arith.h: Likewise. * array.c: Likewise. * bbt.c: Likewise. * check.c: Likewise. * data.c: Likewise. * data.h: Likewise. * decl.c: Likewise. * dependency.c: Likewise. * dependency.h: Likewise. * dump-parse-tree.c: Likewise. * error.c: Likewise. * expr.c: Likewise. * gfc-internals.texi: Likewise. * gfortran.h: Likewise. * gfortran.texi: Likewise. * gfortranspec.c: Likewise. * interface.c: Likewise. * intrinsic.c: Likewise. * intrinsic.h: Likewise. * intrinsic.texi: Likewise. * invoke.texi: Likewise. * io.c: Likewise. * iresolve.c: Likewise. * iso-c-binding.def: Likewise. * iso-fortran-env.def: Likewise. * lang-specs.h: Likewise. * lang.opt: Likewise. * libgfortran.h: Likewise. * match.c: Likewise. * match.h: Likewise. * matchexp.c: Likewise. * misc.c: Likewise. * module.c: Likewise. * openmp.c: Likewise. * options.c: Likewise. * parse.c: Likewise. * parse.h: Likewise. * primary.c: Likewise. * resolve.c: Likewise. * scanner.c: Likewise. * simplify.c: Likewise. * st.c: Likewise. * symbol.c: Likewise. * target-memory.c: Likewise. * target-memory.h: Likewise. * trans-array.h: Likewise. * trans-const.h: Likewise. * trans-stmt.h: Likewise. * trans-types.c: Likewise. * trans-types.h: Likewise. * types.def: Likewise. From-SVN: r132600
2008-02-05re PR fortran/34945 (LBOUND fails for array with KIND(complex) used in ↵Paul Thomas1-9/+15
zero-sized dimension) 2008-02-05 Paul Thomas <pault@gcc.gnu.org> PR fortran/34945 * array.c (match_array_element_spec): Remove check for negative array size. (gfc_resolve_array_spec): Add check for negative size. 2008-02-05 Paul Thomas <pault@gcc.gnu.org> PR fortran/34945 * gfortran.dg/bounds_check_13.f: New test. From-SVN: r132121
2008-01-27re PR fortran/34990 (ICE in gfc_typenode_for_spec, at fortran/trans-types.c:842)Jerry DeLisle1-1/+0
2008-01-27 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/34990 * array.c (gfc_check_constructor_type): Revert clearing the expression. From-SVN: r131890
2008-01-20re PR fortran/34784 (implicit character(s) hides type of selected_int_kind ↵Paul Thomas1-0/+1
intrinsic) 2008-01-20 Paul Thomas <pault@gcc.gnu.org> PR fortran/34784 * array.c (gfc_check_constructor_type): Clear the expression ts so that the checking starts from the deepest level of array constructor. * primary.c (match_varspec): If an unknown type is changed to default character and the attempt to match a substring fails, change it back to unknown. PR fortran/34785 * trans-array.c (gfc_add_loop_ss_code) : If ss->string_length is NULL for an array constructor, use the cl.length expression to build it. (gfc_conv_array_parameter): Change call to gfc_evaluate_now to a tree assignment. 2008-01-20 Paul Thomas <pault@gcc.gnu.org> PR fortran/34784 * gfortran.dg/array_constructor_20.f90: New test. * gfortran.dg/mapping_2.f90: Correct ubound expression for h4. PR fortran/34785 * gfortran.dg/array_constructor_21.f90: New test. From-SVN: r131675
2007-09-02re PR fortran/33276 (465.tonto in SPEC CPU 2006 fails to compile)H.J. Lu1-0/+1
gcc/fortran/ 2007-09-02 H.J. Lu <hongjiu.lu@intel.com> PR fortran/33276 * array.c (expand_iterator): Initialize frame.prev. gcc/testsuite/ 2007-09-02 H.J. Lu <hongjiu.lu@intel.com> PR fortran/33276 * gfortran.fortran-torture/compile/pr33276.f90: New. From-SVN: r128024
2007-08-01arith.c: Change copyright header to refer to version 3 of the GNU General ↵Nick Clifton1-4/+3
Public... * arith.c: Change copyright header to refer to version 3 of the GNU General Public License and to point readers at the COPYING3 file and the FSF's license web page. * openmp.c, interface.c, intrinsic.c, trans-array.c, trans-expr.c, symbol.c, iso-fortran-env.def, intrinsic.h, decl.c, trans-array.h, matchexp.c, dump-parse-tree.c, trans-common.c, array.c, Make-lang.in, trans-openmp.c, gfortran.h, error.c, iso-c-binding.def, lang.opt, data.c, trans-const.c, trans-stmt.c, expr.c, trans-const.h, trans-stmt.h, module.c, trans.c, scanner.c, trans-types.c, trans.h, gfortranspec.c, trans-types.h, lang-specs.h, io.c, bbt.c, resolve.c, f95-lang.c, st.c, iresolve.c, match.c, trans-decl.c, trans-io.c, target-memory.c, match.h, target-memory.h, parse.c, arith.h, check.c, dependency.c, parse.h, types.def, convert.c, dependency.h, primary.c, trans-intrinsic.c, options.c, misc.c, simplify.c: Likewise. From-SVN: r127129
2007-05-24re PR fortran/31716 (segfault with real array bounds)Jerry DeLisle1-1/+3
2007-05-23 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/31716 * array.c (spec_dimen_size): Test for correct BT_INTEGER type. From-SVN: r125013
2007-05-08re PR fortran/29397 (Constant logical expression with parameter array)Paul Thomas1-1/+1
2007-05-08 Paul Thomas <pault@gcc.gnu.org> PR fortran/29397 PR fortran/29400 * decl.c (add_init_expr_to_sym): Expand a scalar initializer for a parameter array into an array expression with the right shape. * array.c (spec_dimen_size): Remove static attribute. * gfortran.h : Prototype for spec_dimen_size. 2007-05-08 Paul Thomas <pault@gcc.gnu.org> PR fortran/29397 * gfortran.dg/parameter_array_init_1.f90: New test. PR fortran/29400 * gfortran.dg/parameter_array_init_2.f90: New test. From-SVN: r124541
2007-02-03re PR fortran/30514 ([4.1 only] zero-sized array wrongly rejected: integer ↵Paul Thomas1-0/+9
:: i(1:-1)) 2007-02-03 Paul Thomas <pault@gcc.gnu.org> PR fortran/30514 * array.c (match_array_element_spec): If the length of an array is negative, adjust the upper limit to make it zero length. PR fortran/30660 * resolve.c (pure_function, resolve_function): Initialize name to null to clear up build warnings. (resolve_fl_variable): Look at components explicitly to check for default initializer, rather than using gfc_default_initializer. 2007-02-03 Paul Thomas <pault@gcc.gnu.org> PR fortran/30514 * gfortran.dg/zero_sized_2.f90: New test. PR fortran/30660 * gfortran.dg/alloc_comp_basics_4.f90: New test. PR fortran/29820 * gfortran.dg/actual_array_interface_1.f90: Copy source to empty file. From-SVN: r121541
2007-01-07Fix whitespace in a table within a comment.Steven G. Kargl1-6/+6
Fix whitespace in a table within a comment. This is wonderful example of why tabs are evil. From-SVN: r120545
2007-01-07[multiple changes]Steven G. Kargl1-134/+130
2007-01-06 Steven G. Kargl <kargl@gcc.gnu.org> * array.c, bbt.c, check.c: Update copyright years. Whitespace. 2006-01-06 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.dg/present_1.f90: Update error message. From-SVN: r120542
2007-01-05re PR fortran/23232 ([4.1 only] DATA implied DO variables)Paul Thomas1-1/+1
2007-01-05 Paul Thomas <pault@gcc.gnu.org> PR fortran/23232 * decl.c (gfc_in_match_data, gfc_set_in_match_data): New functions to signal that a DATA statement is being matched. (gfc_match_data): Call gfc_set_in_match_data on entry and on exit. * gfortran.h : Add prototypes for above. * expr.c (check_init_expr): Avoid check on parameter or variable if gfc_in_match_data is true. (gfc_match_init_expr): Do not call error on non-reduction of expression if gfc_in_match_data is true. PR fortran/27996 PR fortran/27998 * decl.c (gfc_set_constant_character_len): Add boolean arg to flag array constructor resolution. Warn if string is being truncated. Standard dependent error if string is padded. Set new arg to false for all three calls to gfc_set_constant_character_len. * match.h : Add boolean arg to prototype for gfc_set_constant_character_len. * gfortran.h : Add warn_character_truncation to gfc_options. * options.c (set_Wall): Set warn_character_truncation if -Wall is set. * resolve.c (resolve_code): Warn if rhs string in character assignment has to be truncated. * array.c (gfc_resolve_character_array_constructor): Set new argument to true for call to gfc_set_constant_character_len. 2007-01-05 Paul Thomas <pault@gcc.gnu.org> PR fortran/23232 * gfortran.dg/data_implied_do_1.f90: New test. PR fortran/27996 PR fortran/27998 * gfortran.dg/char_length_1.f90: New test. From-SVN: r120485
2006-11-11Fix typo in previous check-inTobias Schlüter1-1/+1
From-SVN: r118702
2006-11-11data.c: Add 2006 to copyright years.Tobias Schlüter1-1/+2
* data.c: Add 2006 to copyright years. * interface.c: Same. * misc.c: Same. * trans-io.c: Same. From-SVN: r118700
2006-11-07decl.c (match_attr_spec, [...]): Unify gfc_notify_std message for GFC_STD_F2003.Tobias Burnus1-1/+1
fortran/ 2006-11-06 Tobias Burnus <burnus@net-b.de> * decl.c (match_attr_spec, gfc_match_enum): Unify gfc_notify_std message for GFC_STD_F2003. * array.c (gfc_match_array_constructor): Unify gfc_notify_std message for GFC_STD_F2003. * io.c (check_io_constraints): Unify gfc_notify_std message for GFC_STD_F2003. * resolve.c (resolve_actual_arglist): Unify gfc_notify_std message for GFC_STD_F2003. testsuite/ 2006-11-06 Tobias Burnus <burnus@net-b.de> * gfortran.dg/io_constraints_2.f90: Adjust pattern for matching error messages. * gfortran.dg/specifics_3.f90: Adjust pattern for matching error messages. From-SVN: r118542
2006-07-04re PR fortran/28174 (Corruption of multiple character arrays when passing ↵Paul Thomas1-9/+43
array sections) 2006-07-04 Paul Thomas <pault@gcc.gnu.org> PR fortran/28174 * trans-array.c (gfc_conv_expr_descriptor): When building temp, ensure that the substring reference uses a new charlen. * trans-expr.c (gfc_conv_aliased_arg): Add the formal intent to the argument list, lift the treatment of missing string lengths from the above and implement the use of the intent. (gfc_conv_function_call): Add the extra argument to the call to the above. PR fortran/28167 * trans-array.c (get_array_ctor_var_strlen): Treat a constant substring reference. * array.c (gfc_resolve_character_array_constructor): Remove static attribute and add the gfc_ prefix, make use of element charlens for the expression and pick up constant string lengths for expressions that are not themselves constant. * gfortran.h : resolve_character_array_constructor prototype added. * resolve.c (gfc_resolve_expr): Call resolve_character_array_ constructor again after expanding the constructor, to ensure that the character length is passed to the expression. 2006-07-04 Paul Thomas <pault@gcc.gnu.org> PR fortran/28174 * gfortran.dg/actual_array_substr_2.f90: New test. PR fortran/28167 * gfortran.dg/actual_array_constructor_2.f90: New test. From-SVN: r115182
2006-04-03re PR testsuite/26981 (g++.old-deja/g++.other/init18.C fails)Paul Thomas1-0/+6
2006-04-03 Paul Thomas <pault@gcc.gnu.org> PR fortran/26981 * trans.h : Prototype for gfc_conv_missing_dummy. * trans-expr (gfc_conv_missing_dummy): New function (gfc_conv_function_call): Call it and tidy up some of the code. * trans-intrinsic (gfc_conv_intrinsic_function_args): The same. PR fortran/26976 * array.c (gfc_array_dimen_size): If available, return shape[dimen]. * resolve.c (resolve_function): If available, use the argument shape for the function expression. * iresolve.c (gfc_resolve_transfer): Set shape[0] = size. 2006-04-03 Paul Thomas <pault@gcc.gnu.org> PR fortran/26981 * gfortran.dg/missing_optional_dummy_1.f90: New test. PR fortran/26976 * gfortran.dg/compliant_elemental_intrinsics_1.f90: New test. * gfortran.dg/initialization_1.f90: Make assignment compliant. * gfortran.dg/transfer_array_intrinsic_1.f90: Simplify. * gfortran.dg/transfer_array_intrinsic_2.f90: Make assignments compliant and detect bigendian-ness. From-SVN: r112634
2005-09-17re PR fortran/15586 (gfortran should support i18n in its compiler messages)Francois-Xavier Coudert1-4/+4
PR fortran/15586 * arith.c (gfc_arith_error): Add translation support for error messages. * array.c (gfc_match_array_ref): Likewise. (gfc_match_array_spec): Likewise. * check.c (must_be): Add msgid convention to third argument. (same_type_check): Add translation support for error message. (rank_check): Likewise. (kind_value_check): Likewise. (gfc_check_associated): Correct typo. (gfc_check_reshape): Add translation support for error message. (gfc_check_spread): Likewise. * error.c (error_printf): Add nocmsgid convention to argument. (gfc_warning, gfc_notify_std, gfc_warning_now, gfc_warning_check) (gfc_error, gfc_error_now): Likewise. (gfc_status): Add cmsgid convention to argument. * expr.c (gfc_extract_int): Add translation support for error messages. (gfc_check_conformance): Add msgid convention to argument. (gfc_check_pointer_assign): Correct tabbing. * gfortran.h: Include intl.h header. Remove prototype for gfc_article. * gfortranspec.c: Include intl.h header. (lang_specific_driver): Add translation support for --version. * io.c (check_format): Add translation support for error message. (format_item_1): Likewise. (data_desc): Likewise. * matchexp.c: Likewise. * misc.c (gfc_article): Remove function. * module.c (bad_module): Use msgid convention. Add translation support for error messages. (require_atom): Add translation support for error messages. * parse.c (gfc_ascii_statement): Likewise. (gfc_state_name): Likewise. * primary.c (match_boz_constant): Reorganise error messages for translations. * resolve.c (resolve_entries): Likewise. (resolve_operator): Add translation support for error messages. (gfc_resolve_expr): Use msgid convention. Reorganise error messages for translations. (resolve_symbol): Add translation support for error messages. * symbol.c (gfc_add_procedure): Remove use of gfc_article function. * trans-const.c (gfc_build_string_const): Use msgid convention. * exgettext: Add a new nocmsgid convention for arguments that should be marked as no-c-format. * gcc.pot: Regenerate. From-SVN: r104372
2005-08-21* array.c: Bump GFC_MAX_AC_EXPAND from 100 to 65535.Steven G. Kargl1-1/+1
From-SVN: r103323
2005-07-14[multiple changes]Feng Wang1-3/+8
2005-07-14 Steven G. Kargl <kargls@comcast.net> * gfortran.dg/char_array_constructor.f90: New test. 2005-07-14 Feng Wang <fengwang@nudt.edu.cn> Steven G. Kargl <kargls@comcast.net> * array.c (resolve_character_array_constructor): Allocate gfc_charlen for the array and attach to namespace list for automatic deallocation. From-SVN: r102002
2005-06-25Update FSF address.Kelley Cook1-2/+2
From-SVN: r101310
2005-06-04array.c (gfc_match_array_constructor): Disallow empty array constructor.Tobias Schlüter1-2/+4
fortran/ 2005-06-03 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de> Erik Edelmann <erik.edelmann@iki.fi> * array.c (gfc_match_array_constructor): Disallow empty array constructor. testsuite/ 2005-06-04 Erik Edelmann <erik.edelmann@iki.fi> * gfortran.dg/array_constructor_3.f90: New test. From-SVN: r100579
2005-05-18array.c (gfc_match_array_constructor): Support [ ...Erik Edelmann1-3/+16
fortran/ * array.c (gfc_match_array_constructor): Support [ ... ] style array constructors. testsuite/ * gfortran.dg/array_constructor_1.f90: New test. * gfortran.dg/array_constructor_2.f90: New test. From-SVN: r99919
2005-04-05re PR fortran/15959 (ICE and assertion failure in trans-decl.c with ↵Feng Wang1-2/+40
character initialization) 2005-04-05 Feng Wang <fengwang@nudt.edu.cn> PR fortran/15959 PR fortran/20713 * array.c (resolve_character_array_constructor): New function. Set constant character array's character length. (gfc_resolve_array_constructor): Use it. * decl.c (add_init_expr_to_sym): Set symbol and initializer character length. (gfc_set_constant_character_len): New function. Set constant character expression according the given length. * match.h (gfc_set_constant_character_len): Add prototype. 2005-04-05 Feng Wang <fengwang@nudt.edu.cn> * gfortran.dg/pr15959.f90: New test. * gfortran.dg/string_pad_trunc.f90: New test. From-SVN: r97613
2005-02-07gfortran.h (gfc_add_dimension, [...]): Add argument.Tobias Schlüter1-1/+1
* gfortran.h (gfc_add_dimension, gfc_add_result, gfc_add_save, gfc_add_dummy, gfc_add_generic, gfc_add_in_common, gfc_add_data, gfc_add_in_namelist, gfc_add_sequence, gfc_add_function, gfc_add_subroutine, gfc_add_access, gfc_add_flavor, gfc_add_entry, gfc_add_procedure): Add argument. * array.c (gfc_set_array_spec), decl.c (var_element, get_proc_name, gfc_match_null, match_type_spec, match_attr_spec, gfc_match_formal_arglist, match_result, gfc_match_function_decl): Update callers to match. (gfc_match_entry) : Likewise, fix comment typo. (gfc_match_subroutine, attr_decl1, gfc_add_dimension, access_attr_decl, do_parm, gfc_match_save, gfc_match_modproc, gfc_match_derived_decl): Update callers. * interface.c (gfc_match_interface): Likewise. * match.c (gfc_match_label, gfc_add_flavor, gfc_match_call, gfc_match_common, gfc_match_block_data, gfc_match_namelist, gfc_match_module, gfc_match_st_function): Likewise. * parse.c (parse_derived, parse_interface, parse_contained), primary.c (gfc_match_rvalue, gfc_match_variable): Likewise. * resolve.c (resolve_formal_arglist, resolve_entries): Update callers. * symbol.c (check_conflict, check_used): Add new 'name' argument, use when printing error message. (gfc_add_dimension, gfc_add_result, gfc_add_save, gfc_add_dummy, gfc_add_generic, gfc_add_in_common, gfc_add_data, gfc_add_in_namelist, gfc_add_sequence, gfc_add_function, gfc_add_subroutine, gfc_add_access, gfc_add_flavor, gfc_add_entry, gfc_add_procedure): Add new 'name' argument. Pass along to check_conflict and check_used. (gfc_add_allocatable, gfc_add_external, gfc_add_intrinsic, gfc_add_optional, gfc_add_pointer, gfc_add_target, gfc_add_elemental, gfc_add_pure, gfc_add_recursive, gfc_add_intent, gfc_add_explicit_interface, gfc_copy_attr): Pass NULL for new argument in calls to any of the modified functions. From-SVN: r94718
2005-01-18arith.c, [...]: Update copyright.Kazu Hirata1-1/+1
* arith.c, array.c, check.c, decl.c, expr.c, f95-lang.c, gfortran.h, interface.c, intrinsic.c, io.c, iresolve.c, match.c, matchexp.c, misc.c, module.c, options.c, parse.c, scanner.c, simplify.c, symbol.c, trans-array.c, trans-expr.c, trans-io.c, trans-stmt.c, trans.c: Update copyright. From-SVN: r93830
2005-01-03arith.c: Add system.h; remove string.hSteven G. Kargl1-2/+1
* arith.c: Add system.h; remove string.h * decl.c: Ditto * matchexp.c: Ditto * parse.c: Ditto * resolve.c: Ditto * st.c: Ditto * check.c: Remove stdlib.h and stdarg.h * error.c: Remove stdlib.h, stdarg.h, stdio.h, string.h * expr.c: Add system.h; remove stdarg.h, stdio.h, and string.h * f95-lang.c: Add system.h; remove stdio.h * interface.c: Add system.h; remove stdlib.h and string.h * intrinsic.c: Remove stdarg.h, stdio.h, and string.h * io.c: Remove string.h * simplify.c: Ditto * match.c: Remove stdarg.h and string.h * misc.c: Update copyright; add system.h; remove stdlib.h, string.h, and sys/stat.h * module.c: Add system.h; remove string.h, stdio.h, errno.h, unistd.h, and time.h * option.c: Remove string.h and stdlib.h * primary.c: Ditto * scanner.c: Update copyright; add system.h; remove stdlib.h, stdio.h, string.h, and strings.h * symbol.c: Add system.h; remove stdlib.h, stdio.h, and string.h * trans-array.c: Remove stdio.h and gmp.h * trans-const.c: Ditto * trans-expr.c: Ditto * trans-io.c: Ditto * trans-stmt.c: Ditto * trans.c: Ditto * trans-intrinsic.c: Remove stdio.h and string.h From-SVN: r92866
2004-12-12re PR fortran/16222 (non-integral DO loop variables are unsupported.)Steven G. Kargl1-1/+1
2004-12-12 Steven G. Kargl <kargls@comcast.net> Paul Brook <paul@codesourcery.com> PR fortran/16222 * resolve.c (gfc_resolve_iterator_expr): New function. (gfc_resolve_iterator): Use it. Add real_ok argument. Convert start, end and stride to correct type. (resolve_code): Pass extra argument. * array.c (resolve_array_list): Pass extra argument. * gfortran.h (gfc_resolve): Add prototype. * trans-stmt.c (gfc_trans_do): Remove redundant type conversions. Handle real type iterators. testsuite/ * gfortran.dg/real_do_1.f90: New test. Co-Authored-By: Paul Brook <paul@codesourcery.com> From-SVN: r92057
2004-11-08arith.c, [...]: Fix comment formatting.Kazu Hirata1-2/+2
* arith.c, array.c, decl.c, expr.c, f95-lang.c, gfortran.h, gfortranspec.c, interface.c, intrinsic.c, iresolve.c, match.c, module.c, parse.c, parse.h, primary.c, resolve.c, scanner.c, trans-array.c, trans-array.h, trans-expr.c, trans-intrinsic.c, trans-io.c, trans-stmt.c, trans.h: Fix comment formatting. From-SVN: r90266
2004-09-16array.c, [...]: Fix comment typos.Kazu Hirata1-2/+2
* array.c, data.c, decl.c, dependency.c, error.c, f95-lang.c, interface.c, intrinsic.c, io.c, misc.c, module.c, parse.h, resolve.c, scanner.c, trans-array.c, trans-array.h, trans-common.c, trans-const.h, trans-decl.c, trans-expr.c, trans-intrinsic.c, trans-stmt.c, trans-types.c, trans.c, trans.h: Fix comment typos. Follow spelling conventions. From-SVN: r87605
2004-09-08array.c: Don't include assert.h.Paul Brook1-1/+0
* array.c: Don't include assert.h. * data.c: Don't include assert.h. Replace assert and abort with gcc_assert and gcc_unreachable. * dependency.c: Ditto. * f95-lang.c: Ditto. * iresolve.c: Ditto. * resolve.c: Ditto. * simplify.c: Ditto. * symbol.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. * trans.c: Ditto. From-SVN: r87187
2004-07-09re PR fortran/13201 (PARAMETER variables of nonconstant shape are accepted)Tobias Schlüter1-0/+19
PR fortran/13201 * resolve.c (resolve_symbol): Verify that the shape of a parameter array is not only explicit, but also constant. * array.c (gfc_is_compile_time_shape): New function. * gfortran.h (gfc_is_compile_time_shape): Add prototype. From-SVN: r84400
2004-06-21array.c (gfc_insert_constructor): Avoid redundant call to mpz_comp.Tobias Schlüter1-3/+5
* array.c (gfc_insert_constructor): Avoid redundant call to mpz_comp. Add 2004 to copyright years. From-SVN: r83442
2004-05-27gfortran.h (gfc_current_locus, [...]): Remove.Tobias Schlüter1-7/+7
* gfortran.h (gfc_current_locus, gfc_set_locus): Remove. (gfc_current_locus): Declare new global variable. * scanner.c (gfc_current_locus, gfc_set_locus): Remove. (gfc_current_locus1): Rename ... (gfc_current_locus): ... to this. (gfc_at_eof, gfc_at_bol, gfc_at_eol, gfc_advance_line, next_char, skip_fixed_comments, skip_free_comments, gfc_next_char_literal, gfc_peek_char, gfc_gobble_whitespace, gfc_new_file): Use gfc_current_locus instead of gfc_current_locus1, gfc_set_locus() and gfc_current_locus(), respectively. * array.c (match_subscript, gfc_match_array_ref, match_array_list, match_array_cons_element, gfc_match_array_constructor): Read/modify gfc_current_locus instead of calling gfc_set_locus() and gfc_current_locus(). * decl.c (gfc_match_null, variable_decl, gfc_match_kind_spec, match_attr_spec, gfc_match_function_decl, gfc_match_end, attr_decl1, gfc_match_save): Likewise. * error.c (error_print, gfc_internal_error): Likewise. * expr.c (gfc_int_expr, gfc_default_logical_kind): Likewise. * interface.c (gfc_add_interface): Likewise. * io.c (gfc_match_format, match_dt_format, match_dt_element, match_io_iterator, match_io): Likewise. * match.c (gfc_match_space, gfc_match_eos, gfc_match_small_literal_int, gfc_match_st_label, gfc_match_strings, gfc_match_name, gfc_match_iterator, gfc_match_char, gfc_match, gfc_match_assignment, gfc_match_pointer_assignment, gfc_match_if, gfc_match_do, gfc_match_nullify, gfc_match_call, match_implicit_range, gfc_match_implicit, gfc_match_data, match_case_selector, gfc_match_case, match_forall_iterator): Likewise. * matchexp.c (gfc_match_defined_op_name, next_operator, match_level_1, match_mult_operand, match_ext_mult_operand, match_add_operand, match_ext_add_operand, match_level_2, match_level_3, match_level_4, match_and_operand, match_or_operand, match_equiv_operand, match_level_5, gfc_match_expr): Likewise. * module.c (gfc_match_use, mio_array_ref, mio_expr): Likewise. * parse.c (match_word, decode_statement, next_free, next_fixed, add_statement, verify_st_order, parse_if_block, gfc_parse_file): Likewise. * primary.c (match_digits, match_integer_constant, match_boz_constant, match_real_constant, match_substring, next_string_char, match_charkind_name, match_string_constant, match_logical_constant, match_const_complex_part, match_complex_constant, match_actual_arg, match_keyword_arg, gfc_match_actual_arglist, gfc_match_structure_constructor, gfc_match_rvalue, gfc_match_variable): Likewise. * st.c (gfc_get_code): Likewise. * symbol.c (check_conflict, check_used, check_done, duplicate_attr, add_flavor, gfc_add_procedure, gfc_add_intent, gfc_add_access, gfc_add_explicit_interface, gfc_add_type, gfc_add_component, gfc_reference_st_label, gfc_new_symbol): Likewise. From-SVN: r82320
2004-05-14Make-lang.in, [...]: Update copyright years and boilerplate.Tobias Schlüter1-12/+12
* Make-lang.in, arith.c, arith.h, array.c, bbt.c, check.c, decl.c, dependency.c, dependency.h, dump-parse-tree.c, error.c, expr.c, f95-lang.c, gfortran.h, interface.c, intrinsic.c, intrinsic.h, io.c, iresolve.c, lang-specs.h, match.c, match.h, matchexp.c, misc.c, module.c, options.c, parse.c, parse.h, primary.c, resolve.c, scanner.c, simplify.c, st.c, symbol.c, trans-array.c, trans-array.h, trans-common.c, trans-const.c, trans-const.h, trans-decl.c, trans-expr.c, trans-intrinsic.c, trans-io.c, trans-stmt.c, trans-stmt.h, trans-types.c, trans-types.h, trans.c, trans.h: Update copyright years and boilerplate. * data.c: Likewise, also removed two whitespace-only lines. * gfortranspec.c, lang.opt: Update copyright years. From-SVN: r81839
2004-05-13Merge tree-ssa-20020619-branch into mainline.Diego Novillo1-0/+1973
From-SVN: r81764