Commit Graph

648 Commits

Author SHA1 Message Date
Tobias Burnus 3215710740 re PR fortran/50815 (ICE on allocation of deferred length character scalar dummy argument when -fbounds-check)
2011-12-08  Tobias Burnus  <burnus@net-b.de>

        PR fortran/50815
        * trans-decl.c (add_argument_checking): Skip bound checking
        for deferred-length strings.

2011-12-08  Tobias Burnus  <burnus@net-b.de>

        PR fortran/50815
        * gfortran.dg/bounds_check_16.f90: New.

From-SVN: r182134
2011-12-08 20:00:55 +01:00
Janne Blomqvist 992b0aa1cf Let the compiler decide whether to inline.
2011-11-10  Janne Blomqvist  <jb@gcc.gnu.org>

	* intrinsics/cpu_time.c (__cpu_time_1): Don't force inlining.
	* intrinsics/random.c (rnumber_4): Remove inline attribute.
	(rnumber_8, rnumber_10, rnumber_16): Likewise.
	* intrinsics/system_clock.c (gf_gettime_mono): Likewise.
	* intrinsics/time_1.h (ATTRIBUTE_ALWAYS_INLINE): Remove macro.
	(gf_cputime): Add inline attribute for MingW version.
	* io/format.c (format_hash): Remove inline attribute.
	* io/io.h (memset4): Inline function from transfer.c and write.c
	moved here.
	* io/transfer.c (min_off): Remove inline attribute.
	(memset4): Move to io.h.
	* io/write.c (memset4): Likewise.
	(memcpy4): Remove inline attribute.
	* io/write_float.def (calculate_exp): Likewise.

From-SVN: r181260
2011-11-10 19:08:24 +02:00
Janne Blomqvist 7454437875 Configure cleanup.
2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>

	* configure.ac (AC_STDC_HEADERS): Remove.
	(AC_HEADER_TIME): Remove.
	(AC_HAVE_HEADERS, AC_CHECK_HEADERS): Move into a single invocation
	of AC_CHECK_HEADERS_ONCE, don't check for presence of C89 headers.
	(AC_CHECK_MEMBERS): Use single invocation.
	(AC_CHECK_FUNCS): Move into single invocation of
	AC_CHEC_FUNCS_ONCE, don't check for presence of C89 functions.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* intrinsics/clock.c: Include time.h.
	(mclock): Assume clock() is present.
	(mclock8): Likewise.
	* intrinsics/ctime.c (strctime): Assume strftime is present.
	(fdate): Assume time() is present.
	(fdate_sub): Likewise.
	(ctime): Likewise.
	* intrinsics/date_and_time.c: Don't provide abs macro.
	(HAVE_NO_DATE_TIME): Remove code related to macro which is never
	set.
	* intrinsics/execute_command_line.c: Assume stdlib.h is present.
	* intrinsics/exit.c: Likewise.
	* intrinsics/extends_type_of.c: Likewise.
	* intrinsics/gerror.c: Assume strerror() is present.
	* intrinsics/kill.c: Assume signal.h is present.
	* intrinsics/malloc.c: Assume stdlib.h is present.
	* intrinsics/move_alloc.c: Likewise.
	* intrinsics/perror.c: Assume perror() is present.
	* intrinsics/signal.c: Assume signal.h is present.
	* intrinsics/stat.c: Assume stdlib.h is present.
	* intrinsics/system.c: Likewise.
	* intrinsics/time.c: Include time.h, assume time() is present.
	* intrinsics/time_1.h: Conditionally include sys/time.h,
	unconditionally time.h.
	(gf_cputime): Do division in double, fallback using clock().
	(gf_gettime): Assume time() is present.
	* intrinsics/umask.c: Assume stdlib.h is present.
	* runtime/backtrace.c: Likewise.
	* runtime/compile_options.c: Assume signal.h is present, assume
	C89 signals are present.
	* runtime/error.c: Assume signal.h and stdlib.h are present.

From-SVN: r181227
2011-11-09 20:25:58 +02:00
Janne Blomqvist ed10039e8b PR 50016 Slow I/O on MingW due to _commit
frontend ChangeLog:

2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/50016
	* gfortran.texi (Data consistency and durability): New section.


testsuite ChangeLog:

2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/50016
	* gfortran.dg/inquire_size.f90: Don't flush the unit.

libgfortran ChangeLog:

2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/50016
	* io/inquire.c (inquire_via_unit): Flush the unit and use ssize.
	* io/unix.c (buf_flush): Don't call _commit.

From-SVN: r181207
2011-11-09 17:46:15 +02:00
Janne Blomqvist 0948d15384 Revert previous fix for PR 45723.
libgfortran ChangeLog:

2011-11-07  Janne Blomqvist  <jb@gcc.gnu.org>

        PR libfortran/45723
        * io/open.c (new_unit): Don't check file size before attempting
        seek.


testsuite ChangeLog:

2011-11-07  Janne Blomqvist  <jb@gcc.gnu.org>

        PR libfortran/45723
        * gfortran.dg/open_dev_null.F90: Remove testcase.

From-SVN: r181085
2011-11-07 16:32:50 +02:00
Janne Blomqvist eb6a1e56e0 Copyright years and whitespace fix for r180734
From-SVN: r180736
2011-11-01 14:03:38 +02:00
Janne Blomqvist ea5e3c042b Cleanup NEWUNIT allocation.
2011-11-01  Janne Blomqvist  <jb@gcc.gnu.org>

	* io/io.h (next_available_newunit): Remove prototype.
	* io/unit.h (next_available_newunit): Make variable static,
	initialize it.
	(init_units): Don't initialize next_available_newunit.
	(get_unique_unit_number): Use atomic builtin if available.

From-SVN: r180734
2011-11-01 13:44:12 +02:00
Janne Blomqvist 08810e5257 Update file position for inquire lazily.
libgfortran ChangeLog:

2011-10-31  Janne Blomqvist  <jb@gcc.gnu.org>

	* io/inquire.c (inquire_via_unit): Check whether we're at the
	beginning or end if the position is unspecified. If the position
	is not one of the 3 standard ones, return unspecified.
	* io/io.h (update_position): Remove prototype.
	* io/transfer.c (next_record): Set the position to unspecified,
	letting inquire figure it out more exactly when needed.
	* io/unit.c (update_position): Remove function.


testsuite ChangeLog:

2011-10-31  Janne Blomqvist  <jb@gcc.gnu.org>

	* gfortran.dg/inquire_5.f90: Update testcase to match the standard
	and current implementation.

From-SVN: r180703
2011-10-31 16:59:19 +02:00
Janne Blomqvist 3469bd8660 Introduce a size member function to struct stream.
2011-10-31  Janne Blomqvist  <jb@gcc.gnu.org>

	* io/unix.h (struct stream): Add size function pointer.
	(ssize): New inline function.
	(file_length): Remove prototype.
	* io/unix.c (raw_size): New function.
	(raw_init): Initialize st.size pointer.
	(buf_size): New function.
	(buf_init): Initialize st.size pointer.
	(open_internal): Likewise.
	(open_internal4): Likewise.
	(file_length): Remove function.
	* io/file_pos.c (st_rewind): Use ssize instead of file_length.
	* io/open.c (test_endfile): Likewise.
	* io/transfer.c (data_transfer_init): Likewise.
	(next_record_r): Likewise.
	(next_record_w): Likewise.
	* io/unit.c (update_position): Likewise.

From-SVN: r180702
2011-10-31 16:52:26 +02:00
Janne Blomqvist 7d5ee21935 Simplify handling of special files.
2011-10-31  Janne Blomqvist  <jb@gcc.gnu.org>

* io/file_pos.c (st_rewind): Handle regular and special files
identically.
* io/intrinsics.c (fseek_sub): Don't check whether we think the
file is seekable, just do what the caller says.
* io/transfer.c (skip_record): First try to seek, then fallback to
reading and throwing away what we read.
* io/unit.c (update_position): Don't check whether file is
seekable, just try to do what we're told.
(unit_truncate): Likewise.
* io/unix.c (struct unix_stream): Remove special_file flag.
(buf_flush): Remove code for handling unseekable files.
(buf_seek): Likewise.
(fd_to_stream): Use buffered IO only for regular files.
(file_length): Remove is_seekable() call.
(is_seekable): Remove function.
(is_special): Likewise.
* io/unix.h: Remove prototypes for is_seekable and is_special.

From-SVN: r180701
2011-10-31 16:45:50 +02:00
Tobias Burnus a2f3eae24d re PR fortran/50109 (Formatted namelist read with multiple "!" fails with: Cannot match namelist object name !)
2011-08-18  Tobias Burnus  <burnus@net-b.de>

        PR fortran/50109
        * io/list_read.c (eat_separator): Fix skipping over "!" lines.

2011-08-18  Tobias Burnus  <burnus@net-b.de>

        PR fortran/50109
        * gfortran.dg/namelist_73.f90: New.

From-SVN: r177858
2011-08-18 16:23:41 +02:00
Tobias Burnus f5e62ce922 re PR libfortran/49791 (Formatted namelist reads fails with: Cannot match namelist object)
2011-07-23  Tobias Burnus  <burnus@net-b.de>

        PR fortran/49791
        * io/list_read.c (nml_parse_qualifier): Remove check to
        enabled extended read for another case.

2011-07-23  Tobias Burnus  <burnus@net-b.de>

        PR fortran/49791
        * gfortran.dg/namelist_72.f: New.

From-SVN: r176661
2011-07-23 00:44:20 +02:00
Janne Blomqvist 5f54710465 PR 49296 List read, EOF without preceding separator
2011-07-13  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/49296
	* io/list_read.c (read_logical): Don't error out if a valid value
	is followed by EOF instead of a normal separator.
	(read_integer): Likewise.

testsuite:

2011-07-13  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/49296
	* gfortran.dg/read_list_eof_1.f90: Add tests for integer, real,
	and logical reads.

From-SVN: r176245
2011-07-13 21:46:44 +03:00
Janne Blomqvist d3ff9ee468 PR 49296 List directed read of string ending in EOF.
libgfortran ChangeLog entry:

2011-06-18  Janne Blomqvist  <jb@gcc.gnu.org>

        PR libfortran/49296
        * io/list_read.c (read_character): Accept EOF as a separator when
        reading string.


testsuite ChangeLog entry:

2011-06-18  Janne Blomqvist  <jb@gcc.gnu.org>

        PR libfortran/48296
	* gfortran.dg/read_list_eof_1.f90: New test.

From-SVN: r175166
2011-06-18 10:53:09 +03:00
Janne Blomqvist 09ad57ec8f Return error when trying to seek a non-seekable buffered file
From-SVN: r174947
2011-06-11 13:52:18 +03:00
Janne Blomqvist 5ea0705af7 Figure out whether a file is seekable with lseek()
From-SVN: r174946
2011-06-11 13:19:49 +03:00
Janne Blomqvist 04a4a57b1b PR 19155 Check for strtod failure via endptr
From-SVN: r174393
2011-05-29 11:59:44 +03:00
Janne Blomqvist 1028b2bded Error printing thread safety, remove GFORTRAN_USE_STDERR
From-SVN: r173749
2011-05-14 10:55:51 +03:00
Jerry DeLisle d6b872ad5e re PR libfortran/48787 (Invalid UP/DOWN rounding with F editing)
2011-05-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/48787
	* io/write_float.def (output_float): Adjust up and down rounding for
	cases where 'd' = 0. Gather common code to one location.

From-SVN: r173408
2011-05-05 01:19:30 +00:00
Jerry DeLisle 7c4f44cd60 re PR libfortran/48787 (Invalid UP/DOWN rounding with F editing)
2011-05-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/48787
	* io/write_float.def (output_float): Gather up integer declarations and
	add new 'p' for scale factor. Use 'p' in place of the 'dtp' reference
	everywhere. For ROUND_UP scan the digit string and only perform
	rounding if something other than '0' is found.

From-SVN: r173231
2011-05-01 12:32:18 +00:00
Janne Blomqvist 1e03060224 Fix path handling
From-SVN: r173172
2011-04-29 19:09:45 +03:00
Janne Blomqvist 848eab5c43 PR 48488 Typo
From-SVN: r173171
2011-04-29 19:06:48 +03:00
Janne Blomqvist ef6d0b6760 PR 48488 Fix comments
From-SVN: r173170
2011-04-29 19:03:54 +03:00
Janne Blomqvist d785f6a394 PR 48488 Fix comments
From-SVN: r173169
2011-04-29 18:58:20 +03:00
Jerry DeLisle a3f02fe44c re PR libfortran/48488 (Wrong default format for real numbers)
2011-04-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
	    Janne Blomqvist  <jb@gcc.gnu.org>

	PR libgfortran/48488
	PR libgfortran/48602
	PR libgfortran/48615
	PR libgfortran/48684
	PR libgfortran/48787
	* io/write.c (write_d, write_e, write_f, write_en,
	write_es): Add precision compemsation parameter to call.
	(set_fnode_default): Adjust default widths to assure
	round trip on write and read. (write_real): Adjust call to write_float.
	(write_real_g0): Calculate compensation for extra precision and adjust
	call to write_float. 
	* io/write_float.def (output_float_FMT_G_): Use volatile rather than
	asm volatile to avoid optimization issue. Correctly calculate the
	number of blanks (nb) to be appended and simplify calculation logic.
	(write_float): Increase MIN_FIELD_WIDTH by one to accomodate the new
	default widths. Eliminate the code that attempted to reduce the
	the precision used in later sprintf functions.  Add call parameter to
	compensate for extra precision.

Co-Authored-By: Janne Blomqvist <jb@gcc.gnu.org>

From-SVN: r173166
2011-04-29 14:56:02 +00:00
Jim Meyering 046957830e remove useless if-before-free tests
Change "if (E) free (E);" to "free (E);" everywhere except in the
libgo/, intl/, zlib/ and classpath/ directories.
Also transform equivalent variants like
"if (E != NULL) free (E);" and allow an extra cast on the
argument to free.  Otherwise, the tested and freed "E"
expressions must be identical, modulo white space.

From-SVN: r172785
2011-04-20 18:19:03 +00:00
Jerry DeLisle b48de48389 re PR libfortran/48602 (Invalid F conversion of G descriptor for values close to powers of 10)
2011-04-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/48602
	* io/write_float.def (output_float_FMT_G): Fix reversal in conditional.
	Use asm volatile to mark temp variable, avoiding optimization errors.

From-SVN: r172753
2011-04-20 04:18:25 +00:00
Jerry DeLisle bc7409a8a9 re PR libfortran/48602 (Invalid F conversion of G descriptor for values close to powers of 10)
2011-04-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/48602
	* io/write_float.def (output_float_FMT_G): Use current rounding mode
	to set the rounding parameters. (output_float): Skip rounding
	if value is zero.

From-SVN: r172634
2011-04-18 03:48:25 +00:00
Janne Blomqvist d30fe1c5cd Replace sprintf with snprintf
From-SVN: r172590
2011-04-16 20:43:03 +03:00
Jerry DeLisle 0b0a0c945f re PR libfortran/48589 (Invalid G0/G0.d editing for NaN/infinity)
2011-04-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/48589
	* io/write_float.def (write_infnan): Set width properly for G0.

From-SVN: r172502
2011-04-15 16:29:44 +00:00
Janne Blomqvist 44720bef9d Cleanup memsize types
From-SVN: r172340
2011-04-12 22:27:49 +03:00
Tobias Burnus 99ebea0382 unix.c: Adapt stat DEFINEs since MinGW64 supports LFS.
2011-04-04  Tobias Burnus  <burnus@net-b.de>

        * unix.c: Adapt stat DEFINEs since MinGW64 supports LFS.
        (fallback_access, open_internal4, compare_file_filename,
        find_file, file_size, inquire_sequential, inquire_direct,
        inquire_formatted): Use "struct stat" instead of gfstat_t.

From-SVN: r171911
2011-04-03 17:44:02 +02:00
Jerry DeLisle 27deda791b re PR libfortran/48030 (Implement read_x using fbuf_getc)
2011-03-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/48030
	* io/read.c (read_x): Re-implement using fbuf_getc.

From-SVN: r171378
2011-03-24 01:48:57 +00:00
John David Anglin 458653cc06 re PR libfortran/35667 (HP-UX 10 has broken strtod)
PR fortran/35667
	* io/io.h (convert_infnan): Declare.
	* io/read.c (convert_infnan): New.
	(read_f): Use convert_infnan to convert INFs and NANs.
	* list_read.c (parse_real, read_real): Likewise.

From-SVN: r171182
2011-03-19 17:25:18 +00:00
Francois-Xavier Coudert 14bef49e53 re PR libfortran/47439 (Fun with scratch files on Windows MKTEMP only allows for 26 files)
PR libfortran/47439

	* io/unix.c (tempfile): Work around poor mktemp() implementations.

	* gfortran.dg/scratch_1.f90: New test.

From-SVN: r171178
2011-03-19 12:09:27 +00:00
Jerry DeLisle 8e71a20690 re PR libfortran/48047 (Incorrect output rounding of double precision numbers)
2011-03-11  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/48047
	* io/write_float.def (write_float): Change MIN_FIELD_WIDTH to 48.

From-SVN: r170895
2011-03-12 00:49:51 +00:00
Jerry DeLisle 0eac6ca562 re PR libfortran/47567 (Wrong output for small absolute values with F editing)
2011-02-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/47567
	* io/write_float.def (output_float): Move handling of w = 0 to after
	output rounding. Check for zero and set zero_flag accordingly. Set
	width according to zero_flag. Add better comments.

From-SVN: r170585
2011-03-01 02:24:50 +00:00
Jerry DeLisle 353255cd6f re PR fortran/47778 (reading two arrays of structures from namelist fails)
2011-02-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/47778
	* io/list_read.c (namelist_read): Intialize the error string buffere.
	If pprev_nl was used during the previous namelist read and the rank
	was zero, reset the pointer to NULL for the next namelist read.

From-SVN: r170548
2011-02-27 20:06:10 +00:00
Francois-Xavier Coudert fe230fccd4 re PR libfortran/45165 (unix.c:fallback_access() leaks file descriptors)
PR libfortran/45165
	* unix.c (fallback_access): Fix file descriptor leaks.

From-SVN: r170517
2011-02-26 15:21:45 +00:00
Jakub Jelinek ae01ced508 re PR fortran/47878 (187.facerec miscompares)
PR fortran/47878
	* io/transfer.c (read_sf): Call fbuf_getptr only at the end,
	and subtract n, dtp->u.p.sf_seen_eor and seen_comma from it.

	* gfortran.dg/pr47878.f90: New test.

From-SVN: r170476
2011-02-24 21:13:57 +01:00
Jerry DeLisle 5a30f819c7 re PR libfortran/47567 (Wrong output for small absolute values with F editing)
2011-02-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/47567
	* io/write_float.def (output_float): Remove special case handling of
	zero with width 1.

From-SVN: r170458
2011-02-24 04:52:00 +00:00
Janne Blomqvist a2c037bdec PR 47694 Read from named pipe fails
Co-Authored-By: Jerry DeLisle <jvdelisle@gcc.gnu.org>

From-SVN: r170432
2011-02-23 08:59:51 +02:00
Jerry DeLisle ffe89a288f re PR libfortran/47567 (Wrong output for small absolute values with F editing)
2011-02-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/47567
	* io/write_float.def (output_float): Adjust width for F0.d to
	allow space for negative signs on zero.

From-SVN: r170318
2011-02-19 15:10:55 +00:00
Jerry DeLisle fc2c5998f7 re PR libfortran/47567 (Wrong output for small absolute values with F editing)
2011-02-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/47567
	* io/list_read.c (read_logical): Check for end of line before calling
	eat_line. (read_integer): Likewise. (parse_real): Don't unget the
	separator. Check for end of line before calling	eat_line.
	(read_complex): Allow line-end before and after parenthesis and comma.
	Check for end of line before calling eat_line. (read_real): Check for
	end of line before calling eat_line.

From-SVN: r170239
2011-02-17 05:19:50 +00:00
Jakub Jelinek 1d92226be3 re PR fortran/47642 (real(kind=16) - libquadmath - segfault on amd64 FreeBSD)
PR fortran/47642
	* libquadmath.texi (quadmath_snprintf): Document.
	(quadmath_flt128tostr): Remove.
	* Makefile.am (libquadmath_la_SOURCES): Add printf/*.c.
	Remove  quadmath_io.c, gdtoa/gdtoa.c, gdtoa/g__fmt.c,
	gdtoa/g_Qfmt.c, gdtoa/dmisc.c and gdtoa/ulp.c.
	* quadmath.h (quadmath_snprintf): New prototype.
	(quadmath_flt128tostr): Remove.
	* quadmath_weak.h (quadmath_snprintf): Add.
	(quadmath_flt128tostr): Remove.
	* configure.ac: New AC_CHECK_HEADERS headers: langinfo.h, wchar.h,
	wctype.h, limits.h, ctype.h, printf.h, errno.h.
	(AC_USE_SYSTEM_EXTENSIONS): Add.
	(HAVE_HIDDEN_VISIBILITY, HAVE_PRINTF_HOOKS,
	USE_LOCALE_SUPPORT, USE_I18N_NUMBER_H): New checks.
	* quadmath.map (QUADMATH_1.0): Add quadmath_snprintf.  Remove
	quadmath_flt128tostr.
	* printf/printf_fphex.c: New file.
	* printf/_itowa.h: New file.
	* printf/mul_n.c: New file.
	* printf/quadmath-printf.h: New file.
	* printf/submul_1.c: New file.
	* printf/quadmath-printf.c: New file.
	* printf/gmp-impl.h: New file.
	* printf/lshift.c: New file.
	* printf/fpioconst.h: New file.
	* printf/add_n.c: New file.
	* printf/cmp.c: New file.
	* printf/sub_n.c: New file.
	* printf/mul.c: New file.
	* printf/divrem.c: New file.
	* printf/addmul_1.c: New file.
	* printf/printf_fp.c: New file.
	* printf/_itoa.h: New file.
	* printf/fpioconst.c: New file.
	* printf/_i18n_number.h: New file.
	* printf/flt1282mpn.c: New file.
	* printf/rshift.c: New file.
	* printf/mul_1.c: New file.
	* quadmath_io.c: Removed.
	* gdtoa/gdtoa.c: Removed.
	* gdtoa/g__fmt.c: Removed.
	* gdtoa/g_Qfmt.c: Removed.
	* gdtoa/dmisc.c: Removed.
	* gdtoa/ulp.c: Removed.
	* config.h.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.

	* io/write_float.def (DTOAQ): Use quadmath_snprintf instead of
	quadmath_flt128tostr.
	* io/transfer128.c (tmp2): Initialize to quadmath_snprintf instead
	of quadmath_flt128tostr.

From-SVN: r170135
2011-02-14 16:34:44 +01:00
Jerry DeLisle 9e7628863b re PR libfortran/47567 (Wrong output for small absolute values with F editing)
2011-02-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/47567
	* io/write_float.def (output_float): Eliminate some redundant code.
	Adjust width for case of F0.X for values of zero and all other values.
	Expand cases where '*' is set to give cleaner results.

From-SVN: r169853
2011-02-05 17:58:48 +00:00
Jerry DeLisle 6e0576ee50 re PR libfortran/47434 (Wrong field width for NaN with (F0.n) formatting)
2011-01-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/47434
	* io/write_float.def (write_infnan): Use calculate_sign to determine
	if the sign should be given and check field widths accordingly.

From-SVN: r169390
2011-01-29 17:31:04 +00:00
Janne Blomqvist 6a0f6e7799 PR 47432 Use ttyname_r() if available
From-SVN: r169337
2011-01-27 22:05:45 +02:00
Jerry DeLisle 434b897293 re PR libfortran/47285 (G format outputs wrong number of characters when decimal supplied in literal)
2011-01-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/47285
	* io/write_float.def (output_float): Return SUCCESS or FAILURE and use
	the result to set the padding.

From-SVN: r169320
2011-01-27 02:16:18 +00:00
Janne Blomqvist 723553bdc1 PR 46267 strerror thread safety
From-SVN: r169110
2011-01-22 00:42:17 +02:00
Janne Blomqvist 9cd72574bc PR47296 Segfault when running out of file descriptors
From-SVN: r168888
2011-01-17 07:48:10 +02:00
Jakub Jelinek e313241f91 re PR fortran/46625 (libquadmath: Mangle internal symbols; rename __float128 <-> string functions)
PR fortran/46625
	* quadmath.map (QUADMATH_1.0): Remove quadmath_strtopQ
	and quadmath_dtoaq.  Add strtoflt128 and quadmath_flt128tostr.
	* quadmath_weak.h (quadmath_strtopQ, quadmath_dtoaq): Remove.
	(strtoflt128, quadmath_flt128tostr): Add.
	* gdtoa/strtopQ.c (quadmath_strtopQ): Rename to...
	(strtoflt128): ... this.  Return __float128, instead of writing
	to memory pointed by last argument.
	* quadmath.h: Use C style comments instead of C++ style.
	(quadmath_strtopQ, quadmath_dtoaq): Remove prototypes.
	(strtoflt128, quadmath_flt128tostr): Add prototypes.
	* libquadmath.texi (quadmath_dtoaq): Rename to quadmath_flt128tostr.
	(quadmath_strtopQ): Rename to strtoflt128.  Adjust prototype,
	adjust examples.
	* quadmath_io.c (quadmath_dtoaq): Rename to...
	(quadmath_flt128tostr): ... this.
libgfortran/
	* io/write_float.def (DTOAQ): Use quadmath_flt128tostr
	instead of quadmath_dtoa.
	* io/transfer128.c (tmp1, tmp2): New variables, bring in
	strtoflt128 and quadmath_flt128tostr.
	(transfer_real128, transfer_real128_write, transfer_complex128,
	transfer_complex128_write): Remove tmp1/tmp2 variables.
	* io/read.c (convert_real): Use strtoflt128 instead of
	quadmath_strtopQ, adjust for the changed arguments and return
	value.

From-SVN: r168856
2011-01-16 17:55:27 +01:00
Jerry DeLisle 050d1a59d1 re PR fortran/47296 (I/O Segfault when running out of file descriptors)
2011-01-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/47296
	* io/unix.c (unpack_filename): Return non-zero if the filename passed
	in is NULL.

From-SVN: r168832
2011-01-15 06:42:30 +00:00
Jerry DeLisle 43e0224a58 re PR libfortran/47154 (END= does not work in namelist read)
2011-01-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/47154
	* io/list_read.c (namelist_read): Remove calls to hit_eof to avoid the
	duplicate calls via next_record.

From-SVN: r168502
2011-01-05 03:53:15 +00:00
Jakub Jelinek d652f226fc Update Copyright years for files modified in 2010.
From-SVN: r168438
2011-01-03 21:52:22 +01:00
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