gcc/fortran ChangeLog:
2012-05-14 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/52428
* gfortran.texi: Update _gfortran_set_options documentation.
* invoke.texi: Remove runtime behavior description of
-fno-range-check.
* trans-decl.c (create_main_function): Don't pass the range-check
setting to the library.
libgfortran ChangeLog:
2012-05-14 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/52428
* io/io.h (max_value): Rename to si_max, remove second argument.
* io/list_read.c (convert_integer): Use unsigned types when
parsing the digits, set max value depending on the sign.
* io/read.c (max_value): Rename to si_max, remove second argument,
simplify.
(read_decimal): Set max value depending on sign, always check
overflow.
(read_radix): Calculate max unsigned value directly.
* libgfortran.h (struct compile_options_t): Remove range_check
field.
* runtime/compile_options.c (set_options): Skip handling
options[7].
(init_compile_options): Don't set removed field.
gcc/testsuite ChangeLog:
2012-05-14 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/52428
* gfortran.dg/int_range_io_1.f90: New test.
From-SVN: r187478
2012-05-05 Janne Blomqvist <jb@gcc.gnu.org>
* gfortran.texi (GFORTRAN_TMPDIR): Rename to TMPDIR, explain
algorithm for choosing temp directory.
2012-05-05 Janne Blomqvist <jb@gcc.gnu.org>
* config.h.in: Regenerated.
* configure: Regenerated.
* configure.ac: Add checks for getegid and __secure_getenv.
* io/unix.c (P_tmpdir): Fallback definition for macro.
(tempfile_open): New function.
(tempfile): Use secure_getenv, call tempfile_open to try each
directory in turn.
* libgfortran.h (DEFAULT_TMPDIR): Remove macro.
(secure_getenv): New macro/prototype.
* runtime/environ.c (secure_getenv): New function.
(variable_table): Rename GFORTRAN_TMPDIR to TMPDIR.
* runtime/main.c (find_addr2line): Use secure_getenv.
From-SVN: r187190
2012-04-17 Tobias Burnus <burnus@net-b.de>
PR libfortran/38199
PR libfortran/50673
* io/unit.c (get_internal_unit): Properly check for the presence
of the format string.
From-SVN: r186548
2012-04-15 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/38199
PR libfortran/50673
* intrinsics/string_intriniscs_inc.c (string_len_trim):
Remove prototypes for string_len_trim and move to...
* libgfortran.h (string_len_trim): ... here and
(string_len_trim_char4): ...here.
* io/unit.c: For non-array internal arrays where we do reading,
adjust the record length to the last non-blank character.
* io/unix.c: Fix typo.
From-SVN: r186466
2012-03-17 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/52608
* io/write_float.def (output_float): Move removal of initial zeros
until after the scale factor has been applied.
From-SVN: r185486
2012-03-15 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/52434
PR libfortran/48878
PR libfortran/38199
* io/unit.c (get_internal_unit): Default to ROUND_UNSPECIFIED.
(init_units): Likewise.
* io/write_float.def (determine_precision): New function.
(output_float): Take into account buffer with %f format, no need
for our own rounding if unspecified or processor specified
rounding.
(DTOA): Simplify format string, add parameters.
(FDTOA): New macros similar to DTOA, but using %f format.
(OUTPUT_FLOAT_FMT_G): Stack allocate newf, determine correct
precision and fill buffer.
(EN_PREC): New macro.
(determine_en_precision): New function.
(WRITE_FLOAT): For G format, move buffer filling into
output_float_FMT_G, use FDTOA for F format.
(write_float): Increase buffer due to F format.
testsuite ChangeLog:
2012-03-15 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/52434
PR libfortran/48878
PR libfortran/38199
* gfortran.dg/edit_real_1.f90: Don't assume roundTiesToAway.
* gfortran.dg/round_1.f03: Likewise.
From-SVN: r185433
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
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
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 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-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-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-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-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
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-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-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