Commit Graph

543 Commits

Author SHA1 Message Date
Francois-Xavier Coudert 1ec601bf9f re PR fortran/32049 (Support on x86_64 also kind=16)
/
2010-11-13  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
            Tobias Burnus  <burnus@net-b.de>

        PR fortran/32049
        * Makefile.def: Add libquadmath; build it with language=fortran.
        * configure.ac: Add libquadmath.
        * Makefile.tpl: Handle multiple libs in check-[+language+].
        * Makefile.in: Regenerate.
        * configure: Regenerate.

libquadmath/
2010-11-13  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
            Tobias Burnus  <burnus@net-b.de>

        PR fortran/32049
        Initial implementation and checkin.

gcc/fortran/
2010-11-13  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
            Tobias Burnus  <burnus@net-b.de>

        PR fortran/32049
        * gfortranspec.c (find_spec_file): New function.
        (lang_specific_driver): Try to find .spec file and use it.
        * trans-io.c (iocall): Define
        * IOCALL_X_REAL128/COMPLEX128(,write).
        (gfc_build_io_library_fndecls): Build decl for __float128 I/O.
        (transfer_expr): Call __float128 I/O functions.
        * trans-types.c (gfc_init_kinds): Allow kind-16 belonging
        to __float128.

gcc/testsuite/
2010-11-13  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
            Tobias Burnus  <burnus@net-b.de>

        PR fortran/32049
        * gfortran.dg/quad_1.f90: New.
        * lib/gcc-defs.exp (gcc-set-multilib-library-path): Use also
        compiler arguments.
        * lib/gfortran.exp (gfortran_link_flags): Add libquadmath to
        library search path; call gcc-set-multilib-library-path with
        arguments such that libgfortran.spec is found.
        (gfortran_init): Add path for libgfortran.spec to
GFORTRAN_UNDER_TEST.

libgomp/
2010-11-13  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
            Tobias Burnus  <burnus@net-b.de>

        PR fortran/32049
        * configure.ac: 
        * configure: Regenerate.

libgfortran/
2010-11-13  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
            Tobias Burnus  <burnus@net-b.de>

        PR fortran/32049
        * Makefile.am: Add missing pow_r16_i4.c, add transfer128.c,
        link libquadmath, if used.
        * acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Add.
        * configure.ac: Use it, touch spec file.
        * gfortran.map: Add pow_r16_i4 and
        transfer_(real,complex)128(,write) functions.
        * intrinsics/cshift0.c (cshift0): Handle __float128 type.
        * intrinsics/erfc_scaled_inc.c: Ditto.
        * intrinsics/pack_generic.c (pack): Ditto
        * intrinsics/spread_generic.c (spread): Ditto.
        * intrinsics/unpack_generic.c (unpack1): Ditto.
        * io/read.c (convert_real): Ditto.
        * io/transfer.c: Update comments.
        * io/transfer128.c: New file.
        * io/write_float.def (write_float): Handle __float128 type.
        * libgfortran.h: #include quadmath_weak.h, define __builtin_infq
        and nanq.
        * m4/mtype.m4: Handle __float128 type.
        * runtime/in_pack_generic.c (internal_pack): Ditto.
        * runtime/in_unpack_generic.c (internal_unpack): Ditto.
        * kinds-override.h: New file.
        * libgfortran.spec.in: Ditto.
        * generated/pow_r16_i4.c: Generated.
        * Makefile.in: Regenerate.
        * configure: Regenerate.
        * config.h: Regenerate.
        * bessel_r10.c: Regenerate.
        * bessel_r16.c: Regenerate.
        * bessel_r4.c: Regenerate.
        * bessel_r8.c: Regenerate.
        * exponent_r16.c: Regenerate.
        * fraction_r16.c: Regenerate.
        * nearest_r16.c: Regenerate.
        * norm2_r10.c: Regenerate.
        * norm2_r16.c: Regenerate.
        * norm2_r4.c: Regenerate.
        * norm2_r8.c: Regenerate.
        * rrspacing_r16.c: Regenerate.
        * set_exponent_r16.c: Regenerate.
        * spacing_r16.c: Regenerate.


Co-Authored-By: Tobias Burnus <burnus@net-b.de>

From-SVN: r166825
2010-11-16 22:23:19 +01:00
Janne Blomqvist 7debf73d34 Cache stat values, reduce syscalls
From-SVN: r166502
2010-11-09 20:17:35 +02:00
Jerry DeLisle 54d4b3bcb2 re PR libfortran/46373 (fflush called when reading from a string)
2010-11-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/46373
	* io/transfer.c (data_transfer_init): Do not call flush_if_preconnected
	if this is an internal unit.

From-SVN: r166490
2010-11-09 13:51:57 +00:00
Janne Blomqvist ce66b6f6ca PR 44931 Move struct unix_stream to unix.c
From-SVN: r166325
2010-11-04 21:29:28 +02:00
Janne Blomqvist 332b9a5c15 Remove prot from unix_stream
From-SVN: r166284
2010-11-04 01:07:11 +02:00
Janne Blomqvist 576e00858c Remove unused empty_internal_buffer function
From-SVN: r166276
2010-11-03 22:49:31 +02:00
Jerry DeLisle fc5f5bb770 re PR fortran/43899 (Wrong unused-variable warning with NAMELISTs)
2010-11-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/43899
	* runtime/error.c (generate_warning): New function to generate a run
	time warning message. Fix some whitespace.
	* libgfortran.h: Add prototype for new function.
	* io/list_read.c (nml_read_obj): Use new function to warn when a
	character namelist object is truncated.  Only warn if compiled
	with -fbounds-check.

From-SVN: r166252
2010-11-03 15:22:25 +00:00
Janne Blomqvist c86af7f3e4 PR 45629 Remove usage of setjmp/longjmp
From-SVN: r166180
2010-11-02 14:56:38 +02:00
Jerry DeLisle 5609699aff re PR fortran/46010 (I/O: Namelist-reading bug)
2010-10-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/46010
	* io/list_read.c (nml_parse_qualifier): Add additional conditions for
	setting the end index for loop specification. Fix some whitespace.
	* io/write.c (write_default_char4): Const-ify the source argument.

From-SVN: r165979
2010-10-26 19:05:08 +00:00
Jerry DeLisle a11930ba8d io.h: Remove definition of the BT enumerator.
2010-10-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/io.h: Remove definition of the BT enumerator.
	* libgfortran.h: Replace GFC_DTYPE enumerator with BT.
	* intrinsics/iso_c_generated_procs.c: Likewise
	* intrinsics/date_and_time.c: Likewise.
	* intrinsics/iso_c_binding.c: Likewise.
	* io/list_read.c: Likewise.
	* io/transfer.c: Likewise.
	* io/write.c: Likewise.

2010-10-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* gfortran.h: Remove definition of bt enumerator.
	* libgfortran.h: Add bt enumerator type alighned with defintion.
	Remove the dtype enumerator, no longer used.
	previously given in libgfortran/io.h
	* trans-types.c: Use new bt enumerator.
	* trans-io.c: Likewise.

From-SVN: r165675
2010-10-19 01:28:50 +00:00
Thomas Koenig 6eb6875d7e re PR tree-optimization/20165 (Pointer does not really escape with write)
2010-10-16  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/20165
	PR fortran/31593
	PR fortran/43665
	* gfortran.map:  Add _gfortran_transfer_array_write,
	_gfortran_transfer_array_write, _gfortran_transfer_character_write,
	_gfortran_transfer_character_wide_write,
	_gfortran_transfer_complex_write,
	_gfortran_transfer_integer_write,
	_gfortran_transfer_logical_write and
	_gfortran_transfer_real_write.
	* io/transfer.c (transfer_integer_write):  Add prototype and
	function body as call to the original function, without the
	_write.
	(transfer_real_write):  Likewise.
	(transfer_logical_write):  Likewise.
	(transfer_character_write):  Likewise.
	(transfer_character_wide_write):  Likewise.
	(transfer_complex_write):  Likewise.
	(transfer_array_write):  Likewise.

2010-10-16  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/20165
	PR fortran/31593
	PR fortran/43665
	* trans-io.c (enum iocall): Add IOCALL_X_INTEGER_WRITE,
	IOCALL_X_LOGICAL_WRITE, IOCALL_X_CHARACTER_WRITE,
	IOCALL_X_CHARACTER_WIDE_WRIE, IOCALL_X_REAL_WRITE,
	IOCALL_X_COMPLEX_WRITE and IOCALL_X_ARRAY_WRITE.
	(gfc_build_io_library_fndecls):  Add corresponding function
	decls.
	(transfer_expr):  If the current transfer is a READ, use
	the iocall with the original version, otherwise the version
	with _WRITE.
	(transfer_array_desc):  Likewise.

From-SVN: r165559
2010-10-16 16:06:07 +00:00
Jerry DeLisle 4363c7a151 re PR fortran/45710 (Adjust format and padding for WRITE of NAMELIST group to internal file)
2010-09-22  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/45710
	* io/write.c (namelist_write_newline): Pad character array internal
	unit records with spaces.

From-SVN: r164543
2010-09-23 00:53:15 +00:00
Jerry DeLisle 3bddec9b92 re PR libfortran/45723 (opening /dev/null for appending writes)
2010-09-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/45723
	* io/open.c (new_unit): On POSITION_APPEND don't seek if file length is
	zero.

From-SVN: r164507
2010-09-22 03:10:24 +00:00
Jerry DeLisle 3423894f17 re PR fortran/45532 (gfortran namelist read error)
2010-09-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/45532
	* io/list_read.c (nml_get_obj_data): Set first_nl if the previous
	is NULL.

From-SVN: r164266
2010-09-14 04:37:02 +00:00
Francois-Xavier Coudert b1012ca4be acinclude.m4 (LIBGFOR_CHECK_FOR_BROKEN_ISFINITE, [...]): Remove.
* acinclude.m4 (LIBGFOR_CHECK_FOR_BROKEN_ISFINITE,
	LIBGFOR_CHECK_FOR_BROKEN_ISNAN,
	LIBGFOR_CHECK_FOR_BROKEN_FPCLASSIFY): Remove.
	* configure.ac: Remove above checks.
	* libgfortran.h: Define isnan, isinf, isfinite, isnormal and
	signbit in terms of the respective built-ins.
	* io/write_float.def (WRITE_FLOAT): Use signbit() instead of
	__builtin_signbit().
	* intrinsics/c99_functions.c (tgamma): Use isnan() instead of
	__builtin_isnan().
	* config.h.in: Regenerate.
	* configure: Regenerate.

From-SVN: r164119
2010-09-09 18:47:11 +00:00
Tobias Burnus a4a7e2f5f7 re PR libfortran/45323 (warnings compiling libgfortran/io/write.c: array subscript has type 'char')
2010-08-23  Tobias Burnus  <burnus@net-b.de>

        PR fortran/45323
        * io/write.c (nml_write_obj, namelist_write): Cast argument
        of toupper to int.

From-SVN: r163469
2010-08-23 14:39:20 +02:00
Jerry DeLisle e172187979 re PR fortran/45108 (Namelist read: Not aborted when reading from STDIN)
2010-08-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/45108
	* io/list_read.c (namelist_read): If namelist reading fails, use
	generate_error and then continue the read loop.

From-SVN: r163387
2010-08-19 20:28:09 +00:00
Jerry DeLisle c613801e8b re PR fortran/44931 (For INPUT_UNIT, INQUIRE NAME= should not return "stdin")
2010-08-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/44931
	* io/inquire.c (inquire_via_unit): Add special case for __MINGW32__ to
	return special file names CONIN$, CONOUT$, and CONERR$.

From-SVN: r163245
2010-08-14 18:59:18 +00:00
Jerry DeLisle da0747b9b5 re PR fortran/45143 ([F2008,corrig1] Endless loop with unlimited edit descriptor)
2010-08-07  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/45143
	* io/format.c: Remove fnode storage structure definitions, moving these
	to format.h. (parse_format_list): Add check for data descriptors,
	taking care of nested formats. Adjust calling parameters to pass a
	check flag. (parse_format): Likewise.
	* io/format.h: Add structures moved from format.c.

From-SVN: r162978
2010-08-07 12:03:23 +00:00
Janne Blomqvist 3571367557 Don't update the position flag for non-seekable files, check for stell() error.
From-SVN: r162810
2010-08-02 09:22:23 +03:00
Janne Blomqvist 47dad3ff97 Use access(2) instead of stat(2) to test file existence.
From-SVN: r162798
2010-08-01 14:22:18 +03:00
David Edelsohn f32013906e * io/inquire.c: Include io.h before string.h.
From-SVN: r162788
2010-07-31 17:37:25 -04:00
Jerry DeLisle 01b9977477 re PR fortran/44931 (For INPUT_UNIT, INQUIRE NAME= should not return "stdin")
2010-07-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/44931
	* io/inquire.c (inquire_via_unit): Use ttyname to return actual device
	file name for stdin, stdout, and stderr.  If ttyname does not succeed
	fall back to default names for these units. Include string.h to allow
	using strlen function.
	* unix.c: Remove typedef of unix_stream structure, move to unix.h.
	* unix.h: Add typedef of unix_stream structure so that it is
	accessible to inquire.c.

From-SVN: r162667
2010-07-29 01:32:23 +00:00
Jerry DeLisle 746e63273f re PR fortran/44953 (FAIL: gfortran.dg/char4_iunit_1.f03 * execution test)
2010-07-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/44953
	* io/unix.c (mem_alloc_w4): Return gfc_char4_t instead of char type
	pointer. (mem_write4): Remove cast to gfc_char4_t.
	* io/transfer.c (write_block): Use a gfc_char4_t pointer.
	(memset4): New helper function. (next_record_w): Use new helper
	function rather than sset for internal units.  Don't attempt to pad
	with spaces if it is not needed.
	* io/unix.h: Update prototype for mem_alloc_w4.
	* io/write.c (memset4): Use gfc_char4_t pointer and chracter type.
	Don't use multiply by 4 to compute offset. (memcpy4): Likewise.
	(write_default_char4): Use a gfc_char4_t pointer and update memset4
	and memcpy calls. (write_a): Likewise. (write_l): Likewise.
	(write_boz): Likewise. (write_decimal): Likewise. (write_x): Likewise.
	(write_char): Add support for character(kind=4) internal units that
	was previously missed. (write_integer): Use a gfc_char4_t pointer and
	update memset4 and memcpy calls. (write_character): Likewise.
	(write_separator): Add support for character(kind=4) internal units
	that was previously missed.
	* write_float.def (output_float): Use a gfc_char4_t pointer and
	update memset4 and memcpy calls. (write_infnan): Likewise.
	(output_float_FMT_G_): Likewise.

From-SVN: r162304
2010-07-19 13:11:54 +00:00
Jerry DeLisle 74db2a472a re PR fortran/37077 (Implement Internal Unit I/O for character KIND=4)
2010-07-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/37077
	* io/read.c (read_default_char4): Add support for reading into a
	kind-4 character variable from a character(kind=4) internal unit.
	* io/io.h (read_block_form4): Add prototype.
	* io/unit.c (get_internal_unit): Add call to fbuf_init.
	(free_internal_unit): Add call to fbuf_destroy. (get_unit): Fix
	whitespace.
	* io/transfer.c (read_sf_internal): Use fbuf_alloc to allocate a string
	to recieve the wide characters translated to single byte chracters.
	(read_block_form): Fix whitespace. (read_block_form4): New function to
	read from a character(kind=4) internal unit into a character(kind=4)
	variable. (read_block_direct): Fix whitespace. (write_block): Fix
	whitespace. (formatted_transfer_scalar_read): Likewise.
	(formatted_transfer_scalar_write): Likewise.
	* io/write.c (write_character): Add support for list directed write of
	a kind=1 character string to a character(kind=4) internal unit.

From-SVN: r162260
2010-07-16 14:16:04 +00:00
Jerry DeLisle c0d1689058 re PR fortran/44934 (Bogus "Missing format for FORMATTED data transfer")
2010-07-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/44934
	* io/file_pos.c (st_endfile): Correctly set unit flags for form.

From-SVN: r162203
2010-07-15 03:40:56 +00:00
Jerry DeLisle c7421e06ca re PR fortran/37077 (Implement Internal Unit I/O for character KIND=4)
2010-07-12  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/37077
	* io/read.c: Fix comment.
	* io/io.h (is_char4_unit): New macro.
	* io/unit.c (get_internal_unit): Call new function open_internal4.
	* io/unix.c (mem_alloc_r4): New function. (mem_alloc_w4): New function.
	(mem_read4): New function, temporary stub. (mem_write4): New function.
	(open_internal4): New function to set stream pointers to use the new
	mem functions.
	* io/transfer.c (write_block): Use new mem_alloc_w4 to access internal
	units of kind=4.
	* io/unix.h: Add prototypes for open_internal4, mem_alloc_w4, and
	mem_alloc_r4.
	* io/write.c (memset4): New helper function. (memcpy4): New helper
	function. (write_default_char4): Use new helper functions.
	(write_a): Likewise. (write_l): Likewise. (write_boz): Likewise.
	(write_decimal): Likewise. (write_x): Likewise.
	(write_integer): Likewise.
	* io/write_float.def (output_float): Add code blocks to handle internal
	unit kind=4 output utilizing gfc_char4_t pointers. (write_infnan): Use
	new helper functions. (OUTPUT_FLOAT_FMT_G): Update this macro likewise.

From-SVN: r162123
2010-07-13 02:12:08 +00:00
Kai Tietz 5bf935c3c8 re PR fortran/44698 (I/O: FLUSH does not actually flush the buffer?)
2010-07-11  Kai Tietz  <kai.tietz@onevision.com>

	PR libfortran/44698
	* io/unix.c (flush_buf): Add _commit for WIN32.

From-SVN: r162060
2010-07-11 20:43:25 +00:00
Tobias Burnus 7a0208b791 re PR libfortran/43298 (fortran library does not read in NaN -Inf or Inf)
2010-06-28  Tobias Burnus  <burnus@net-b.de>

        PR fortran/43298
        * list_read.c (parse_real): Do not pass (..) on for NAN(..).
        * read.c (convert_real): Fix comment about NAN/INF.

From-SVN: r161735
2010-07-02 21:07:30 +02:00
Jerry DeLisle 457bcf66d1 re PR libfortran/43298 (fortran library does not read in NaN -Inf or Inf)
2010-06-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/43298
	* io/read.c: Add code to parse and read Inf, Infinity, NaN, and Nan with
	optional parenthesis.

From-SVN: r161585
2010-06-30 01:35:56 +00:00
Tobias Burnus 83377c6a3f re PR libfortran/43298 (fortran library does not read in NaN -Inf or Inf)
2010-06-28  Tobias Burnus  <burnus@net-b.de>

        PR fortran/43298
        * list_read.c (parse_real, read_real): Support NAN(alphanum).

2010-06-28  Tobias Burnus  <burnus@net-b.de>

        PR fortran/43298
        * gfortran.dg/nan_6.f90: New.

From-SVN: r161510
2010-06-28 22:04:40 +02:00
Tobias Burnus 58fc89f6b9 decl.c (gfc_match_entry): Mark ENTRY as GFC_STD_F2008_OBS.
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-06-25 21:17:21 +02:00
Jerry DeLisle b9983d610a re PR fortran/44477 (Sequential I/O with END FILE: File position should be at EoF)
2010-06-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/44477
	* io/file_pos.c (st_endfile): Add check for ENDFILE when file is
	already positioned after the EOF marker. Use find_or_create_unit
	instead of find_unit. If unit is not connected, connect it and create 
	the file with default settings.
	* io/transfer.c (data_transfer_init):  Add check for attempted READ or
	WRITE when file is already positioned after the EOF marker.

From-SVN: r161020
2010-06-19 00:58:28 +00:00
Janne Blomqvist 68cb9e8a47 Fix typo in symbol visibility specification
From-SVN: r159187
2010-05-08 17:43:32 +03:00
Janne Blomqvist bb408e876c Remove free_mem
From-SVN: r159160
2010-05-07 18:55:59 +03:00
Kai Tietz e7fc9c75d0 unix.c (raw_truncate): Explicit cast from integer-scal to pointer.
2010-04-30  Kai Tietz  <kai.tietz@onevision.com>

        PR/43844
        * io/unix.c (raw_truncate): Explicit cast from integer-scal
        to pointer.
        (empfile): Use for mingw GetTempPath and avoid double slash
        for path.

From-SVN: r158925
2010-04-30 11:15:03 +02:00
Kai Tietz 01d42eb543 unix.c (tempfile): Correct logic for mktemp case.
2010-04-24  Kai Tietz  <kai.tietz@onevision.com>

        PR/43844
        * io/unix.c (tempfile): Correct logic for mktemp case.

From-SVN: r158686
2010-04-24 14:24:33 +02:00
Janne Blomqvist b879c108b2 PR libfortran/43605 FTELL intrinsic, take 2.
Co-Authored-By: Dominique d'Humieres <dominiq@lps.ens.fr>

From-SVN: r157932
2010-04-01 23:51:45 +03:00
Paul Thomas a1ff2ab8e4 transfer.c: Update copyright.
2010-04-01  Paul Thomas  <pault@gcc.gnu.org>

	* io/transfer.c : Update copyright.
	* io/unix.c : ditto
	* io/read.c : ditto
	* io/io.h : ditto
	* io/unix.h : ditto
	* io/inquire.c : ditto
	* io/format.c : ditto
	* io/list_read.c : ditto
	* runtime/error.c : ditto
	* libgfortran.h : ditto
	* intrinsics/date_and_time.c: ditto
	* intrinsics/args.c : ditto

From-SVN: r157924
2010-04-01 18:22:00 +00:00
Janne Blomqvist e76a3fde81 PR libfortran/43605 Fix FTELL for formatted files
Co-Authored-By: Manfred Schwarb <manfred99@gmx.ch>

From-SVN: r157914
2010-04-01 19:22:57 +03:00
Jerry DeLisle 6c1400dd58 re PR fortran/43265 (No EOF condition if reading with '(x)' from an empty file)
2010-03-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/43265
	* io/transfer.c (next_record_r): Only call hit_eof for specific
	conditions when an EOF is encountered.

From-SVN: r157810
2010-03-30 03:22:28 +00:00
Tobias Burnus 10fa280a98 re PR libfortran/43551 (Buffered direct I/O reads wrong record)
2010-03-29  Tobias Burnus  <burnus@net-b.de>

        PR fortran/43551
        * io/unix.c (buf_write): Set physical_offset after lseek.

2010-03-29  Tobias Burnus  <burnus@net-b.de>

        PR fortran/43551
        * gfortran.dg/direct_io_12.f90: New test.

From-SVN: r157792
2010-03-29 08:17:19 +02:00
Jerry DeLisle 6a10835a6b re PR fortran/43517 (spurious end-of-file condition when namelist read follows formatted read)
2010-03-25  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/43517
	* io/read.c (read_x): Return if seen EOR condition.

From-SVN: r157737
2010-03-26 03:23:34 +00:00
Jerry DeLisle 260f179b8d re PR fortran/43409 (I/O: INQUIRE for SIZE does not work.)
2010-03-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/43409
	* io/io.h: Fix type of size in st_parameter_inquire structure.

From-SVN: r157618
2010-03-22 02:39:02 +00:00
Jerry DeLisle 41c3cddc6b re PR fortran/43409 (I/O: INQUIRE for SIZE does not work.)
2010-03-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/43409
	* ioparm.def: Change inquire size variable to type pointer to
	GFC_IO_INT type.

2010-03-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/43409
	* io/unix.h: Add prototype for new function to return file size.
	* io/unix.c (file_size): New function.
	* io/inquire.c (inquire_via_unit): Use new function.
	(inquire_via_filename): Use new function.

From-SVN: r157593
2010-03-20 14:39:00 +00:00
Jerry DeLisle bf71e8f028 transfer.c (read_sf_internal): Remove stray function declaration used during debigging.
2010-03-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/transfer.c (read_sf_internal): Remove stray function declaration
	used during debigging.

From-SVN: r157531
2010-03-18 03:26:07 +00:00
Jerry DeLisle 59011a60c0 re PR fortran/43265 (No EOF condition if reading with '(x)' from an empty file)
2010-03-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/43265
	* io/io.h: Delete prototype for read_sf, making it static.
	* io/read.c (read_x): Modify to call hit_eof if PAD="no".
	* io/transfer.c (read_sf_internal): New static function extracted from
	read_sf for use on internal units only. Handle empty string case.
	(read_sf): New factoring of this function, make it static.  Add special
	conditions for EOF based on ADVANCE="no", PAD="no", and whether any
	bytes have been previously read from the record.
	(read_block_form): Modify to call read_sf or read_sf_internal.
	(next_record_r): Add a done flag similar to next_record_w. Call hit_eof
	if internal array unit next record returns finished, meaning an EOF was
	found and not done, ie not the last record expected.  For external
	units call hit_eof if item_count is 1 or there are no pending spaces.
	(next_record): Update call to next_record_r.

From-SVN: r157527
2010-03-18 02:38:17 +00:00
Kai Tietz b2ef02df53 format.c (parse_format_list): Add to ERROR, WARNING, SILENT enumerators NOTIFICATION_ prefix.
2010-03-12  Kai Tietz  <kai.tietz@onevision.com>

        PR/42950
        * io/format.c (parse_format_list): Add to ERROR, WARNING,
        SILENT enumerators NOTIFICATION_ prefix.
        * runtime/error.c (notification_std): Likewise.
        * libgfortran.h (notification): Likewise.
        (GFC_LARGEST_BUF): Check for HAVE_GFC_INTEGER_16.

From-SVN: r157407
2010-03-12 15:43:55 +01:00
Tobias Burnus 2f4d643dab re PR fortran/43228 (NAMELIST I/O: Reading at 2 dimensions (rank) array values.)
2010-03-11  Tobias Burnus  <burnus@net-b.de>

        PR fortran/43228
        * io/list_read.c (nml_parse_qualifier): Disable expanded_read
        for array sections.

2010-03-11  Tobias Burnus  <burnus@net-b.de>

        PR fortran/43228
        * gfortran.dg/namelist_61.f90: New test.

From-SVN: r157389
2010-03-11 17:06:37 +01:00
Jerry DeLisle b7137299f1 re PR libfortran/43320 (200.sixtrack fails setup)
2010-03-10  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/43320
	* io/transfer.c (next_record_r): Add hit_eof based on item_count
	condition.

From-SVN: r157377
2010-03-11 02:15:33 +00:00