aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/io.c
AgeCommit message (Collapse)AuthorFilesLines
2007-09-24re PR fortran/33269 (Diagnose missing "(" in "PRINT ('a'),")Tobias Schlüter1-2/+5
PR fortran/33269 fortran/ * io.c (check_format_string): Move NULL and constant checks into this function. (check_io_constraints): Call gfc_simplify_expr() before calling check_format_string(). Remove NULL and constant checks. testsuite/ * gfortran.dg/fmt_error_2.f90: New. From-SVN: r128732
2007-09-20io.c (resolve_tag_format): New function using code split out and simplified ↵Tobias Schlüter1-108/+92
from ... fortran/ * io.c (resolve_tag_format): New function using code split out and simplified from ... (resolve_tag): ... this function. Simplify logic. Unify IOSTAT, IOLENGTH and SIZE handling. testsuite/ * gfortran.dg/g77/19981216-0.f: Remove dg-warning annotation. * gfortran.dg/io_constraints_1.f90: Make a -std=f95 test. Add warning annotation. * gfortran.dg/iostat_3.f90: Make a -std=f95 test. From-SVN: r128623
2007-08-31re PR fortran/33232 (Diagnose comma in "read()," and "write(),")Tobias Burnus1-3/+2
2007-08-31 Tobias Burnus <burnus@net-b.de> PR fortran/33232 * io.c (match_io): Also diagnose extra comma for READ. 2007-08-31 Tobias Burnus <burnus@net-b.de> PR fortran/33232 * gfortran.dg/eor_handling_2.f90: Add dg-warnings. * gfortran.dg/read_1.f90: New. From-SVN: r127997
2007-08-10re PR fortran/32987 (TAB in FORMAT: accept extension, warn with -std=f*)Tobias Burnus1-11/+72
2007-08-09 Tobias Burnus <burnus@net-b.de> PR fortran/32987 * io.c (format_token): Add FMT_ERROR. (next_char_not_space): Print error/warning when '\t' are used in format specifications. (format_lex): Propagate error. (check_format): Ditto. 2007-08-09 Tobias Burnus <burnus@net-b.de> PR fortran/32987 * io/format.c (next_char): Treat '\t' as ' ' in format specification. 2007-08-09 Tobias Burnus <burnus@net-b.de> PR fortran/32987 * gfortran.dg/fmt_tab_1.f90: New. * gfortran.dg/fmt_tab_2.f90: New. From-SVN: r127324
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-07-04re PR fortran/32545 (Give an (compile time) error not a warning for wrong ↵Jerry DeLisle1-17/+8
edit format statements) 2007-07-03 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/32545 * io.c (check_format): Always call gfc_error for errors. (check_format_string): Change type of this function to try and return the result of check_format. (check_io_constraints): Return MATCH_ERROR if check_format_string returns FAILURE. 2007-07-03 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/32612 * decl.c (get_proc_name): Include attr->mod_proc in check for error. From-SVN: r126295
2007-06-30re PR fortran/32555 (Miscompilation of NIST testsuite)Tobias Burnus1-0/+1
2007-06-30 Tobias Burnus <burnus@net-b.de> PR fortran/32555 * io.c (check_format): Allow zero to precede the P edit descriptor. 2007-06-30 Tobias Burnus <burnus@net-b.de> PR fortran/32555 * gfortran.dg/fmt_zero_check.f90: New. From-SVN: r126152
2007-06-29re PR fortran/32483 (edit descriptor checking: Compile-time check for zero ↵Tobias Burnus1-9/+21
width for reading) 2007-06-29 Tobias Burnus <burnus@net-b.de> PR fortran/32483 * io.c (format_lex): Fix FMT_ZERO. (check_format,check_format_string,gfc_match_format, check_io_constraints) Additional checking for READ. 2007-06-29 Tobias Burnus <burnus@net-b.de> PR fortran/32483 * gfortran.dg/fmt_read_2.f90: New. From-SVN: r126107
2007-06-22re PR fortran/31162 (missing warning for real do-loops with implicit typed ↵Jerry DeLisle1-1/+1
variables) 2007-06-21 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/31162 * resolve.c (gfc_resolve_iterator_expr): Add check for REAL using gfc_notify_standard. (gfc_resolve_iterator): Remove check. (resolve_branch): Change "Obsolete" to "Deleted feature". * io.c (resolve_tag): Ditto. * match.c (gfc_match_pause, gfc_match_assign, gfc_match_goto): Ditto. From-SVN: r125938
2007-06-08re PR fortran/32223 (Backslash handling inconsistent)Steven G. Kargl1-31/+8
2007-06-07 Steven G. Kargl <kargl@gcc.gnu.org> Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/32223 * match.c (gfc_match_special_char): New function. Match special char. Add handling '\0'. * match.h: Add prototype. * io.c (next_char): Use it. * primary.c (next_string_char): Ditto. Co-Authored-By: Jerry DeLisle <jvdelisle@gcc.gnu.org> From-SVN: r125557
2007-06-07decl.c: Miscellaneous whitespace fixes.Steven G. Kargl1-1/+1
* decl.c: Miscellaneous whitespace fixes. * expr.c: Likewise. * gfortran.h: Likewise. * interface.c : Likewise. * io.c: Likewise. * match.c: Likewise. * match.h: Likewise. * module.c: Likewise. * parse.c: Likewise. * resolve.c: Likewise. * symbol.c: Likewise. * trans-array.c: Likewise. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-intrinsic.c: Likewise. * trans-io.c: Likewise. * trans-stmt.c: Likewise. * trans-types.c: Likewise. From-SVN: r125533
2007-05-26re PR fortran/31813 (Warn about deleted feature: H edit descriptor)Jerry DeLisle1-13/+15
2007-05-26 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/31813 * io.c (check_format): Add warning for H specifier in format. From-SVN: r125097
2007-01-26Steven G.Steven G. Kargl1-2/+43
2007-01-26 Steven Bosscher <stevenb.gcc@gmail.com> Steven G. Kargl <kargl@gcc.gnu,org> * testsuite/gfortran.dg/backslash_3.f: New test. * fortran/io.c (next_char): Deal with backslash escaped characters. Issue warnings in non -std=gnu cases. * fortran/primary.c (next_string_char): Issue warnings in non From-SVN: r121218
2007-01-08interface.c, [...]: Update Copyright years.Steven G. Kargl1-173/+157
2007-01-08 Steven G. Kargl <kargl@gcc.gnu.org> * interface.c, intrinsic.c, gfortranspec.c, io.c, f95-lang.c, iresolve.c, match.c: Update Copyright years. Whitespace. From-SVN: r120587
2006-12-28re PR libfortran/30014 (INQUIRE (iolength = xx) limited to kind=4)Jerry DeLisle1-1/+9
2006-12-27 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/30014 *io.c (resolve_tag): Don't issue error for tag_size type not being default integer size for -std=F2003. Add similar check for tag_iolength. *ioparm.def: Change size and iolength parameters to ioint pointer, which corresponds to GFC_IO_INT on the library side. From-SVN: r120233
2006-11-18re PR fortran/24285 ([4.2 only] format(1000(a,$)))Francois-Xavier Coudert1-3/+4
PR fortran/24285 * io.c (check_format): Allow dollars everywhere in format, and issue a warning. * gfortran.dg/dollar_edit_descriptor-3.f: New test. From-SVN: r118971
2006-11-15data.c: Remove trailing periods from error messages.Brooks Moses1-1/+1
* data.c: Remove trailing periods from error messages. * decl.c: Likewise. * expr.c: Likewise. * io.c: Likewise. * match.c: Likewise. * module.c: Likewise. * options.c: Likewise. * resolve.c: Likewise. * symbol.c: Likewise. * trans-io.c: Likewise. From-SVN: r118880
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-10-30re PR fortran/29452 (Keyword check for specifiers in WRITE and READ)Tobias Burnus1-2/+2
fortran/ 2006-10-30 Tobias Burnus <burnus@net-b.de> PR fortran/29452 * io.c (check_io_constraints): Fix keyword string comparison. libgfortran/ 2006-10-30 Tobias Burnus <burnus@net-b.de> PR fortran/29452 * runtime/string.c (compare0): Check whether string lengths match. testsuite/ 2006-10-30 Tobias Burnus <burnus@net-b.de> PR fortran/29452 * gfortran.dg/write_check.f90: Check run-time keyword checking. * gfortran.dg/write_check2.f90: Check compile-time keyword checking From-SVN: r118191
2006-10-28re PR fortran/28224 (gfortran should support namelist (nml) for internal ↵Tobias Burnus1-3/+7
file units) fortran/ 2006-10-28 Tobias Burnus <burnus@net-b.de> PR fortran/28224 * io.c (check_io_constraints): Allow namelists for internal files for Fortran 2003. testsuite/ 2006-10-28 Tobias Burnus <burnus@net-b.de> PR fortran/28224 * gfortran.dg/io_constraints_2.f90: Use -std=f95. * gfortran.dg/namelist_internal.f90: New test. From-SVN: r118113
2006-10-16io.c (gfc_match_close): Ensure that status is terminated by a NULL element.Kaz Kojima1-1/+1
* io.c (gfc_match_close): Ensure that status is terminated by a NULL element. From-SVN: r117785
2006-10-16re PR fortran/29403 ([4.1 only] print ('(a)') not working, print '(a) works)Steven G. Kargl1-4/+21
2006-10-15 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/29403 * io.c (match_io): Check for a default-char-expr for PRINT format. From-SVN: r117764
2006-10-13re PR fortran/21435 (fails to open nonexisting file with status scratch)François-Xavier Coudert1-0/+342
PR fortran/21435 * io.c (compare_to_allowed_values): New function. (gfc_match_open): Add checks for constant values of specifiers. (gfc_match_close): Add checks for constant values of the STATUS specifier. * gcc/testsuite/gfortran.dg/io_constraints_3.f90: New test. * gcc/testsuite/gfortran.dg/open_access_append_1.f90: Add checks for compile-time warnings. * gcc/testsuite/gfortran.dg/pr20163-2.f: Likewise. * gcc/testsuite/gfortran.dg/iostat_2.f90: Likewise. * gcc/testsuite/gfortran.dg/label_4.f90: Delete the temporary file. * gcc/testsuite/gfortran.dg/direct_io_2.f90: Add a FILE= specifier. * gcc/testsuite/gfortran.dg/iomsg_1.f90: Add check for compile-time warning. From-SVN: r117685
2006-08-15re PR fortran/25828 ([f2003] ACCESS='STREAM' io support)Jerry DeLisle1-0/+9
2006-08-15 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/25828 * gfortran.h: Add new pointer for stream position to st_inquire. Rename gfc_large_io_int_kind to gfc_intio_kind. * trans-types.c (gfc_init_kinds): use gfc_intio_kind. * io.c: Add new IO tag for file position going in and another for out. (match_dt_element): Match new tag_spos. (gfc_resolve_dt): Resolve new tag_spos. (gfc_free_inquire): Free inquire->strm_pos. (match_inquire_element): Match new tag_strm_out. (gfc_resolve_inquire): Resolve new tag_strm_out. * trans-io.c: Rename IOPARM_type_large_io_int to IOPARM_type_intio. (gfc_build_st_parameter): Same. (gfc_build_io_library_fndecls) Same. and add build pointer type pintio. (gfc_trans_inquire): Translate strm_pos for inquire. * ioparm.def: Reorder flags to accomodate addition of new inquire flag for strm_pos_out and add it in. From-SVN: r116171
2006-07-16re PR fortran/28384 (ICE on non-existent COMMON block)Paul Thomas1-0/+6
2006-07-16 Paul Thomas <pault@gcc.gnu.org> PR fortran/28384 * trans-common.c (translate_common): If common_segment is NULL emit error that common block does not exist. PR fortran/20844 * io.c (check_io_constraints): It is an error if an ADVANCE specifier appears without an explicit format. PR fortran/28201 * resolve.c (resolve_generic_s): For a use_associated function, do not search for an alternative symbol in the parent name space. PR fortran/20893 * resolve.c (resolve_elemental_actual): New function t combine all the checks of elemental procedure actual arguments. In addition, check of array valued optional args(this PR) has been added. (resolve_function, resolve_call): Remove parts that treated elemental procedure actual arguments and call the above. 2006-07-16 Paul Thomas <pault@gcc.gnu.org> PR fortran/20844 * gfortran.dg/io_constaints_2.f90: Add the test for ADVANCE specifiers requiring an explicit format tag.. PR fortran/28201 * gfortran.dg/generic_5: New test. PR fortran/20893 * gfortran.dg/elemental_optional_args_1.f90: New test. From-SVN: r115499
2006-07-07re PR fortran/28237 (print call())Paul Thomas1-0/+7
2006-07-07 Paul Thomas <pault@gcc.gnu.org> PR fortran/28237 PR fortran/23420 * io.c (resolve_tag): Any integer that is not an assigned variable is an error. 2006-07-07 Paul Thomas <pault@gcc.gnu.org> PR fortran/28237 PR fortran/23420 * gfortran.dg/print_fmt_5.f90: New test. From-SVN: r115246
2006-05-29re PR fortran/27634 (formatted reading/writing: real format without dot)Jerry DeLisle1-5/+14
2006-05-29 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/27634 * io.c (check_format): Add error for missing period in format specifier unless -std=legacy. * gfortran.texi: Add description of expanded namelist read and missing period in format extensions. From-SVN: r114213
2006-05-26re PR fortran/23151 (print (buf, format), expression should be invalid)Thomas Koenig1-0/+6
2006-05-26 Thomas Koenig <Thomas.Koenig@online.de> PR fortran/23151 * io.c (match_io): print (1,*) is an error. 2006-05-26 Thomas Koenig <Thomas.Koenig@online.de> PR fortran/23151 * gfortran.dg/inquire_9.f90: Fix illegal print syntax. * gfortran.dg/print_parentheses_1.f: New test. * gfortran.dg/print_parentheses_2.f90: New test. From-SVN: r114138
2006-03-27io.c (check_io_constraints): Don't look at ↵Jakub Jelinek1-10/+14
dt->advance->value.charater.string, unless it is a CHARACTER constant. * io.c (check_io_constraints): Don't look at dt->advance->value.charater.string, unless it is a CHARACTER constant. * gfortran.dg/advance_2.f90: New test. * gfortran.dg/advance_3.f90: New test. From-SVN: r112417
2006-02-19re PR libfortran/21303 (L edit descriptor without a width)François-Xavier Coudert1-2/+20
PR libfortran/21303 * gfortran.h (notification): New enumeration. (gfc_notification_std): Prototype for the new function. * error.c (gfc_notification_std): New function. * io.c (check_format): Handle the case of a L format descriptor without a width. * runtime/error.c (notification_std): New function. * libgfortran.h (notification): New enumeration. * io/io.h (notification_std): Prototype for the new function. * io/format.c (parse_format_list): Handle the case of a L format descriptor without a width. * gcc/testsuite/gfortran.dg/fmt_l.f90: New test. From-SVN: r111281
2006-02-14re PR fortran/26277 (false warning about unused label for a warning used in ↵Tobias Schlüter1-0/+4
err=) fortran/ PR fortran/26277 * io.c (match_ltag): Mark label as referenced. testsuite/ PR fortran/26277 * gfortran.dg/label_4.f90: New. From-SVN: r110993
2006-01-18re PR fortran/18540 (Jumping into blocks gives error rather than warning)Tobias Schlüter1-4/+4
PR fortran/18540 PR fortran/18937 * gfortran.h (BBT_HEADER): Move definition up. (gfc_st_label): Add BBT_HEADER, remove 'prev' and 'next'. * io.c (format_asterisk): Adapt initializer. * resolve.c (resolve_branch): Allow FORTRAN 66 cross-block GOTOs as extension. * symbol.c (compare_st_labels): New function. (gfc_free_st_label, free_st_labels, gfc_get_st_label): Convert to using balanced binary tree. * decl.c (match_char_length, gfc_match_old_kind_spec): Do away with 'cnt'. (warn_unused_label): Adapt to binary tree. * match.c (gfc_match_small_literal_int): Only set cnt if non-NULL. * primary.c (match_kind_param): Do away with cnt. Also converted the ChangeLog to use latin1 characters. From-SVN: r109914
2006-01-06re PR fortran/24268 (gfortran rejects valid format statement)Jerry DeLisle1-14/+24
2006-01-01 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/24268 * io.c (next_char_not_space): New function that returns the next character that is not white space. (format_lex): Use the new function to skip whitespace within a format string. From-SVN: r109402
2005-12-22re PR fortran/20889 (type in a structure-constructor differs from type in ↵Paul Thomas1-98/+216
derived-type-def) 2005-12-22 Paul Thomas <pault@gcc.gnu.org> PR fortran/20889 *resolve.c(resolve_structure_cons): Do not attempt to convert the type of mismatched pointer type components, except when the constructor component is BT_UNKNOWN; emit error instead. PR fortran/25029 PR fortran/21256 *resolve.c(check_assumed_size_reference): New function to check for upper bound in assumed size array references. (resolve_assumed_size_actual): New function to do a very restricted scan of actual argument expressions of those procedures for which incomplete assumed size array references are not allowed. (resolve_function, resolve_call): Switch off assumed size checking of actual arguments, except for elemental procedures and array valued intrinsics; excepting LBOUND. (resolve_variable): Call check_assumed_size_reference. PR fortran/19362 PR fortran/20244 PR fortran/20864 PR fortran/25391 *interface.c(gfc_compare_types): Broken into two. (gfc_compare_derived_types): Second half of gfc_compare_types with corrections for a missing check that module name is non-NULL and a check for private components. *symbol.c(gfc_free_dt_list): New function. (gfc_free_namespace): Call gfc_free_dt_list. *resolve.c(resolve_symbol): Build the list of derived types in the symbols namespace. *gfortran.h: Define the structure type gfc_dt_list. Add a new field, derived_types to gfc_namespace. Provide a prototye for the new function gfc_compare_derived_types. *trans_types.c(gfc_get_derived_type): Test for the derived type being available in the host namespace. In this case, the host backend declaration is used for the structure and its components. If an unbuilt, equal structure that is not use associated is found in the host namespace, build it there and then. On exit,traverse the namespace of the derived type to see if there are equal but unbuilt. If so, copy the structure and its component declarations. (copy_dt_decls_ifequal): New functions to copy declarations to other equal structure types. PR fortran/20862 * io.c (gfc_match_format): Make the appearance of a format statement in a module specification block an error. PR fortran/23152 * match.c (gfc_match_namelist): Set assumed shape arrays in namelists as std=GFC_STD_GNU and assumed size arrays as an unconditional error. PR fortran/25069 * match.c (gfc_match_namelist): Set the respecification of a USE associated namelist group as std=GFC_STD_GNU. Permit the concatenation on no error. PR fortran/25053 PR fortran/25063 PR fortran/25064 PR fortran/25066 PR fortran/25067 PR fortran/25068 PR fortran/25307 * io.c (resolve_tag): Change std on IOSTAT != default integer to GFC_STD_GNU and change message accordingly. Add same error for SIZE. (match_dt_element, gfortran.h): Add field err_where to gfc_dt and set it when tags are being matched. (gfc_resolve_dt): Remove tests that can be done before resolution and add some of the new ones here. (check_io_constraints): New function that checks for most of the data transfer constraints. Some of these were previously done in match_io, from where this function is called, and some were done in gfc_resolve_dt. (match_io): Remove most of the tests of constraints and add the call to check_io_constraints. 2005-12-22 Paul Thomas <pault@gcc.gnu.org> PR fortran/20889 *gfortran.dg/pointer_component_type_1.f90: New test. PR fortran/25029 PR fortran/21256 *gfortran.dg/assumed_size_refs.f90: New test for the conditions that should give an error with assumed size array refernces and checks those that should not. *gfortran.dg/gfortran.dg/pr15140.f90: Give the assumed size array reference an upper bound so that it does not generate an error. PR fortran/19362 PR fortran/20244 PR fortran/20864 PR fortran/25391 *gfortran.dg/used_dummy_types_1.f90: New test. *gfortran.dg/used_dummy_types_2.f90: New test. *gfortran.dg/used_dummy_types_3.f90: New test. *gfortran.dg/used_dummy_types_4.f90: New test. *gfortran.dg/used_dummy_types_5.f90: New test. PR fortran/23152 *gfortran.dg/namelist_use.f90: Add trap for warning on NAMELIST group already being USE associated. *gfortran.dg/assumed_shape_nml.f90: New test. *gfortran.dg/assumed_size_nml.f90: New test. PR fortran/20862 PR fortran/25053 PR fortran/25063 PR fortran/25064 PR fortran/25066 PR fortran/25067 PR fortran/25068 PR fortran/25307 * gfortran.dg/io_constraints_1.f90: New test. * gfortran.dg/io_constraints_1.f90: New test. * gfortran.dg/iostat_3.f90: Change wording of warning. * gfortran.dg/g77/19981216-0.f: the same. From-SVN: r108943
2005-12-16re PR fortran/24268 (gfortran rejects valid format statement)Jerry DeLisle1-1/+1
2005-12-16 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/24268 * io.c (format_lex): Allow whitespace within text of format specifier. From-SVN: r108695
2005-12-10re PR fortran/25068 ([4.0/4.1] IOSTAT should be default integer when -std=f95)Francois-Xavier Coudert1-0/+10
PR fortran/25068 * io.c (resolve_tag): Add correct diagnostic for F2003 feature. * gfortran.dg/iostat_3.f90: New test. From-SVN: r108360
2005-12-10re PR fortran/23815 (Add -byteswapio flag)Thomas Koenig1-0/+15
2005-12-10 Thomas Koenig <Thomas.Koenig@online.de> PR fortran/23815 * io.c (top level): Add convert to io_tag. (resolve_tag): convert is GFC_STD_GNU. (match_open_element): Add convert. (gfc_free_open): Likewise. (gfc_resolve_open): Likewise. (gfc_free_inquire): Likewise. (match_inquire_element): Likewise. * dump-parse-tree.c (gfc_show_code_node): Add convet for open and inquire. gfortran.h: Add convert to gfc_open and gfc_inquire. * trans-io.c (gfc_trans_open): Add convert. (gfc_trans_inquire): Likewise. * ioparm.def: Add convert to open and inquire. * gfortran.texi: Document CONVERT. 2005-12-10 Thomas Koenig <Thomas.Koenig@online.de> PR fortran/23815 * io/file_pos.c (unformatted_backspace): If flags.convert does not equal CONVERT_NATIVE, reverse the record marker. * io/open.c: Add convert_opt[]. (st_open): If no convert option is given, set CONVERT_NATIVE. If CONVERT_BIG or CONVERT_LITTLE are given, set flags.convert to CONVERT_NATIVE or CONVERT_SWAP (depending on wether we have a big- or little-endian system). * io/transfer.c (unformatted_read): Remove unused attribute from arguments. If we need to reverse bytes, break up large transfers into a loop. Split complex numbers into its two parts. (unformatted_write): Likewise. (us_read): If flags.convert does not equal CONVERT_NATIVE, reverse the record marker. (next_record_w): Likewise. (reverse_memcpy): New function. * io/inquire.c (inquire_via_unit): Implement convert. * io/io.h (top level): Add enum unit_convert. Add convert to st_parameter_open and st_parameter_inquire. Define IOPARM_OPEN_HAS_CONVERT and IOPARM_INQUIRE_HAS_CONVERT. Increase padding for st_parameter_dt. Declare reverse_memcpy(). 2005-12-10 Thomas Koenig <Thomas.Koenig@online.de> PR fortran/23815 * gfortran.dg/unf_io_convert_1.f90: New test. * gfortran.dg/unf_io_convert_2.f90: New test. * gfortran.dg/unf_io_convert_3.f90: New test. From-SVN: r108358
2005-12-03re PR fortran/25106 ([4.0/4.1] statement label is zero)Francois-Xavier Coudert1-1/+1
PR fortran/25106 * parse.c (next_free): Use new prototype for gfc_match_st_label. Correctly emit hard error if a label is zero. * match.c (gfc_match_st_label): Never allow zero as a valid label. (gfc_match, gfc_match_do, gfc_match_goto): Use new prototype for gfc_match_st_label. * primary.c (): Use new prototype for gfc_match_st_label. * io.c (): Likewise. * match.h: Likewise. From-SVN: r107999
2005-11-29io.c (gfc_resolve_open): RESOLVE_TAG access field as well.Jakub Jelinek1-0/+1
* io.c (gfc_resolve_open): RESOLVE_TAG access field as well. * gfortran.dg/open_access_1.f90: New test. From-SVN: r107665
2005-11-21re PR fortran/14943 (read/write code generation is not thread safe)Jakub Jelinek1-5/+8
gcc/fortran/ PR fortran/14943 PR fortran/21647 * Make-lang.in (fortran/trans-io.o): Depend on fortran/ioparm.def. * dump-parse-tree.c (gfc_show_code_node): Dump c->block for EXEC_{READ,WRITE,IOLENGTH} nodes. * io.c (terminate_io, match_io, gfc_match_inquire): Put data transfer commands into EXEC_{READ,WRITE,IOLENGTH}'s code->block. * resolve.c (resolve_blocks): Handle EXEC_{READ,WRITE,IOLENGTH}. * trans-io.c (ioparm_unit, ioparm_err, ioparm_end, ioparm_eor, ioparm_list_format, ioparm_library_return, ioparm_iostat, ioparm_exist, ioparm_opened, ioparm_number, ioparm_named, ioparm_rec, ioparm_nextrec, ioparm_size, ioparm_recl_in, ioparm_recl_out, ioparm_iolength, ioparm_file, ioparm_file_len, ioparm_status, ioparm_status_len, ioparm_access, ioparm_access_len, ioparm_form, ioparm_form_len, ioparm_blank, ioparm_blank_len, ioparm_position, ioparm_position_len, ioparm_action, ioparm_action_len, ioparm_delim, ioparm_delim_len, ioparm_pad, ioparm_pad_len, ioparm_format, ioparm_format_len, ioparm_advance, ioparm_advance_len, ioparm_name, ioparm_name_len, ioparm_internal_unit, ioparm_internal_unit_len, ioparm_internal_unit_desc, ioparm_sequential, ioparm_sequential_len, ioparm_direct, ioparm_direct_len, ioparm_formatted, ioparm_formatted_len, ioparm_unformatted, ioparm_unformatted_len, ioparm_read, ioparm_read_len, ioparm_write, ioparm_write_len, ioparm_readwrite, ioparm_readwrite_len, ioparm_namelist_name, ioparm_namelist_name_len, ioparm_namelist_read_mode, ioparm_iomsg, ioparm_iomsg_len, ioparm_var): Remove. (enum ioparam_type, enum iofield_type, enum iofield, enum iocall): New enums. (gfc_st_parameter_field, gfc_st_parameter): New typedefs. (st_parameter, st_parameter_field, iocall): New variables. (ADD_FIELD, ADD_STRING): Remove. (dt_parm, dt_post_end_block): New variables. (gfc_build_st_parameter): New function. (gfc_build_io_library_fndecls): Use it. Initialize iocall array rather than ioparm_*, add extra first arguments to the function types. (set_parameter_const): New function. (set_parameter_value): Add type argument, return a bitmask. Changed to set a field in automatic structure variable rather than set a field in a global _gfortran_ioparm variable. (set_parameter_ref): Likewise. If requested var has different size than what field should point to, call with a temporary and then copy into the user variable. Add postblock argument. (set_string): Remove var_len argument, add type argument, return a bitmask. Changed to set fields in automatic structure variable rather than set a field in a global _gfortran_ioparm variable. (set_internal_unit): Remove iunit, iunit_len, iunit_desc arguments, add var argument. Return a bitmask. Changed to set fields in automatic structure variable rather than set a field in a global _gfortran_ioparm variable. (set_flag): Removed. (io_result): Add var argument. Changed to read common.flags field from automatic structure variable and bitwise AND it with 3. (set_error_locus): Add var argument. Changed to set fields in automatic structure variable rather than set a field in a global _gfortran_{filename,line} variables. (gfc_trans_open): Use gfc_start_block rather than gfc_init_block. Create a temporary st_parameter_* structure. Adjust callers of all above mentioned functions. Pass address of the temporary variable as first argument to the generated function call. Use iocall array rather than ioparm_* separate variables. (gfc_trans_close, build_filepos, gfc_trans_inquire): Likewise. (build_dt): Likewise. Change first argument to tree from tree *. Don't dereference code->ext.dt if last_dt == INQUIRE. Emit IOLENGTH argument setup here. Set dt_parm/dt_post_end_block variables and gfc_trans_code the nested data transfer commands in code->block. (gfc_trans_iolength): Just set last_dt and call build_dt immediately. (transfer_namelist_element): Pass address of dt_parm variable to generated functions. Use iocall array rather than ioparm_* separate variables. (gfc_trans_backspace, gfc_trans_endfile, gfc_trans_rewind, gfc_trans_flush, gfc_trans_read, gfc_trans_write): Use iocall array rather than ioparm_* separate variables. (gfc_trans_dt_end): Likewise. Pass address of dt_parm variable as first argument to generated function. Adjust io_result caller. Prepend dt_post_end_block before io_result code. (transfer_expr): Use iocall array rather than ioparm_* separate variables. Pass address of dt_parm variables as first argument to generated functions. * ioparm.def: New file. gcc/testsuite/ PR fortran/24774 * gfortran.dg/inquire_9.f90: New test. PR fortran/21647 * gfortran.fortran-torture/execute/inquire_5.f90: New test. libgfortran/ PR fortran/24774 PR fortran/14943 PR fortran/21647 * Makefile.am (AM_CPPFLAGS): Add gcc directories as -I paths, add -D_GNU_SOURCE. * Makefile.in: Regenerated. * acinclude.m4 (LIBGFOR_CHECK_SYNC_FETCH_AND_ADD, LIBGFOR_CHECK_GTHR_DEFAULT, LIBGFOR_CHECK_PRAGMA_WEAK): New macros. * configure.ac: Add them. * configure: Rebuilt. * config.h.in: Rebuilt. * libtool-version: Bump libgfortran.so SONAME to libgfortran.so.1. * libgfortran.h (library_start, show_locus, internal_error, generate_error, find_option): Add st_parameter_common * argument. (library_end): Change into a dummy macro. * io/io.h: Include gthr.h. (SUPPORTS_WEAK): Define if HAVE_PRAGMA_WEAK. (CHARACTER): Remove define. (st_parameter, global_t): Remove typedef. (ioparm, g, ionml, current_unit): Remove variables. (init_error_stream): Remove prototype. (CHARACTER1, CHARACTER2): Define. (st_parameter_common, st_parameter_open, st_parameter_close, st_parameter_filepos, st_parameter_inquire, st_parameter_dt): New typedefs. (IOPARM_LIBRETURN_MASK, IOPARM_LIBRETURN_OK, IOPARM_LIBRETURN_ERROR, IOPARM_LIBRETURN_END, IOPARM_LIBRETURN_EOR, IOPARM_ERR, IOPARM_END, IOPARM_EOR, IOPARM_HAS_IOSTAT, IOPARM_HAS_IOMSG, IOPARM_COMMON_MASK, IOPARM_OPEN_HAS_RECL_IN, IOPARM_OPEN_HAS_FILE, IOPARM_OPEN_HAS_STATUS, IOPARM_OPEN_HAS_ACCESS, IOPARM_OPEN_HAS_FORM, IOPARM_OPEN_HAS_BLANK, IOPARM_OPEN_HAS_POSITION, IOPARM_OPEN_HAS_ACTION, IOPARM_OPEN_HAS_DELIM, IOPARM_OPEN_HAS_PAD, IOPARM_CLOSE_HAS_STATUS, IOPARM_INQUIRE_HAS_EXIST, IOPARM_INQUIRE_HAS_OPENED, IOPARM_INQUIRE_HAS_NUMBER, IOPARM_INQUIRE_HAS_NAMED, IOPARM_INQUIRE_HAS_NEXTREC, IOPARM_INQUIRE_HAS_RECL_OUT, IOPARM_INQUIRE_HAS_FILE, IOPARM_INQUIRE_HAS_ACCESS, IOPARM_INQUIRE_HAS_FORM, IOPARM_INQUIRE_HAS_BLANK, IOPARM_INQUIRE_HAS_POSITION, IOPARM_INQUIRE_HAS_ACTION, IOPARM_INQUIRE_HAS_DELIM, IOPARM_INQUIRE_HAS_PAD, IOPARM_INQUIRE_HAS_NAME, IOPARM_INQUIRE_HAS_SEQUENTIAL, IOPARM_INQUIRE_HAS_DIRECT, IOPARM_INQUIRE_HAS_FORMATTED, IOPARM_INQUIRE_HAS_UNFORMATTED, IOPARM_INQUIRE_HAS_READ, IOPARM_INQUIRE_HAS_WRITE, IOPARM_INQUIRE_HAS_READWRITE, IOPARM_DT_LIST_FORMAT, IOPARM_DT_NAMELIST_READ_MODE, IOPARM_DT_HAS_REC, IOPARM_DT_HAS_SIZE, IOPARM_DT_HAS_IOLENGTH, IOPARM_DT_HAS_FORMAT, IOPARM_DT_HAS_ADVANCE, IOPARM_DT_HAS_INTERNAL_UNIT, IOPARM_DT_HAS_NAMELIST_NAME, IOPARM_DT_IONML_SET): Define. (gfc_unit): Add lock, waiting and close fields. Change file from flexible array member into pointer to char. (open_external): Add st_parameter_open * argument. (find_file, file_exists): Add file and file_len arguments. (flush_all_units): New prototype. (max_offset, unit_root, unit_lock): New variable. (is_internal_unit, is_array_io, next_array_record, parse_format, next_format, unget_format, format_error, read_block, write_block, next_record, convert_real, read_a, read_f, read_l, read_x, read_radix, read_decimal, list_formatted_read, finish_list_read, namelist_read, namelist_write, write_a, write_b, write_d, write_e, write_en, write_es, write_f, write_i, write_l, write_o, write_x, write_z, list_formatted_write, get_unit): Add st_parameter_dt * argument. (insert_unit): Remove prototype. (find_or_create_unit, unlock_unit): New prototype. (new_unit): Return gfc_unit *. Add st_parameter_open * and gfc_unit * arguments. (free_fnodes): Remove prototype. (free_format_data): New prototype. (scratch): Remove. (init_at_eol): Remove prototype. (free_ionml): New prototype. (inc_waiting_locked, predec_waiting_locked, dec_waiting_unlocked): New inline functions. * io/unit.c (max_offset, unit_root, unit_lock): New variables. (insert): Adjust os_error caller. (insert_unit): Made static. Allocate memory here, initialize lock and after inserting it return it, locked. (delete_unit): Adjust for deletion of g. (find_unit_1): New function. (find_unit): Use it. (find_or_create_unit): New function. (get_unit): Add dtp argument, change meaning of the int argument as creation request flag. Adjust for different st_* calling conventions, lock internal unit's lock before returning it and removal of g. Call find_unit_1 instead of find_unit. (is_internal_unit, is_array_io): Add dtp argument, adjust for removal of most of global variables. (init_units): Initialize unit_lock. Adjust insert_unit callers and adjust for g removal. (close_unit_1): New function. (close_unit): Use it. (unlock_unit): New function. (close_units): Lock unit_lock, use close_unit_1 rather than close_unit. * io/close.c (st_close): Add clp argument. Adjust for new st_* calling conventions and internal function API changes. * io/file_pos.c (st_backspace, st_endfile, st_rewind, st_flush): Add fpp argument. Adjust for new st_* calling conventions and internal function API changes. (formatted_backspace, unformatted_backspace): Likewise. Add u argument. * io/open.c (edit_modes, st_open): Add opp argument. Adjust for new st_* calling conventions and internal function API changes. (already_open): Likewise. If not HAVE_UNLINK_OPEN_FILE, unlink scratch file. Instead of calling close_unit just call sclose, free u->file if any and clear a few u fields before calling new_unit. (new_unit): Return gfc_unit *. Add opp and u arguments. Adjust for new st_* calling conventions and internal function API changes. Don't allocate unit here, rather than work with already created unit u already locked on entry. In case of failure, close_unit it. * io/unix.c: Include unix.h. (BUFFER_SIZE, unix_stream): Moved to unix.h. (unit_to_fd): Add unlock_unit call. (tempfile): Add opp argument, use its fields rather than ioparm. (regular_file): Likewise. (open_external): Likewise. Only unlink file if fd >= 0. (init_error_stream): Add error argument, set structure it points to rather than filling static variable and returning its address. (FIND_FILE0_DECL, FIND_FILE0_ARGS): Define. (find_file0): Use them. Don't crash if u->s == NULL. (find_file): Add file and file_len arguments, use them instead of ioparm. Add locking. Pass either an array of 2 struct stat or file and file_len pair to find_file0. (flush_all_units_1, flush_all_units): New functions. (file_exists): Add file and file_len arguments, use them instead of ioparm. * io/unix.h: New file. * io/lock.c (ioparm, g, ionml): Remove variables. (library_start): Add cmp argument, adjust for new st_* calling conventions. (library_end): Remove. (free_ionml): New function. * io/inquire.c (inquire_via_unit, inquire_via_filename, st_inquire): Add iqp argument, adjust for new st_* calling conventions and internal function API changes. * io/format.c (FARRAY_SIZE): Decrease to 64. (fnode_array, format_data): New typedefs. (avail, array, format_string, string, error, saved_token, value, format_string_len, reversion_ok, saved_format): Remove variables. (colon_node): Add const. (free_fnode, free_fnodes): Remove. (free_format_data): New function. (next_char, unget_char, get_fnode, format_lex, parse_format_list, format_error, parse_format, revert, unget_format, next_test): Add fmt or dtp arguments, pass it all around, adjust for internal function API changes and adjust for removal of global variables. (next_format): Likewise. Constify return type. (next_format0): Constify return type. * io/transfer.c (current_unit, sf_seen_eor, eor_condition, max_pos, skips, pending_spaces, scratch, line_buffer, advance_status, transfer): Remove variables. (transfer_integer, transfer_real, transfer_logical, transfer_character, transfer_complex, transfer_array, current_mode, read_sf, read_block, read_block_direct, write_block, write_block_direct, unformatted_read, unformatted_write, type_name, write_constant_string, require_type, formatted_transfer_scalar, us_read, us_write, pre_position, data_transfer_init, next_record_r, next_record_w, next_record, finalize_transfer, iolength_transfer, iolength_transfer_init, st_iolength, st_iolength_done, st_read, st_read_done, st_write, st_write_done, st_set_nml_var, st_set_nml_var_dim, next_array_record): Add dtp argument, pass it all around, adjust for internal function API changes and removal of global variables. * io/list_read.c (repeat_count, saved_length, saved_used, input_complete, at_eol, comma_flag, last_char, saved_string, saved_type, namelist_mode, nml_read_error, value, parse_err_msg, nml_err_msg, prev_nl): Remove variables. (push_char, free_saved, next_char, unget_char, eat_spaces, eat_separator, finish_separator, nml_bad_return, convert_integer, parse_repeat, read_logical, read_integer, read_character, parse_real, read_complex, read_real, check_type, list_formatted_read_scalar, list_formatted_read, finish_list_read, find_nml_node, nml_untouch_nodes, nml_match_name, nml_query, namelist_read): Add dtp argument, pass it all around, adjust for internal function API changes and removal of global variables. (nml_parse_qualifier): Likewise. Add parse_err_msg argument. (nml_read_obj): Likewise. Add pprev_nl, nml_err_msg, clow and chigh arguments. (nml_get_obj_data): Likewise. Add pprev_nl and nml_err_msg arguments. (init_at_eol): Removed. * io/read.c (convert_real, read_l, read_a, next_char, read_decimal, read_radix, read_f, read_x): Add dtp argument, pass it all around, adjust for internal function API changes and removal of global variables. (set_integer): Adjust internal_error caller. * io/write.c (no_leading_blank, nml_delim): Remove variables. (write_a, calculate_sign, calculate_G_format, output_float, write_l, write_float, write_int, write_decimal, write_i, write_b, write_o, write_z, write_d, write_e, write_f, write_en, write_es, write_x, write_char, write_logical, write_integer, write_character, write_real, write_complex, write_separator, list_formatted_write_scalar, list_formatted_write, nml_write_obj, namelist_write): Add dtp argument, pass it all around, adjust for internal function API changes and removal of global variables. (extract_int, extract_uint, extract_real): Adjust internal_error callers. * runtime/fpu.c (_GNU_SOURCE): Don't define here. * runtime/error.c: Include ../io/unix.h. (filename, line): Remove variables. (st_printf): Pass address of a local variable to init_error_stream. (show_locus): Add cmp argument. Use fields it points to rather than filename and line variables. (os_error, runtime_error): Remove show_locus calls. (internal_error): Add cmp argument. Pass it down to show_locus. (generate_error): Likewise. Use flags bitmask instead of non-NULL check for iostat and iomsg parameter presence, adjust for st_* calling convention changes. * runtime/stop.c (stop_numeric, stop_string): Remove show_locus calls. * runtime/pause.c (pause_numeric, pause_string): Likewise. * runtime/string.c: Include ../io/io.h. (find_option): Add cmp argument. Pass it down to generate_error. * intrinsics/flush.c (recursive_flush): Remove. (flush_i4, flush_i8): Use flush_all_units. Add unlock_unit call. * intrinsics/rand.c: Include ../io/io.h. (rand_seed_lock): New variable. (srand, irand): Add locking. (init): New constructor function. * intrinsics/random.c: Include ../io/io.h. (random_lock): New variable. (random_r4, random_r8, arandom_r4, arandom_r8): Add locking. (random_seed): Likewise. open failed if fd < 0. Set i correctly. (init): New constructor function. * intrinsics/system_clock.c (tp0, t0): Remove. (system_clock_4, system_clock_8): Don't subtract tp0/t0 from current time, use just integer arithmetics. * intrinsics/tty.c (isatty_l4, isatty_l8, ttynam_sub): Add unlock_unit calls. From-SVN: r107328
2005-11-06re PR fortran/24534 (PUBLIC derived types with private components)Paul Thomas1-0/+7
2005-11-06 Paul Thomas <pault@gcc.gnu.org> PR fortran/24534 * resolve.c (resolve_symbol): Exclude case of PRIVATE declared within derived type from error associated with PRIVATE type components within derived type. PR fortran/20838 PR fortran/20840 * gfortran.h: Add prototype for gfc_has_vector_index. * io.c (gfc_resolve_dt): Error if internal unit has a vector index. * expr.c (gfc_has_vector_index): New function to check if any of the array references of an expression have vector inidices. (gfc_check_pointer_assign): Error if internal unit has a vector index. PR fortran/17737 * data.c (gfc_assign_data_value): Remove gcc_assert that caused the ICE and replace by a standard dependent warning/error if overwriting an existing initialization. * decl.c (gfc_data_variable): Remove old error for already initialized variable and the unused error check for common block variables. Add error for hots associated variable and standard dependent error for common block variables, outside of blockdata. * symbol.c (check_conflict): Add constraints for DATA statement. 2005-11-06 Paul Thomas <pault@gcc.gnu.org> PR fortran/24534 gfortran.dg/private_type_2.f90: Modified to check that case with PRIVATE declaration within derived type is accepted. PR fortran/20838 gfortran.dg/pointer_assign_1.f90: New test. PR fortran/20840 * gfortran.dg/arrayio_0.f90: New test. PR fortran/17737 gfortran.dg/data_initialized.f90: New test. gfortran.dg/data_constraints_1.f90: New test. gfortran.dg/data_constraints_2.f90: New test. From-SVN: r106567
2005-09-20re PR fortran/23420 (ICE on invalid print statement)Tobias Schlüter1-40/+52
fortran/ PR fortran/23420 * io.c (resolve_tag): Don't allow non-CHARACTER constants as formats. (match_io): Fix usage of gfc_find_symbol. testsuite/ PR fortran/23420 * gfortran.dg/print_fmt_4.f: New. From-SVN: r104454
2005-09-17re PR fortran/15586 (gfortran should support i18n in its compiler messages)Francois-Xavier Coudert1-11/+11
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-09-09gfortran.h: Add iomsg to gfc_open, gfc_close, gfc_filepos, gfc_inquire and ↵Thomas Koenig1-0/+31
gfc_dt. 2005-09-09 Thomas Koenig <Thomas.Koenig@online.de> * gfortran.h: Add iomsg to gfc_open, gfc_close, gfc_filepos, gfc_inquire and gfc_dt. * dump-parse-tree.c (gfc_show_code_node): Add iomsg for open, close, file positioning, inquire and namelist. * io.c (io_tag): Add tag_iomsg. (resolve_tag): Add standards warning for iomsg. (match_open_element): Add iomsg. (gfc_free_open): Add iomsg. (gfc_resolve_open): Add iomsg. (gfc_free_close): Add iomsg. (match_close_element): Add iomsg. (gfc_resolve_close): Add iomsg. (gfc_free_filepos): Add iomsg. (match_file_element): Add iomsg. (gfc_resolve_filepos): Add iostat and iomsg. (match-dt_element): Add iomsg. (gfc_free_dt): Add iomsg. (gfc_resolve_dt): Add iomsg. (gfc_free_inquire): Add iomsg. (match_inquire_element): Add iomsg. (gfc_resolve_inquire): Add iomsg. * trans_io.c: Add ioparm_iomsg and ioparm_iomsg_len. (gfc_build_io_library_fndecls): Add iomsg as last field. (gfc_trans_open): Add iomsg. (gfc_trans_close): Add iomsg. (build_fileos): Call set_string for iomsg. (gfc_trans_inquire): Add iomsg. (build_dt): Add iomsg. 2005-09-09 Thomas Koenig <Thomas.Koenig@online.de> * io/io.h: Add iomsg as last field of st_parameter. * runtime/error.c (generate_error): If iomsg is present, copy the message there. 2005-09-09 Thomas Koenig <Thomas.Koenig@online.de> * gfortran.dg/iomsg_1.f90: New test case. From-SVN: r104102
2005-09-04re PR fortran/23661 ('print fmt' is unclassifiable statement in gfortran)Tobias Schlüter1-22/+28
fortran/ PR fortran/23661 * io.c (match_io): Correctly backup if PRINT followed by symbol which is not a namelist. Force blank between PRINT and namelist in free form. testsuite/ PR fortran/23661 * gfortran.dg/print_fmt_1.f90, gfortran.dg/print_fmt_2.f90 gfortran.dg/print_fmt_3.f90: New test. From-SVN: r103824
2005-08-14re PR fortran/21432 (gfortran does not support printing of namelists)Paul Thomas1-0/+24
2005-08-14 Paul Thomas <pault@gcc.gnu.org> PR fortran/21432. * io.c (match_io): Add code to implement PRINT namelist. 2005-08-14 Paul Thomas <pault@gcc.gnu.org> PR fortran/21432. * gfortran.dg/namelist_print_1.f: New test of functionality of PRINT namelist. * gfortran.dg/namelist_print_2.f: New test to check that PRINT namelist generates error with -std=f95. From-SVN: r103079
2005-08-07[multiple changes]Janne Blomqvist1-4/+12
2005-08-07 Janne Blomqvist <jblomqvi@cc.hut.fi> PR fortran/22390 * dump-parse-tree.c (gfc_show_code_node): Add case for FLUSH. * gfortran.h: Add enums for FLUSH. * io.c (gfc_free_filepos,match_file_element,match_filepos): Modify comment appropriately. (gfc_match_flush): New function. * match.c (gfc_match_if): Add match for flush. * match.h: Add prototype. * parse.c (decode_statement): Add flush to 'f' case. (next_statement): Add case for flush. (gfc_ascii_statement): Likewise. * resolve.c (resolve_code): Add flush case. * st.c (gfc_free_statement): Add flush case. * trans-io.c: Add prototype for flush. (gfc_build_io_library_fndecls): Build fndecl for flush. (gfc_trans_flush): New function. * trans-stmt.h: Add prototype. * trans.c (gfc_trans_code): Add case for flush. 2005-08-07 Janne Blomqvist <jblomqvi@cc.hut.fi> PR fortran/22390 * io/backspace.c: File removed, contents moved to ... * io/endfile.c: Ditto. * io/rewind.c: Ditto. * io/file_pos.c: New file, ... here. * Makefile.am: Add file_pos.c to list, remove obsolete files. * Makefile.in: Regenerated. 2005-08-07 Janne Blomqvist <jblomqvi@cc.hut.fi> Steven G. Kargl <kargls@comcast.net> PR fortran/22390 * gfortran.dg/flush_1.f90: New test. Co-Authored-By: Steven G. Kargl <kargls@comcast.net> From-SVN: r102835
2005-07-07For the 60th anniversary of Chinese people��s Anti-Japan war victory.Feng Wang1-19/+49
2005-07-07 Feng Wang <fengwang@nudt.edu.cn> PR fortran/16531 PR fortran/15966 PR fortran/18781 * arith.c (gfc_hollerith2int, gfc_hollerith2real, gfc_hollerith2complex, gfc_hollerith2character, gfc_hollerith2logical): New functions. (eval_intrinsic): Don't evaluate if Hollerith constant arguments exist. * arith.h (gfc_hollerith2int, gfc_hollerith2real, gfc_hollerith2complex, gfc_hollerith2character, gfc_hollerith2logical): Add prototypes. * expr.c (free_expr0): Free memery allocated for Hollerith constant. (gfc_copy_expr): Allocate and copy string if Expr is from Hollerith. (gfc_check_assign): Enable conversion from Hollerith to other. * gfortran.h (bt): Add BT_HOLLERITH. (gfc_expr): Add from_H flag. * intrinsic.c (gfc_type_letter): Return 'h' for BT_HOLLERITH. (add_conversions): Add conversions from Hollerith constant to other. (do_simplify): Don't simplify if Hollerith constant arguments exist. * io.c (resolve_tag): Enable array in FORMAT tag under GFC_STD_GNU. * misc.c (gfc_basetype_name): Return "HOLLERITH" for BT_HOLLERITH. (gfc_type_name): Print "HOLLERITH" for BT_HOLLERITH. * primary.c (match_hollerith_constant): New function. (gfc_match_literal_constant): Add match Hollerith before Integer. * simplify.c (gfc_convert_constant): Add conversion from Hollerith to other. * trans-const.c (gfc_conv_constant_to_tree): Use VIEW_CONVERT_EXPR to convert Hollerith constant to tree. * trans-io.c (gfc_convert_array_to_string): Get array's address and length to set string expr. (set_string): Deal with array assigned Hollerith constant and character array. * gfortran.texi: Document Hollerith constants as extention support. 2005-07-07 Feng Wang <fengwang@nudt.edu.cn> PR fortran/16531 PR fortran/15966 PR fortran/18781 * gfortran.dg/hollerith.f90: New. * gfortran.dg/hollerith2.f90: New. * gfortran.dg/hollerith3.f90: New. * gfortran.dg/hollerith4.f90: New. * gfortran.dg/hollerith_f95.f90: New. * gfortran.dg/hollerith_legacy.f90: New. * gfortran.dg/g77/cpp4.F: New. Port from g77. 2005-07-07 Feng Wang <fengwang@nudt.edu.cn> PR fortran/16531 * io/transfer.c (formatted_transfer): Enable FMT_A on other types to support Hollerith constants. From-SVN: r101688
2005-07-03re PR fortran/20842 (can't use 'END=' in output statement)François-Xavier Coudert1-1/+8
PR fortran/20842 * io.c (match_dt_element): Do not allow END tag in PRINT or WRITE statement. * gfortran.dg/io_invalid_1.f90: New test. From-SVN: r101545
2005-06-25Update FSF address.Kelley Cook1-2/+2
From-SVN: r101310