aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/io.c
AgeCommit message (Collapse)AuthorFilesLines
2013-07-08re PR fortran/50554 (INQUIRE cannot redefine DO index (r178939))Tobias Burnus1-2/+2
2013-07-08 Tobias Burnus <burnus@net-b.de> PR fortran/50554 * io.c (match_inquire_element): Add missing do-var check. 2013-07-08 Tobias Burnus <burnus@net-b.de> PR fortran/50554 * gfortran.dg/do_check_9.f90: New. From-SVN: r200790
2013-04-11Replace enum gfc_try with bool type.Janne Blomqvist1-164/+153
2013-04-11 Janne Blomqvist <jb@gcc.gnu.org> * gfortran.h: Remove enum gfc_try, replace gfc_try with bool type. * arith.c: Replace gfc_try with bool type. * array.c: Likewise. * check.c: Likewise. * class.c: Likewise. * cpp.c: Likewise. * cpp.h: Likewise. * data.c: Likewise. * data.h: Likewise. * decl.c: Likewise. * error.c: Likewise. * expr.c: Likewise. * f95-lang.c: Likewise. * interface.c: Likewise. * intrinsic.c: Likewise. * intrinsic.h: Likewise. * io.c: Likewise. * match.c: Likewise. * match.h: Likewise. * module.c: Likewise. * openmp.c: Likewise. * parse.c: Likewise. * parse.h: Likewise. * primary.c: Likewise. * resolve.c: Likewise. * scanner.c: Likewise. * simplify.c: Likewise. * symbol.c: Likewise. * trans-intrinsic.c: Likewise. * trans-openmp.c: Likewise. * trans-stmt.c: Likewise. * trans-types.c: Likewise. From-SVN: r197682
2013-01-10Update copyright years in gcc/Richard Sandiford1-3/+1
From-SVN: r195098
2013-01-04Update Copyright years for files modified in 2011 and/or 2012.Jakub Jelinek1-1/+1
From-SVN: r194903
2012-12-27re PR fortran/48976 (INQUIRE with STREAM= not supported)Jerry DeLisle1-1/+4
2012-12-27 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/48976 * gfortran.h (gfc_inquire struct): Add pointer for inquire stream. * io.c (io_tag): Add tag for inquire stream. (match_inquire_element): Add matcher for new tag. (gfc_resolve_inquire): Resolve new tag. * ioparm.def: Add new parameter for inquire stream. * trans-io.c (gfc_trans_inquire): Add tranlste code for inquire stream. From-SVN: r194734
2012-10-28re PR fortran/54958 (Wrongly rejects ac-implied-DO variables which also ↵Tobias Burnus1-4/+5
occur with INTENT(IN)) 2012-10-28 Tobias Burnus <burnus@net-b.de> PR fortran/54958 * gfortran.h (gfc_resolve_iterator_expr, gfc_check_vardef_context): Update prototype. * expr.c (gfc_check_vardef_context): Add own_scope argument and honour it. * resolve.c (gfc_resolve_iterator_expr): Add own_scope argument and honour it. (resolve_deallocate_expr, resolve_allocate_expr, resolve_data_variables, resolve_transfer resolve_lock_unlock, resolve_code): Update calls. * array.c (resolve_array_list): Ditto. * check.c (gfc_check_atomic_def, gfc_check_atomic_ref): Ditto. * interface.c (compare_actual_formal): Ditto. * intrinsic.c (check_arglist): Ditto. * io.c (resolve_tag, gfc_resolve_dt, gfc_resolve_inquire): * Ditto. 2012-10-28 Tobias Burnus <burnus@net-b.de> PR fortran/54958 * gfortran.dg/do_check_6.f90: New. From-SVN: r192896
2012-10-04expr.c (scalarize_intrinsic_call): Plug memory leak.Tobias Burnus1-0/+3
2012-10-04 Tobias Burnus <burnus@net-b.de> * expr.c (scalarize_intrinsic_call): Plug memory leak. * frontend-passes.c (gcc_assert): Extend assert. * interface.c (gfc_compare_derived_types): Fix comparison. (gfc_check_operator_interface): Move up to make this error message reachable. (get_sym_storage_size): Remove always-true checks. * io.c (format_lex): Add comment. (gfc_free_wait): Free memory. * match.c (gfc_match_select_type): Ditto. * matchexpr.c (match_level_3): Ditto. * primary.c (match_string_constant): Ditto. (match_actual_arg): Check return value. * resolve.c (gfc_resolve_substring_charlen, resolve_typebound_generic_call, resolve_typebound_function, resolve_typebound_subroutine): Free memory. * trans-types.c (gfc_get_derived_type): Remove always-true * check. From-SVN: r192094
2012-07-17re PR fortran/51081 ([F03] Proc-pointer assignment: Rejects valid internal proc)Janus Weil1-31/+31
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-08gfortran.h: Do not include coretypes.h here.Steven Bosscher1-0/+1
* gfortran.h: Do not include coretypes.h here. Make it an error to include this before coretypes.h * openmp.c: Include coretypes.h. * interface.c: Likewise. * intrinsic.c: Likewise. * symbol.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * matchexp.c: Likewise. * dump-parse-tree.c: Likewise. * array.c: Likewise. * constructor.c: Likewise. * error.c: Likewise. * data.c: Likewise. * expr.c: Likewise. * module.c: Likewise. * scanner.c: Likewise. * bbt.c: Likewise. * io.c: Likewise. * frontend-passes.c: Likewise. * resolve.c: Likewise. * st.c: Likewise. * target-memory.c: Likewise. * match.c: Likewise. * arith.c: Likewise. * parse.c: Likewise. * check.c: Likewise. * dependency.c: Likewise. * primary.c: Likewise. * misc.c: Likewise. * simplify.c: Likewise. From-SVN: r189357
2012-02-22re PR fortran/52335 (I/O: -std=f95 rejects valid DELIM= in OPEN)Tobias Burnus1-4/+0
2012-02-22 Tobias Burnus <burnus@net-b.de> PR fortran/52335 * io.c (gfc_match_open): Remove bogus F2003 DELIM= check. 2012-02-22 Tobias Burnus <burnus@net-b.de> PR fortran/52335 * gfortran.dg/io_constraints_10.f90: New. From-SVN: r184485
2012-02-17re PR translation/52232 (translatable string typos: "conindexed" (should be ↵Tobias Burnus1-1/+1
"coindexed")) 2012-02-17 Tobias Burnus <burnus@net-b.de> Roland Stigge <stigge@antcom.de> PR translation/52232 PR translation/52234 PR translation/52245 PR translation/52246 PR translation/52262 PR translation/52273 * io.c (gfc_match_open): Fix typo. * interface.c (compare_actual_formal): Ditto. * lang.opt (freal-4-real-8, freal-4-real-16, freal-8-real-16): * Ditto. * match.c (alloc_opt_list, gfc_match_nullify): Ditto. * check.c (gfc_check_associated, gfc_check_null): Ditto. 2012-02-17 Tobias Burnus <burnus@net-b.de> PR translation/52232 PR translation/52234 PR translation/52245 PR translation/52246 PR translation/52262 PR translation/52273 * gfortran.dg/coarray_22.f90: Update dg-error. * gfortran.dg/allocate_alloc_opt_4.f90: Ditto. Co-Authored-By: Roland Stigge <stigge@antcom.de> From-SVN: r184331
2011-11-08re PR fortran/50404 (SIGSEGV in gfc_resolve_close)Francois-Xavier Coudert1-0/+18
PR fortran/50404 * io.c (gfc_resolve_close): CLOSE requires a UNIT. * gfortran.dg/io_constraints_3.f90: Improve testcase. From-SVN: r181183
2011-10-202011-10-16 Steven G. Kargl<kargl@gcc.gnu.org>Steven G. Kargl1-8/+22
* io.c (match_dt_format): Match a user-defined operator or a kind type prefixed string. 2011-10-16 Steven G. Kargl<kargl@gcc.gnu.org> * gfortran.dg/format_string.f: New test. From-SVN: r180261
2011-06-20re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-5/+5
2011-06-20 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.h (gfc_check_vardef_context): Update prototype. (iso_fortran_env_symbol): Handle derived types. (symbol_attribute): Add lock_comp. * expr.c (gfc_check_vardef_context): Add LOCK_TYPE check. * interface.c (compare_parameter, gfc_procedure_use): Handle LOCK_TYPE. (compare_actual_formal): Update gfc_check_vardef_context call. * check.c (gfc_check_atomic_def, gfc_check_atomic_ref): Ditto. * intrinsic.c (check_arglist): Ditto. * io.c (resolve_tag, gfc_resolve_dt, gfc_resolve_inquire): * Ditto. * iso-fortran-env.def (ISOFORTRAN_LOCK_TYPE): Add. * intrinsic.texi (ISO_FORTRAN_ENV): Document LOCK_TYPE. * module.c (mio_symbol_attribute): Handle lock_comp. (create_derived_type): New function. (use_iso_fortran_env_module): Call it to handle LOCK_TYPE. * parse.c (parse_derived): Add constraint check for LOCK_TYPE. * resolve.c (resolve_symbol, resolve_lock_unlock): Add * constraint checks for LOCK_TYPE. (gfc_resolve_iterator, resolve_deallocate_expr, resolve_allocate_expr, resolve_code, resolve_transfer): Update gfc_check_vardef_context call. * trans-stmt.h (gfc_trans_lock_unlock): New prototype. * trans-stmt.c (gfc_trans_lock_unlock): New function. * trans.c (trans_code): Handle LOCK and UNLOCK. 2011-06-20 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_lock_1.f90: Update dg-error. * gfortran.dg/coarray_lock_3.f90: New. * gfortran.dg/coarray/lock_1.f90: New. From-SVN: r175228
2011-05-13re PR fortran/48972 (OPEN with Unicode file name)Tobias Burnus1-3/+13
2011-05-12 Tobias Burnus <burnus@net-b.de> PR fortran/48972 * io.c (resolve_tag_format, resolve_tag): Make sure that the string is of default kind. (gfc_resolve_inquire): Also resolve decimal tag. 2011-05-12 Tobias Burnus <burnus@net-b.de> PR fortran/48972 * gfortran.dg/io_constraints_8.f90: New. * gfortran.dg/io_constraints_9.f90: New. From-SVN: r173736
2011-04-18convert each use of gfc_free (p) to free (p)Jim Meyering1-8/+8
Do that by running this command: perl -pi -e 's/\bgfc_free ?\(/free (/' \ $(git grep -El '\bgfc_free ?\(') which also corrects the few uses that lacked a space between the function name and the open parenthesis. Manually undo the change to the function definition itself and its prototype. They'll be removed next. * array.c (gfc_free_array_spec, gfc_set_array_spec): s/gfc_free/free/ * constructor.c (node_free): Likewise. * cpp.c (dump_queued_macros): Likewise. * data.c (gfc_assign_data_value): Likewise. * decl.c (free_variable, free_value, gfc_free_data): Likewise. (gfc_free_data_all, match_old_style_init): Likewise. (gfc_set_constant_character_len, gfc_free_enum_history, NUM_DECL): Likewise. (gfc_match_modproc): Likewise. * dependency.c (check_section_vs_section): Likewise. * error.c (gfc_pop_error, gfc_free_error): Likewise. * expr.c (free_expr0, gfc_free_expr, gfc_free_actual_arglist): Likewise. (gfc_free_ref_list, gfc_replace_expr, gfc_copy_ref): Likewise. (find_substring_ref, gfc_simplify_expr, gfc_check_assign_symbol): Likewise. * frontend-passes.c (gfc_run_passes, cfe_expr_0): Likewise. (strip_function_call, optimize_comparison): Likewise. * interface.c (gfc_free_interface, arginfo, check_interface0): Likewise. (CHECK_OS_COMPARISON, gfc_extend_assign, gfc_free_formal_arglist): Likewise. * intrinsic.c (gfc_intrinsic_done_1, gfc_convert_type_warn): Likewise. (gfc_convert_chartype): Likewise. * io.c (gfc_free_open, compare_to_allowed_values, gfc_free_close): Likewise. (gfc_free_filepos, gfc_free_dt, gfc_free_inquire): Likewise. * match.c (gfc_free_iterator, gfc_match_associate): Likewise. (gfc_free_alloc_list, gfc_free_namelist, gfc_free_equiv_until): Likewise. (free_case, gfc_free_forall_iterator): Likewise. * misc.c: Likewise. * module.c (free_pi_tree, resolve_fixups, free_rename): Likewise. (free_true_name, peek_atom, mio_allocated_wide_string): Likewise. (mio_pool_string, mio_internal_string, mio_gmp_integer): Likewise. (mio_gmp_real, mio_expr, mio_typebound_proc): Likewise. (mio_full_typebound_tree, skip_list, load_equiv): Likewise. (free_written_common, gfc_use_module, gfc_free_use_stmts): Likewise. * openmp.c (gfc_free_omp_clauses): Likewise. * options.c (gfc_post_options): Likewise. * parse.c (select_type_pop, parse_omp_structured_block): Likewise. * primary.c (gfc_free_structure_ctor_component): Likewise. * resolve.c (resolve_structure_cons, check_host_association): Likewise. (gfc_resolve_forall, resolve_equivalence): Likewise. * scanner.c (gfc_scanner_done_1, gfc_release_include_path): Likewise. (gfc_define_undef_line, preprocessor_line, include_line): Likewise. (load_file, gfc_read_orig_filename): Likewise. * simplify.c (simplify_transformation_to_array): Likewise. (gfc_simplify_ibits, simplify_shift, gfc_simplify_ishftc, STRING): Likewise. (gfc_simplify_compiler_options): Likewise. * st.c (gfc_free_statement, gfc_free_statements): Likewise. (gfc_free_association_list): Likewise. * symbol.c (free_components, gfc_free_st_label, free_st_labels): Likewise. (gfc_delete_symtree, gfc_free_symbol, gfc_undo_symbols): Likewise. (free_old_symbol, gfc_commit_symbols, free_tb_tree): Likewise. (free_common_tree, free_uop_tree, free_sym_tree): Likewise. (gfc_free_dt_list, gfc_free_equiv_infos, gfc_free_equiv_lists): Likewise. (gfc_free_finalizer, gfc_free_charlen, free_entry_list): Likewise. (gfc_free_namespace): Likewise. * trans-array.c (gfc_free_ss, gfc_trans_array_bound_check): Likewise. (gfc_conv_array_ref, gfc_conv_ss_startstride): Likewise. (gfc_trans_dummy_array_bias, gfc_conv_array_parameter): Likewise. * trans-common.c (get_init_field, create_common): Likewise. * trans-const.c (gfc_build_wide_string_const): Likewise. (gfc_conv_string_init): Likewise. * trans-decl.c (gfc_generate_function_code): Likewise. * trans-expr.c (gfc_conv_substring, gfc_free_interface_mapping): Likewise. (SCALAR_POINTER, gfc_conv_statement_function): Likewise. (gfc_trans_subarray_assign): Likewise. * trans-intrinsic.c (conv_generic_with_optional_char_arg): Likewise. * trans-io.c (gfc_trans_io_runtime_check, set_string): Likewise. (transfer_namelist_element, transfer_array_component): Likewise. * trans-openmp.c (gfc_trans_omp_array_reduction): Likewise. * trans-stmt.c (cleanup_forall_symtrees, gfc_trans_forall_1): Likewise. * trans.c (trans_runtime_error_vararg, gfc_restore_backend_locus): Likewise. From-SVN: r172666
2011-02-09io.c (match_io_element): Do not set dt if not inquire.Jerry DeLisle1-1/+2
2011-02-08 Jerry DeLisle <jvdelisle@gcc.gnu.org> * io.c (match_io_element): Do not set dt if not inquire. From-SVN: r169961
2011-01-08re PR fortran/46896 (Wrong code with transpose(a) passed to subroutine)Paul Thomas1-1/+29
2011-01-08 Paul Thomas <pault@gcc.gnu.org> PR fortran/46896 * trans-expr.c (gfc_conv_procedure_call): With a non-copying procedure argument (eg TRANSPOSE) use a temporary if there is any chance of aliasing due to host or use association. (arrayfunc_assign_needs_temporary): Correct logic for function results and do not use a temporary for implicitly PURE variables. Use a temporary for Cray pointees. * symbol.c (gfc_add_save): Explicit SAVE not compatible with implicit pureness of containing procedure. * decl.c (match_old_style_init, gfc_match_data): Where decl would fail in PURE procedure, set implicit_pure to zero. * gfortran.h : Add implicit_pure to structure symbol_attr and add prototype for function gfc_implicit_pure. * expr.c (gfc_check_pointer_assign, gfc_check_vardef_context): Where decl would fail in PURE procedure, reset implicit_pure. * io.c (match_vtag, gfc_match_open, gfc_match_close, gfc_match_print, gfc_match_inquire, gfc_match_wait): The same. * match.c (gfc_match_critical, gfc_match_stopcode, sync_statement, gfc_match_allocate, gfc_match_deallocate): The same. * parse.c (decode_omp_directive): The same. (parse_contained): If not PURE, set implicit pure attribute. * resolve.c (resolve_formal_arglist, resolve_structure_cons, resolve_function, resolve_ordinary_assign) : The same. (gfc_implicit_pure): New function. * module.c (mio_symbol_attribute): Introduce AB_IMPLICIT_PURE to ab_attribute enum and use it in this function. 2011-01-08 Paul Thomas <pault@gcc.gnu.org> PR fortran/46896 * gfortran.dg/transpose_optimization_2.f90 : New test. From-SVN: r168600
2010-12-11re PR fortran/46705 (Spurious "Missing '&' in continued character constant" ↵Jerry DeLisle1-5/+5
warning occurs twice) 2010-12-11 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/46705 * gfortran.h: New enum gfc_instring. (gfc_next_char_literal): Update prototype. * scanner.c (gfc_next_char_literal): Use new enum. Only give missing '&' warning for INSTRING_WARN. (gfc_next_char): Use new enum. (gfc_gobble_whitespace): Likewise. * io.c (next_char): Use new enum. (next_char_not_space): Likewise. (format_lex): Likewise. * match.c (gfc_match_parens): Likewise. (gfc_match_special_char): Likewise. (gfc_match_name_C): Likewise. * parse.c (next_fixed): Likewise. * primary.c (match_hollerith_constant): Likewise. (next_string_char): Likewise. From-SVN: r167716
2010-09-25re PR fortran/45776 (Full implementation of variable definition contexts ↵Daniel Kraft1-89/+116
(and related checks)) 2010-09-25 Daniel Kraft <d@domob.eu> PR fortran/45776 * gfortran.h (struct gfc_dt): New member `dt_io_kind'. * io.c (resolve_tag): F2008 check for NEWUNIT and variable definition checks for NEWUNIT, IOSTAT, SIZE and IOMSG. (gfc_free_dt): Correctly handle freeing of `dt_io_kind' and `extra_comma' with changed semantics. (gfc_resolve_dt): Check variable definitions. (match_io_element): Remove INTENT and PURE checks here and initialize code->ext.dt member. (match_io): Set dt->dt_io_kind. (gfc_resolve_inquire): Check variable definition for all tags except UNIT, FILE and ID. * resolve.c (resolve_transfer): Variable definition check. 2010-09-25 Daniel Kraft <d@domob.eu> PR fortran/45776 * gfortran.dg/io_constraints_6.f03: New test. * gfortran.dg/io_constraints_7.f03: New test. * gfortran.dg/newunit_2.f90: New test. From-SVN: r164619
2010-07-05io.c (resolve_tag): Check EXIST tag is a default logical.Steven G. Kargl1-0/+8
2010-07-05 Steven G. Kargl <kargl@gcc.gnu.org> fortran/44797 * fortran/io.c (resolve_tag): Check EXIST tag is a default logical. From-SVN: r161852
2010-06-25decl.c (gfc_match_entry): Mark ENTRY as GFC_STD_F2008_OBS.Tobias Burnus1-1/+1
2010-06-25 Tobias Burnus <burnus@net-b.de> * decl.c (gfc_match_entry): Mark ENTRY as GFC_STD_F2008_OBS. * gfortran.texi (_gfortran_set_options): Update for GFC_STD_F2008_OBS addition. * libgfortran.h: Add GFC_STD_F2008_OBS. * options.c (set_default_std_flags, gfc_handle_option): Handle GFC_STD_F2008_OBS. io.c (check_format): Fix allow_std check. 2010-06-25 Tobias Burnus <burnus@net-b.de> * runtime/compile_options.c (init_compile_options): Update compile_options.allow_std for GFC_STD_F2008_OBS. * io/transfer.c (formatted_transfer_scalar_read, formatted_transfer_scalar_write): Fix allow_std check. * io/list_read.c (nml_parse_qualifier): Ditto. 2010-06-25 Tobias Burnus <burnus@net-b.de> * gfortran.dg/entry_19.f90: New. From-SVN: r161409
2010-04-24re PR fortran/43832 (OPEN statement not diagnosing missing unit number)Jerry DeLisle1-2/+5
2010-04-24 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/43832 * io.c (gfc_match_open): Remove branch to syntax error. Add call to gfc_error with new error message. From-SVN: r158684
2010-04-13[multiple changes]Jerry DeLisle1-20/+7
2010-04-12 Jerry DeLisle <jvdelisle@gcc.gnu.org> * array.c (extract_element): Restore function from trunk. (gfc_get_array_element): Restore function from trunk. (gfc_expand_constructor): Restore check against flag_max_array_constructor. * constructor.c (node_copy_and_append): Delete unused. * gfortran.h: Delete comment and extra include. * constructor.h: Bump copyright and clean up TODO comments. * resolve.c: Whitespace. 2010-04-12 Daniel Franke <franke.daniel@gmail.com> * simplify.c (compute_dot_product): Replaced usage of ADVANCE macro with direct access access to elements. Adjusted prototype, fixed all callers. (gfc_simplify_dot_product): Removed duplicate check for zero-sized array. (gfc_simplify_matmul): Removed usage of ADVANCE macro. (gfc_simplify_spread): Removed workaround, directly insert elements at a given array position. (gfc_simplify_transpose): Likewise. (gfc_simplify_pack): Replaced usage of ADVANCE macro with corresponding function calls. (gfc_simplify_unpack): Likewise. 2010-04-12 Daniel Franke <franke.daniel@gmail.com> * simplify.c (only_convert_cmplx_boz): Renamed to ... (convert_boz): ... this and moved to start of file. (gfc_simplify_abs): Whitespace fix. (gfc_simplify_acos): Whitespace fix. (gfc_simplify_acosh): Whitespace fix. (gfc_simplify_aint): Whitespace fix. (gfc_simplify_dint): Whitespace fix. (gfc_simplify_anint): Whitespace fix. (gfc_simplify_and): Replaced if-gate by more common switch-over-type. (gfc_simplify_dnint): Whitespace fix. (gfc_simplify_asin): Whitespace fix. (gfc_simplify_asinh): Moved creation of result-expr out of switch. (gfc_simplify_atan): Likewise. (gfc_simplify_atanh): Whitespace fix. (gfc_simplify_atan2): Whitespace fix. (gfc_simplify_bessel_j0): Removed ATTRIBUTE_UNUSED. (gfc_simplify_bessel_j1): Likewise. (gfc_simplify_bessel_jn): Likewise. (gfc_simplify_bessel_y0): Likewise. (gfc_simplify_bessel_y1): Likewise. (gfc_simplify_bessel_yn): Likewise. (gfc_simplify_ceiling): Reorderd statements. (simplify_cmplx): Use convert_boz(), check for constant arguments. Whitespace fix. (gfc_simplify_cmplx): Use correct default kind. Removed check for constant arguments. (gfc_simplify_complex): Replaced if-gate. Removed check for constant arguments. (gfc_simplify_conjg): Whitespace fix. (gfc_simplify_cos): Whitespace fix. (gfc_simplify_cosh): Replaced if-gate by more common switch-over-type. (gfc_simplify_dcmplx): Removed check for constant arguments. (gfc_simplify_dble): Use convert_boz() and gfc_convert_constant(). (gfc_simplify_digits): Whitespace fix. (gfc_simplify_dim): Whitespace fix. (gfc_simplify_dprod): Reordered statements. (gfc_simplify_erf): Whitespace fix. (gfc_simplify_erfc): Whitespace fix. (gfc_simplify_epsilon): Whitespace fix. (gfc_simplify_exp): Whitespace fix. (gfc_simplify_exponent): Use convert_boz(). (gfc_simplify_floor): Reorderd statements. (gfc_simplify_gamma): Whitespace fix. (gfc_simplify_huge): Whitespace fix. (gfc_simplify_iand): Whitespace fix. (gfc_simplify_ieor): Whitespace fix. (simplify_intconv): Use gfc_convert_constant(). (gfc_simplify_int): Use simplify_intconv(). (gfc_simplify_int2): Reorderd statements. (gfc_simplify_idint): Reorderd statements. (gfc_simplify_ior): Whitespace fix. (gfc_simplify_ishftc): Removed duplicate type check. (gfc_simplify_len): Use range_check() instead of manual range check. (gfc_simplify_lgamma): Removed ATTRIBUTE_UNUSED. Whitespace fix. (gfc_simplify_log): Whitespace fix. (gfc_simplify_log10): Whitespace fix. (gfc_simplify_minval): Whitespace fix. (gfc_simplify_maxval): Whitespace fix. (gfc_simplify_mod): Whitespace fix. (gfc_simplify_modulo): Whitespace fix. (simplify_nint): Reorderd statements. (gfc_simplify_not): Whitespace fix. (gfc_simplify_or): Replaced if-gate by more common switch-over-type. (gfc_simplify_radix): Removed unused result-variable. Whitespace fix. (gfc_simplify_range): Removed unused result-variable. Whitespace fix. (gfc_simplify_real): Use convert_boz() and gfc_convert_constant(). (gfc_simplify_realpart): Whitespace fix. (gfc_simplify_selected_char_kind): Removed unused result-variable. (gfc_simplify_selected_int_kind): Removed unused result-variable. (gfc_simplify_selected_real_kind): Removed unused result-variable. (gfc_simplify_sign): Whitespace fix. (gfc_simplify_sin): Whitespace fix. (gfc_simplify_sinh): Replaced if-gate by more common switch-over-type. (gfc_simplify_sqrt): Avoided goto by inlining check. Whitespace fix. (gfc_simplify_tan): Replaced if-gate by more common switch-over-type. (gfc_simplify_tanh): Replaced if-gate by more common switch-over-type. (gfc_simplify_xor): Replaced if-gate by more common switch-over-type. 2010-04-12 Daniel Franke <franke.daniel@gmail.com> * gfortran.h (gfc_start_constructor): Removed. (gfc_get_array_element): Removed. * array.c (gfc_start_constructor): Removed, use gfc_get_array_expr instead. Fixed all callers. (extract_element): Removed. (gfc_expand_constructor): Temporarily removed check for max-array-constructor. Will be re-introduced later if still required. (gfc_get_array_element): Removed, use gfc_constructor_lookup_expr instead. Fixed all callers. * expr.c (find_array_section): Replaced manual lookup of elements by gfc_constructor_lookup. 2010-04-12 Daniel Franke <franke.daniel@gmail.com> * gfortran.h (gfc_get_null_expr): New prototype. (gfc_get_operator_expr): New prototype. (gfc_get_character_expr): New prototype. (gfc_get_iokind_expr): New prototype. * expr.c (gfc_get_null_expr): New. (gfc_get_character_expr): New. (gfc_get_iokind_expr): New. (gfc_get_operator_expr): Moved here from matchexp.c (build_node). * matchexp.c (build_node): Renamed and moved to expr.c (gfc_get_operator_expr). Reordered arguments to match other functions. Fixed all callers. (gfc_get_parentheses): Use specific function to build expr. * array.c (gfc_match_array_constructor): Likewise. * arith.c (eval_intrinsic): Likewise. (gfc_hollerith2int): Likewise. (gfc_hollerith2real): Likewise. (gfc_hollerith2complex): Likewise. (gfc_hollerith2logical): Likewise. * data.c (create_character_intializer): Likewise. * decl.c (gfc_match_null): Likewise. (enum_initializer): Likewise. * io.c (gfc_match_format): Likewise. (match_io): Likewise. * match.c (gfc_match_nullify): Likewise. * primary.c (match_string_constant): Likewise. (match_logical_constant): Likewise. (build_actual_constructor): Likewise. * resolve.c (build_default_init_expr): Likewise. * symbol.c (generate_isocbinding_symbol): Likewise. (gfc_build_class_symbol): Likewise. (gfc_find_derived_vtab): Likewise. * simplify.c (simplify_achar_char): Likewise. (gfc_simplify_adjustl): Likewise. (gfc_simplify_adjustr): Likewise. (gfc_simplify_and): Likewise. (gfc_simplify_bit_size): Likewise. (gfc_simplify_is_iostat_end): Likewise. (gfc_simplify_is_iostat_eor): Likewise. (gfc_simplify_isnan): Likewise. (simplify_bound): Likewise. (gfc_simplify_leadz): Likewise. (gfc_simplify_len_trim): Likewise. (gfc_simplify_logical): Likewise. (gfc_simplify_maxexponent): Likewise. (gfc_simplify_minexponent): Likewise. (gfc_simplify_new_line): Likewise. (gfc_simplify_null): Likewise. (gfc_simplify_or): Likewise. (gfc_simplify_precision): Likewise. (gfc_simplify_repeat): Likewise. (gfc_simplify_scan): Likewise. (gfc_simplify_size): Likewise. (gfc_simplify_trailz): Likewise. (gfc_simplify_trim): Likewise. (gfc_simplify_verify): Likewise. (gfc_simplify_xor): Likewise. * trans-io.c (build_dt): Likewise. (gfc_new_nml_name_expr): Removed. 2010-04-12 Daniel Franke <franke.daniel@gmail.com> * arith.h (gfc_constant_result): Removed prototype. * constructor.h (gfc_build_array_expr): Removed prototype. (gfc_build_structure_constructor_expr): Removed prototype. * gfortran.h (gfc_int_expr): Removed prototype. (gfc_logical_expr): Removed prototype. (gfc_get_array_expr): New prototype. (gfc_get_structure_constructor_expr): New prototype. (gfc_get_constant_expr): New prototype. (gfc_get_int_expr): New prototype. (gfc_get_logical_expr): New prototype. * arith.c (gfc_constant_result): Moved and renamed to expr.c (gfc_get_constant_expr). Fixed all callers. * constructor.c (gfc_build_array_expr): Moved and renamed to expr.c (gfc_get_array_expr). Split gfc_typespec argument to type and kind. Fixed all callers. (gfc_build_structure_constructor_expr): Moved and renamed to expr.c (gfc_get_structure_constructor_expr). Split gfc_typespec argument to type and kind. Fixed all callers. * expr.c (gfc_logical_expr): Renamed to ... (gfc_get_logical_expr): ... this. Added kind argument. Fixed all callers. (gfc_int_expr): Renamed to ... (gfc_get_int_expr): ... this. Added kind and where arguments. Fixed all callers. (gfc_get_constant_expr): New. (gfc_get_array_expr): New. (gfc_get_structure_constructor_expr): New. * simplify.c (int_expr_with_kind): Removed, callers use gfc_get_int_expr instead. 2010-04-12 Daniel Franke <franke.daniel@gmail.com> * constructor.h: New. * constructor.c: New. * Make-lang.in: Add new files to F95_PARSER_OBJS. * arith.c (reducy_unary): Use constructor API. (reduce_binary_ac): Likewise. (reduce_binary_ca): Likewise. (reduce_binary_aa): Likewise. * check.c (gfc_check_pack): Likewise. (gfc_check_reshape): Likewise. (gfc_check_unpack): Likewise. * decl.c (add_init_expr_to_sym): Likewise. (build_struct): Likewise. * dependency.c (gfc_check_dependency): Likewise. (contains_forall_index_p): Likewise. * dump-parse-tree.c (show_constructor): Likewise. * expr.c (free_expr0): Likewise. (gfc_copy_expr): Likewise. (gfc_is_constant_expr): Likewise. (simplify_constructor): Likewise. (find_array_element): Likewise. (find_component_ref): Likewise. (find_array_section): Likewise. (find_substring_ref): Likewise. (simplify_const_ref): Likewise. (scalarize_intrinsic_call): Likewise. (check_alloc_comp_init): Likewise. (gfc_default_initializer): Likewise. (gfc_traverse_expr): Likewise. * iresolve.c (check_charlen_present): Likewise. (gfc_resolve_reshape): Likewise. (gfc_resolve_transfer): Likewise. * module.c (mio_constructor): Likewise. * primary.c (build_actual_constructor): Likewise. (gfc_match_structure_constructor): Likewise. * resolve.c (resolve_structure_cons): Likewise. * simplify.c (is_constant_array_expr): Likewise. (init_result_expr): Likewise. (transformational_result): Likewise. (simplify_transformation_to_scalar): Likewise. (simplify_transformation_to_array): Likewise. (gfc_simplify_dot_product): Likewise. (simplify_bound): Likewise. (simplify_matmul): Likewise. (simplify_minval_maxval): Likewise. (gfc_simplify_pack): Likewise. (gfc_simplify_reshape): Likewise. (gfc_simplify_shape): Likewise. (gfc_simplify_spread): Likewise. (gfc_simplify_transpose): Likewise. (gfc_simplify_unpack): Likewise.q (gfc_convert_constant): Likewise. (gfc_convert_char_constant): Likewise. * target-memory.c (size_array): Likewise. (encode_array): Likewise. (encode_derived): Likewise. (interpret_array): Likewise. (gfc_interpret_derived): Likewise. (expr_to_char): Likewise. (gfc_merge_initializers): Likewise. * trans-array.c (gfc_get_array_constructor_size): Likewise. (gfc_trans_array_constructor_value): Likewise. (get_array_ctor_strlen): Likewise. (gfc_constant_array_constructor_p): Likewise. (gfc_build_constant_array_constructor): Likewise. (gfc_trans_array_constructor): Likewise. (gfc_conv_array_initializer): Likewise. * trans-decl.c (check_constant_initializer): Likewise. * trans-expr.c (flatten_array_ctors_without_strlen): Likewise. (gfc_apply_interface_mapping_to_cons): Likewise. (gfc_trans_structure_assign): Likewise. (gfc_conv_structure): Likewise. * array.c (check_duplicate_iterator): Likewise. (match_array_list): Likewise. (match_array_cons_element): Likewise. (gfc_match_array_constructor): Likewise. (check_constructor_type): Likewise. (check_constructor): Likewise. (expand): Likewise. (expand_constructor): Likewise. (extract_element): Likewise. (gfc_expanded_ac): Likewise. (resolve_array_list): Likewise. (gfc_resolve_character_array_constructor): Likewise. (copy_iterator): Renamed to ... (gfc_copy_iterator): ... this. (gfc_append_constructor): Removed. (gfc_insert_constructor): Removed unused function. (gfc_get_constructor): Removed. (gfc_free_constructor): Removed. (qgfc_copy_constructor): Removed. * gfortran.h (struct gfc_expr): Removed member 'con_by_offset'. Removed all references. Replaced constructor list by splay-tree. (struct gfc_constructor): Removed member 'next', moved 'offset' from the inner struct, added member 'base'. (gfc_append_constructor): Removed prototype. (gfc_insert_constructor): Removed prototype. (gfc_get_constructor): Removed prototype. (gfc_free_constructor): Removed prototype. (qgfc_copy_constructor): Removed prototype. (gfc_copy_iterator): New prototype. * trans-array.h (gfc_constant_array_constructor_p): Adjusted prototype. From-SVN: r158253
2010-04-09re PR fortran/28039 (Warn when ignoring extra characters in the format ↵Bud Davis1-7/+21
specification) 2010-04-08 Bud Davis <bdavis9659@sbcglobal.net> PR fortran/28039 * io.c (check_format_string): Added check for additional non blank characters after the format string was successfully parsed. * io.c (check_format): Changed the error messages for positive int required and period required to drop through the error logic and report with gfc_error instead of gfc_error_now. Corrected format postion for hollerith strings. From-SVN: r158147
2009-11-28trans-common.c (create_common): Remove unused offset variable.Jakub Jelinek1-3/+0
* trans-common.c (create_common): Remove unused offset variable. * io.c (gfc_match_wait): Remove unused loc variable. * trans-openmp.c (gfc_trans_omp_clauses): Remove unused old_clauses variable. (gfc_trans_omp_do): Remove unused outermost variable. * iresolve.c (gfc_resolve_alarm_sub, gfc_resolve_fseek_sub): Remove unused status variable. * module.c (number_use_names): Remove unused c variable. (load_derived_extensions): Remove unused nuse variable. * trans-expr.c (gfc_conv_substring): Remove unused var variable. * trans-types.c (gfc_get_array_descr_info): Remove unused offset_off variable. * matchexp.c (match_primary): Remove unused where variable. * trans-intrinsic.c (gfc_conv_intrinsic_bound): Remove unused cond2 variable. (gfc_conv_intrinsic_sizeof): Remove unused source variable. (gfc_conv_intrinsic_transfer): Remove unused stride variable. (gfc_conv_intrinsic_function): Remove unused isym variable. * arith.c (gfc_hollerith2real, gfc_hollerith2complex, gfc_hollerith2logical): Remove unused len variable. * parse.c (parse_derived): Remove unused derived_sym variable. * decl.c (variable_decl): Remove unused old_locus variable. * resolve.c (check_class_members): Remove unused tbp_sym variable. (resolve_ordinary_assign): Remove unused assign_proc variable. (resolve_equivalence): Remove unused value_name variable. * data.c (get_array_index): Remove unused re variable. * trans-array.c (gfc_conv_array_transpose): Remove unused src_info variable. (gfc_conv_resolve_dependencies): Remove unused aref and temp_dim variables. (gfc_conv_loop_setup): Remove unused dim and len variables. (gfc_walk_variable_expr): Remove unused head variable. * match.c (match_typebound_call): Remove unused var variable. * intrinsic.c (gfc_convert_chartype): Remove unused from_ts variable. From-SVN: r154722
2009-10-11re PR fortran/38439 (I/O PD edit descriptor inconsistency)Jerry DeLisle1-2/+4
2009-10-11 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/38439 * io.c (check_format): Fix locus for error messages and fix a comment. From-SVN: r152645
2009-09-29re PR libfortran/35862 ([F2003] Implement new rounding modes for run time)Jerry DeLisle1-7/+40
2009-09-28 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/35862 * io.c (format_token): Add enumerators for rounding format specifiers. (format_lex): Tokenize the rounding format specifiers. (gfc_match_open): Enable rounding modes in OPEN statement. From-SVN: r152262
2009-08-26re PR fortran/28039 (Warn when ignoring extra characters in the format ↵Bud Davis1-14/+15
specification) 2009-08-22 Bud Davis <bdavis9659@sbcglobal.net> PR fortran/28093 * io.c: reverted previous patch From-SVN: r151112
2009-08-25re PR fortran/41162 (416.gamess in SPEC CPU 2006 failed to build)Jerry DeLisle1-2/+13
2009-08-24 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/41162 * io.c (check_format): Fix to not error on slash after P. Fix some error loci. From-SVN: r151074
2009-08-25re PR fortran/41154 (Comma required after P descriptor)Jerry DeLisle1-2/+2
2009-08-24 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/41154 * io.c (check_format): Fix to not error on right paren after P. From-SVN: r151070
2009-08-24re PR fortran/35754 (-std=f95: Reject "1P2E12.4" w/o a comma after the "P")Jerry DeLisle1-10/+25
2009-08-23 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/35754 * io.c (check_format): Add checks for comma and the allowed format specifiers after the 'P' specifier. Fix typo in error message and adjust locus. From-SVN: r151045
2009-08-24re PR fortran/37446 (Diagnostic of edit descriptors, esp. EN)Jerry DeLisle1-12/+51
2009-08-23 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/37446 * io.c (enum format_token): Change FMT_EXT to FMT_EN and FMT_ES. (format_lex): Likewise. (token_to_string): New function. (check_format): Use the new tokens and the new function. Add check for positive width. From-SVN: r151043
2009-08-23[multiple changes]Bud Davis1-15/+14
2009-08-22 Bud Davis <bdavis9659@sbcglobal.net> PR fortran/28093 * io.c : added variable to store original len of fmt * io.c (check_format): Consume H items using next_char in both modes to handle consecutive single quotes. Test for extra characters in fmt, issue warning. 2009-08-22 Bud Davis <bdavis9659@sbcglobal.net> PR fortran/28039 * gfortran.dg/fmt_with_extra.f: new file. From-SVN: r151021
2009-08-17re PR fortran/41075 ([F2008] Implement unlimited format item)Jerry DeLisle1-19/+56
2009-08-17 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/41075 * scanner.c (gfc_next_char_literal): Add comment to improve readability. * io.c (enum format_token): Add FMT_STAR. (format_lex): Add case for '*'. (check_format): Check for left paren after '*'. Change format checks to use %L to improve format string error locus. From-SVN: r150843
2009-07-23re PR fortran/40839 (gfortran segmentation fault when a unit number is missing)Jakub Jelinek1-2/+11
PR fortran/40839 * io.c (gfc_resolve_dt): Add LOC argument. Fail if dt->io_unit is NULL. Return FAILURE after issuing error about negative UNIT number. (match_io_element): Don't segfault if current_dt->io_unit is NULL. * gfortran.h (gfc_resolve_dt): Adjust prototype. * resolve.c (resolve_code): Adjust caller. * gfortran.dg/pr40839.f90: New test. From-SVN: r150021
2009-06-07re PR fortran/40008 (F2008: Add NEWUNIT= for OPEN statement)Jerry DeLisle1-3/+51
2009-05-31 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/40008 * gfortran.h (gfc_open): Add newunit expression to structure. * io.c (io_tag): Add new unit tag and fix whitespace. (match_open_element): Add matching for newunit. (gfc_free_open): Free the newunit expression. (gfc_resolve_open): Add newunit to resolution and check constraints. (gfc_resolve_close): Add check for non-negative unit. (gfc_resolve_filepos): Likewise. (gfc_resolve_dt): Likewise. * trans-io.c (set_parameter_value): Build runtime checks for unit numbers within range of kind=4 integer. (gfc_trans_open) Set the newunit parameter. * ioparm.def (IOPARM): Define the newunit parameter as a pointer to GFC_INTEGER_4, pint4. From-SVN: r148252
2009-05-14re PR fortran/39865 (ICE in gfc_conv_scalarized_array_ref)Jakub Jelinek1-13/+30
PR fortran/39865 * io.c (resolve_tag_format): CHARACTER array in FMT= argument isn't an extension. Reject non-CHARACTER array element of assumed shape or pointer or assumed size array. * trans-array.c (array_parameter_size): New function. (gfc_conv_array_parameter): Add size argument. Call array_parameter_size if it is non-NULL. * trans-array.h (gfc_conv_array_parameter): Adjust prototype. * trans-expr.c (gfc_conv_function_call, gfc_trans_arrayfunc_assign): Adjust callers. * trans-intrinsic.c (gfc_conv_intrinsic_loc): Likewise. * trans-io.c (gfc_convert_array_to_string): Rewritten. * gfortran.dg/pr39865.f90: New test. * gfortran.dg/hollerith.f90: Don't expect errors for CHARACTER arrays in FMT=. * gfortran.dg/hollerith_f95.f90: Likewise. * gfortran.dg/hollerith6.f90: New test. * gfortran.dg/hollerith7.f90: New test. From-SVN: r147507
2009-05-13gfortran.h (gfc_code): Rename struct member expr to expr1.Steven G. Kargl1-2/+2
2009-05-13 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.h (gfc_code): Rename struct member expr to expr1. * openmp.c (resolve_omp_atomic): Update expr to expr1. * interface.c (gfc_extend_assign): Ditto. * trans-expr.c (gfc_conv_expr_reference, gfc_trans_assignment, gfc_trans_init_assign): Ditto. * dump-parse-tree.c (show_code_node): Ditto. * trans-openmp.c (gfc_trans_omp_atomic): Ditto. * trans-stmt.c ( gfc_trans_label_assign, gfc_trans_goto, gfc_trans_call, gfc_trans_return, gfc_trans_pause, gfc_trans_stop, gfc_trans_if_1, gfc_trans_arithmetic_if, gfc_trans_do_while, gfc_trans_integer_select, gfc_trans_logical_select, gfc_trans_character_select forall_make_variable_temp, check_forall_dependencies gfc_trans_forall_1, gfc_trans_where_2, gfc_trans_where_3 gfc_trans_where, gfc_trans_allocate, gfc_trans_deallocate): Ditto. * io.c (match_io_element, gfc_match_inquire): Ditto. * resolve.c (resolve_typebound_call, resolve_ppc_call, resolve_allocate_expr, resolve_allocate_deallocate, resolve_select, resolve_transfer, resolve_where, gfc_resolve_assign_in_forall, gfc_resolve_blocks, resolve_code, build_init_assign): Ditto. * st.c (gfc_free_statement): Ditto. * match.c (gfc_match_assignment, gfc_match_pointer_assignment, match_arithmetic_if, gfc_match_if, gfc_match_elseif gfc_match_stopcode, gfc_match_assign, gfc_match_goto, gfc_match_nullify, match_typebound_call, gfc_match_call gfc_match_select, match_simple_where, gfc_match_where gfc_match_elsewhere, match_simple_forall, gfc_match_forall): Ditto. * trans-io.c (gfc_trans_transfer): Ditto. * parse.c (parse_where_block, parse_if_block): Ditto. From-SVN: r147497
2008-12-21re PR fortran/38398 (g0.w edit descriptor: Update for F2008 Tokyo meeting ↵Jerry DeLisle1-3/+13
changes) 2008-12-21 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/38398 * io.c: Add error checks for g0 formatting and provide adjustment of error loci for improved error messages. From-SVN: r142870
2008-12-07re PR fortran/38425 (I/O: POS= compile-time diagnostics)Jerry DeLisle1-5/+13
2008-12-06 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/38425 * io.c (check_io_constraints): Check constraints on REC=, POS=, and internal unit with POS=. Fix punctuation on a few error messages. From-SVN: r142534
2008-12-06re PR fortran/38291 (Rejects I/O with POS= if FMT=*)Jerry DeLisle1-2/+3
2008-12-05 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/38291 * io.c (match_dt_element): Use dt->pos in matcher. (gfc_free_dt): Free dt->pos after use. (gfc_resolve_dt): Use dt->pos in resolution of stream position tag. 2008-12-05 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/38291 * io/transfer.c (data_transfer_init): Add checks for POS= valid range. Add check for unit opened with ACCESS="stream". Flush and seek if current stream position does not match. Check ENDFILE on read. From-SVN: r142515
2008-11-22re PR libfortran/37839 (st_parameter_dt has unwanted padding, is out of sync ↵Jakub Jelinek1-1/+4
with compiler) PR libfortran/37839 * trans-io.c (gfc_build_io_library_fndecls): Decrease pad size back to 16 pointers plus 32 integers. Don't use max integer kind alignment, only gfc_intio_kind's alignment. (gfc_trans_inquire): Only set flags2 if mask2 is non-zero. * ioparm.def: Fix order, bitmasks and types of inquire round, sign and pending fields. Move u in dt before id. * io.c (gfc_free_inquire): Free decimal and size exprs. (match_inquire_element): Match size instead of matching blank twice. (gfc_resolve_inquire): Resolve size. * gfortran.dg/f2003_inquire_1.f03: New test. * gfortran.dg/f2003_io_1.f03: Remove xfail. * gfortran.dg/f2003_io_4.f03: Likewise. * gfortran.dg/f2003_io_5.f03: Likewise. * gfortran.dg/f2003_io_6.f03: Likewise. * gfortran.dg/f2003_io_7.f03: Likewise. * io/io.h (IOPARM_INQUIRE_HAS_ROUND, IOPARM_INQUIRE_HAS_SIGN, IOPARM_INQUIRE_HAS_PENDING): Adjust values. (st_parameter_inquire): Reorder and fix types of round, sign and pending fields. (st_parameter_43, st_parameter_44): Removed. (st_parameter_dt): Put back struct definition directly to u.p declaration. Change type of u.p.size_used from gfc_offset to GFC_IO_INT. Decrease back size of u.pad to 16 pointers and 32 ints. Put id, pos, asynchronous, blank, decimal, delim, pad, round and sign fields after the union. * io/inquire.c (inquire_via_unit, inquire_via_filename): Only read flags2 if it is defined. * io/transfer.c (read_sf, read_block_form, write_block): Cast additions to size_used to GFC_IO_INT instead of gfc_offset. (data_transfer_init): Clear whole u.p struct. Adjust for moving id, pos, asynchronous, blank, decimal, delim, pad, round and sign fields from u.p directly into st_parameter_dt. (finalize_transfer): Don't cast size_used to GFC_IO_INT. * io/file_pos.c (st_endfile): Clear whole u.p struct. From-SVN: r142111
2008-11-15re PR fortran/37988 (Edit descriptor checking (compile time) for "<Holerith>T)")Jerry DeLisle1-8/+28
2008-11-14 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/37988 * io.c (enum format_token): For readability replace FMT_POS with FMT_T, FMT_TL, and FMT_TR. (format_lex): Use new enumerators. (check_format): Add check for missing positive integer. From-SVN: r141879
2008-10-31re PR fortran/35840 (ICE for character expression in I/O specifier)Mikael Morin1-1/+1
2008-10-31 Mikael Morin <mikael.morin@tele2.fr> PR fortran/35840 * expr.c (gfc_reduce_init_expr): New function, containing checking code from gfc_match_init_expr, so that checking can be deferred. (gfc_match_init_expr): Use gfc_reduce_init_expr. * io.c (check_io_constraints): Use gfc_reduce_init_expr instead of checking that the expression is a constant. * match.h (gfc_reduce_init_expr): Prototype added. 2008-10-31 Mikael Morin <mikael.morin@tele2.fr> PR fortran/35840 * gfortran.dg/write_check4.f90: New test. From-SVN: r141497
2008-09-14re PR fortran/35840 (ICE for character expression in I/O specifier)Jerry DeLisle1-5/+8
2008-09-14 Jerry DeLisle <jvdelisle@gcc.gnu.org> Tobias Burnus <burnus@net.b.de> PR fortran/35840 * io.c (match_vtag): Add tag name to error message. (match_out_tag): Cleanup whitespace. (gfc_resolve_dt): Resolve id and async tags. Co-Authored-By: Tobias Burnus <burnus@net-b.de> From-SVN: r140366
2008-09-02re PR fortran/37228 (F2008: Support g0.<d> edit descriptor)Jerry DeLisle1-14/+11
2008-09-01 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/37228 * io.c (check_format): Allow specifying precision with g0 format. 2008-09-01 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/37301 PR libfortran/37228 * io/io.h (write_real_g0): Declare new function to handle g0.d format. * io/transfer.c (formatted_transfer_scalar): Use new function. * io/format.c (parse_format_list): Enable g0.d. * io/write.c (write_a_char4): Delete unused var. (set_fnode_default): New function to set the default fnode w, d, and e factored from write_real. (write_real): Use new factored function. (write_real_g0): New function that sets d to that passed by g0.d format specifier and set format to ES. Default values for w and e are used from the new function, set_fnode_default. 2008-09-01 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/37228 * gfortran.dg/fmt_g0_4.f08: Revised test. From-SVN: r139886
2008-08-16re PR libfortran/35863 ([F2003] Implement ENCODING="UTF-8")Jerry DeLisle1-2/+1
2008-08-15 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/35863 * io.c (gfc_match_open): Enable UTF-8 in checks. * simplify.c (gfc_simplify_selected_char_kind): Enable iso_10646. From-SVN: r139146
2008-07-29gfortran.h (try): Remove macro.Kaveh R. Ghazi1-11/+11
* 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-22re PR fortran/29835 (Error message of unknown edit descriptor needs improvement)Daniel Kraft1-7/+20
2008-07-22 Daniel Kraft <d@domob.eu> PR fortran/29835 * io.c (error_element), (format_locus): New static globals. (unexpected_element): Spelled out this message fully. (next_char): Keep track of locus when not MODE_STRING. (next_char_not_space): Remember last parsed element in error_element. (format_lex): Fix two indentation errors. (check_format): Use format_locus and possibly error_element for a slightly better error message on invalid format. (check_format_string): Set format_locus to start of the string expression used as format. 2008-07-22 Daniel Kraft <d@domob.eu> PR fortran/29835 * io/format.c (struct format_data): New member error_element. (unexpected_element): Added '%c' to message. (next_char): Keep track of last parsed character in fmt->error_element. (format_error): If the message is unexpected_element, output the offending character, too. 2008-07-22 Daniel Kraft <d@domob.eu> PR fortran/29835 * gfortran.dg/fmt_error_3.f90: New test. * gfortran.dg/fmt_error_4.f90: New test. * gfortran.dg/fmt_error_5.f90: New test. From-SVN: r138063