* intrinsics/c99_functions.c (log10l): New log10l function for
systems where this is not available.
* c99_protos.h: Prototype for log10l function.
* libgfortran.h: Use generated kinds.h to define GFC_INTEGER_*,
GFC_UINTEGER_*, GFC_LOGICAL_*, GFC_REAL_*, GFC_COMPLEX_*. Update
prototypes for gfc_itoa and xtoa.
* io/io.h: Update prototypes for set_integer and max_value.
* io/list_read.c (convert_integer): Use new
GFC_(INTEGER|REAL)_LARGEST type.
* io/read.c (set_integer): Likewise.
(max_value): Likewise.
(convert_real): Likewise.
(real_l): Likewise.
(next_char): Likewise.
(read_decimal): Likewise.
(read_radix): Likewise.
(read_f): Likewise.
* io/write.c (extract_int): Use new GFC_INTEGER_LARGEST type.
(extract_real): Use new GFC_REAL_LARGEST type.
(calculate_exp): Likewise.
(calculate_G_format): Likewise.
(output_float): Likewise. Use log10l for long double values.
Add comment for sprintf format. Use GFC_REAL_LARGEST_FORMAT.
(write_l): Use new GFC_INTEGER_LARGEST type.
(write_float): Use new GFC_REAL_LARGEST type.
(write_int): Remove useless special case for (len < 8).
(write_decimal): Use GFC_INTEGER_LARGEST.
(otoa): Use GFC_UINTEGER_LARGEST as argument.
(btoa): Use GFC_UINTEGER_LARGEST as argument.
* runtime/error.c (gfc_itoa): Use GFC_INTEGER_LARGEST as
argument.
(xtoa): Use GFC_UINTEGER_LARGEST as argument.
* Makefile.am: Use mk-kinds-h.sh to generate header kinds.h
with all Fortran kinds available.
* configure.ac: Check for strtold and log10l.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* config.h.in: Regenerate.
* mk-kinds-h.sh: Configuration script for available integer
and real kinds.
* lib/target-supports.exp: Add
check_effective_target_fortran_large_real and
check_effective_target_fortran_large_int to check for
corresponding effective targets.
* gfortran.dg/large_integer_kind_1.f90: New test.
* gfortran.dg/large_real_kind_1.f90: New test.
From-SVN: r101274
PR libfortran/19155
* io/read.c (convert_real): strtod can set errno to EINVAL on an
empty string, but we shouldn't have an error in that case.
From-SVN: r101128
PR libfortran/19216
* io/list_read.c (eat_separator): No need to call next_record,
even in non-namelist_mode.
* gfortran.dg/pr19216.f: Add correct space between brackets and
dg directive.
From-SVN: r101105
PR libfortran/16436
* io/transfer.c (read_sf): Correct updating of bytes_left field.
(formatted_transfer): Correct updating of bytes_left field and
reformatting code (comments and whitespace).
* io/unix.c (move_pos_offset): "active" field should not be
changed here. Whitespace corrections.
* gfortran.dg/g77/f77-edit-t-in.f: Not XFAIL-ed any more.
From-SVN: r101100
2005-06-12 Steven G. Kargl <kargls@comcast.net>
Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/PR21797
* m4/cexp.m4 (csqrt`'q): Add type qualifyer to
sqrt and fabs.
* generated/exp_c4.c: Regenerated.
Co-Authored-By: Thomas Koenig <Thomas.Koenig@online.de>
From-SVN: r100864
2005-06-11 Thomas Koenig <Thomas.Koenig@onlinde.de>
PR libfortran/21333
* Makefile.am: Add in_pack_c4.c, in_pack_c8.c, in_unpack_c4.c
and in_unpack_c8.c.
* Makefile.in: Regenerate.
* libgfortran.h: Declare internal_pack_c4, internal_pack_c8,
internal_unpack_c4 and internal_unpack_c8.
* m4/in_pack.m4: Use rtype_ccode insteald of rtype_kind
in function name.
Use sizeof (rtype_name) as size for memory allocation.
* m4/in_unpack.m4: Use rtype_ccode insteald of rtype_kind
in function name.
Use sizeof (rtype_name) for calculation of sizes for memcpy.
* runtime/in_pack_generic.c: For real, integer and logical
call internal_pack_4 if size==4 and internal_pack_8 if
size==8.
For complex, call internal_pack_c4 if size==8 and
internal_pack_c8 if size==16.
* runtime/in_unpack_generic.c: For real, integer and logical
call internal_unpack_4 if size==4 and internal_unpack_8 if
size==8.
For complex, call internal_unpack_c4 if size==8 and
internal_unpack_c8 if size==16.
* generated/in_pack_i4.c: Regenerated.
* generated/in_pack_i8.c: Regenerated.
* generated/in_unpack_i4.c: Regenerated.
* generated/in_unpack_i8.c: Regenerated.
* generated/in_pack_c4.c: New file.
* generated/in_pack_c8.c: New file.
* generated/in_unpack_c4.c: New file.
* generated/in_unpack_c8.c: New file.
2005-05-11 Thomas Koenig <Thomas.Koenig@online.de>
* gfortran.fortran-torture/execute/in-pack.f90: New test.
From-SVN: r100842
2005-06-09 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/21480
* m4/reshape.m4: Use sizeof (rtype_name) for sizes to be passed
to reshape_packed.
* generated/reshape_c4.c: Regenerated.
* generated/reshape_c8.c: Regenerated.
* generated/reshape_i4.c: Regenerated.
* generated/reshape_i8.c: Regenerated.
2005-06-09 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/21480
* gfortran.dg/reshape-complex.f90: Add a test for a packed
complex array.
From-SVN: r100805
2005-06-07 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/21926
* m4/matmul.m4: Correct zeroing of result for non-packed
arrays with lowest stride is one.
* generated/matmul_c4.c: Regenerated.
* generated/matmul_c8.c: Regenerated.
* generated/matmul_i4.c: Regenerated.
* generated/matmul_i8.c: Regenerated.
* generated/matmul_r4.c: Regenerated.
* generated/matmul_r8.c: Regenerated.
2005-06-07 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/21926
* gfortran.fortran-torture/execute/intrinsic_matmul.f90:
Test case where the return array has lowest stride one,
but isn't packed.
From-SVN: r100721
PR libfortran/20006
* io.c (format_item_1): Add check and extension warning for
$ edit descriptor.
* io/format.c (parse_format_list): Set repeat count of $ format
node to 1.
* io/transfer.c (read_sf): Add g.seen_dollar to the test
concerning advancing I/O.
(data_transfer_init): Likewise.
(finalize_transfer): Likewise.
From-SVN: r100314
2005-05-27 Thomas Koenig <Thomas.Koenig@online.de>
* runtime/in_pack_generic.c: Adjust copyright years.
(in_pack_generic): Change dimension of auxiliary arrays from
GFC_MAX_DIMENSION - 1 to GFC_MAX_DIMENSION.
* runtime/in_unpack_generic.c: Adjust copyright years.
(in_unpack_generic): Change dimension of auxiliary arrays from
GFC_MAX_DIMENSION - 1 to GFC_MAX_DIMENSION.
From-SVN: r100271
2005-05-26 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/17283
* gfortran.fortran-torture/execute/intrinsic_unpack.f90:
Test callee-allocated memory with write statements.
2005-05-26 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/17283
* intrinsics/unpack_generic.c: Fix name of routine
on top. Update copyright years.
(unpack1): Remove const from return array descriptor.
rs: New variable, for calculating return sizes.
Populate return array descriptor if ret->data is NULL.
From-SVN: r100189
2005-05-18 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/21127
* Makefile.am: Add generated/reshape_c4.c and
generated/reshape_c8.c.
* Makefile.in: Regenerated.
* m4/iparm.m4: Define rtype_ccode to be c4 or c8 for
complex types, 4 or 8 otherwise.
* m4/reshape.m4: Use rtype_ccode instead of rtype_kind
in function name.
* generated/reshape_c4.c: New file.
* generated/reshape_c8.c: New file.
2005-05-18 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/21127
* fortran/iresolve.c (gfc_resolve_reshape): Add
gfc_type_letter (BT_COMPLEX) for complex to
to resolved function name.
2005-05-18 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/21127
* gfortran.dg/reshape-complex.f90: New test.
From-SVN: r99925
* intrinsics/system_clock.c (system_clock_4, system_clock_8): Add
missing returns, reformat a bit.
* io/write.c (nml_write_obj): Use %d again - and cast to int,
st_sprintf does not handle %ld.
From-SVN: r99722
2005-05-12 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/21324
* runtime/memory.c: Don't define GFC_CLEAR_MEMORY (it's a
performance hog).
* io/open.c (new_unit): Zero freshly allocated memory for
unit structure.
* io/unit.c (init_units): Zero freshly allocated memory for
STDIN, STDOUT and STDERR.
* io/unix.c (open_internal): Zero freshly allocated memory
for unix_stream.
(fd_to_stream): Likewise.
From-SVN: r99619
PR libfortran/21471
* open.c (new_unit): Take care of the case where POSITION_APPEND
is specified (sseek to the end, and set u>-endfile).
* gfortran.dg/append-1.f90: New test.
From-SVN: r99560
gcc/fortran/
PR fortran/20178
* gfortran.h (gfc_option): Add flag_f2c.
* invoke.texi: Document '-ff2c' command line option. Adapt
documentation for '-fno-second-underscore' and '-fno-underscoring'.
* lang.opt (ff2c): New entry.
* options.c (gfc-init_options): Set default calling convention
to -fno-f2c. Mark -fsecond-underscore unset.
(gfc_post_options): Set -fsecond-underscore if not explicitly set
by user.
(handle_options): Set gfc_option.flag_f2c according to requested
calling convention.
* trans-decl.c (gfc_get_extern_function_decl): Use special f2c
intrinsics where necessary.
(gfc_trans_deferred_vars): Change todo error to assertion.
* trans-expr.c (gfc_conv_variable): Dereference access
to hidden result argument.
(gfc_conv_function_call): Add hidden result argument to argument
list if f2c calling conventions requested. Slightly restructure
tests. Convert result of default REAL function to requested type
if f2c calling conventions are used. Dereference COMPLEX result
if f2c cc are used.
* trans-types.c (gfc_sym_type): Return double for default REAL
function if f2c cc are used.
(gfc_return_by_reference): Slightly restructure logic. Return
COMPLEX by reference depending on calling conventions.
(gfc_get_function_type): Correctly make hidden result argument a
pass-by-reference argument for COMPLEX. Remove old code which does
this for derived types.
libgfortran/
PR fortran/20178
* Makefile.am (gfor_specific_src): Add 'intrinsics/f2c_intrinsics.F90'
to dependencies.
* Makefile.in: Regenerate.
* intrinsics/f2c_specific.F90: New file.
gcc/testsuite/
PR fortran/20178
* gfortran.dg/f2c_1.f90, gfortran.dg/f2c_2.f90,
gfortran.dg/f2c_3.f90: New tests.
From-SVN: r99544
PR libfortran/20788
Missing entry from previous commit:
* io/unix.c (fd_to_stream): Add an avoid_mmap argument indicating
we don't we to mmap this stream. Use fd_open instead of mmap_open
in that case.
(open_external): Call fd_to_stream with avoid_mmap = 0.
(input_stream): Call fd_to_stream with avoid_mmap = 1.
(output_stream): Likewise.
(error_stream): Likewise.
Really committing:
* io/read.c (read_f): Accept 'e', 'E', 'd' and 'D' as first
non-blank characters of a real number.
From-SVN: r99508
PR libfortran/19155
* io/read.c (read_f): Accept 'e', 'E', 'd' and 'D' as first
non-blank characters of a real number.
* gfortran.dg/pr19155.f: New test.
From-SVN: r99424
2005-04-30 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/18958
libgfortran.h: Change typedef of index_type from size_t
to ssize_t.
2005-04-30 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/18958
* gfortran.dg/eoshift.f90: New test case.
From-SVN: r99047
* configure.ac: Check for ftruncate and chsize.
* io/unix.c (fd_truncate): Provide chsize as alternative to
ftruncate.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r98989
PR libfortran/20074
PR libfortran/20436
PR libfortran/21108
* gfortran.dg/nested_reshape.f90: new test
* gfortran.dg/reshape-alloc.f90: new test
* gfortran.dg/reshape.f90: new test
2005-04-22 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/20074
PR libfortran/20436
PR libfortran/21108
* m4/reshape.m4 (reshape_`'rtype_kind): rs, rex: New
variables, to be used in calculation of return array sizes.
Populate return array descriptor if ret->data is NULL.
Fix condition for early return (it used to test something
undefined if order was used).
Remove duplicate check wether pad is used.
* intrinsics/reshape_generic.c (reshape_generic): Likewise.
Fix a few places where the wrong variables were set.
* generated/reshape_i4.c: Regenerated.
* generated/reshape_i8.c: Regenerated.
From-SVN: r98585
PR libfortran/20950
* io/inquire.c (inquire_via_unit): Check for the gfc_unit being
NULL when setting ioparm.sequential.
* gfortran.dg/pr20950.f: New test.
From-SVN: r98312
2005-04-15 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/18495
* intrinsics/spread_generic.c (spread): Remove const from
return array descriptor.
New variables: rrank (rank of return array), rs (for
calculating the size of the return array), srank (rank
of the source array).
Generate runtime error if the dim= argument is larger than
the rank of the return array.
Generate runtime error if the needed rank of the return
array is larger than 7.
If ret->data is null, populate the return array descriptor
and initialize the variables for the actual operation.
Otherwise, set ret->dim[0].stride to one if it is zero.
Change second, independent use of variable dim to srank.
2005-04-15 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/18495
* gfortran.fortran-torture/execute/intrinsic_spread.f90:
Test callee-allocated version of return array with a write
statement.
Test spread with a temporary with another write statement.
From-SVN: r98208
PR libfortran/20788
* runtime/environ.c (init_unsigned_integer): Function for
environment variables we want to be positive.
(init_integer): Function to allow negative environment
variables (e.g. for GFORTRAN_STDIN_UNIT).
From-SVN: r97946
2005-04-10 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/17992
PR libfortran/19568
PR libfortran/19595
PR libfortran/20005
PR libfortran/20092
PR libfortran/20131
PR libfortran/20138
PR libfortran/20661
PR libfortran/20744
* io/transfer.c (top level): eor_condition: New static variable.
(read_sf): Remove unnecessary zeroing of buffer (there is enough
information in its length).
Return a string of length 0 (to be padded by caller) if EOR was
seen previously.
Remove erroneous special casing of EOR for standard input.
Set eor_condition for non-advancing I/O if an end of line was
detected.
Increment ioparm.size if necessary.
(formatted_transfer): Skip the function if there is an EOR condition.
(data_transfer_init): Initialize eor_condition to zero (false).
(next_record_r): Clear sf_seen_eor if a \n has been seen already.
(finalize_transfer): If there is an EOR condition, raise the error.
2005-04-10 Thomas Koenig <Thomas.Koenig@online.de>
* eor_handling_1.f90: New test case.
* eor_handling_2.f90: New test case.
* eor_handling_3.f90: New test case.
* eor_handling_4.f90: New test case.
* eor_handling_5.f90: New test case.
* noadv_size.f90: New test case.
* pad_no.f90: New test case.
From-SVN: r97943
PR fortran/19872
* io/transfer.c (data_transfer_init): truncate an existing
file on the first write.
Co-Authored-By: Steven G. Kargl <kargls@comcast.net>
From-SVN: r97937
2005-04-09 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/20163
* runtime/string.c (compare0): Use fstrlen() to
strip trailing blanks from option string.
From-SVN: r97923
PR libfortran/20755
* write.c (write_float): A G edit descriptor may locally change
the scale factor, but it needs to be restored afterwards.
* gfortran.dg/pr20755.f: New test.
From-SVN: r97627
PR libfortran/20068
PR libfortran/20125
PR libfortran/20156
PR libfortran/20471
* io/backspace.c (unformatted_backspace): Fix error in arithmetic.
(st_backspace): When in WRITING mode, we flush and falling back
into READING mode. In all cases, correctly position the stream.
* gfortran.dg/backspace.f: New test.
Co-Authored-By: Francois-Xavier Coudert <coudert@clipper.ens.fr>
From-SVN: r97478
PR libfortran/20660
* io/inquire.c (inquire_via_unit): Non-opened units should still be
reported by an INQUIRE statement as existing.
* io/transfer.c (data_transfer_init): Never accept negative units.
PR libfortran/20660
* gfortran.dg/negative_unit.f: New test.
From-SVN: r97326
PR libfortran/20163
* io/open.c (st_open): call library_end() before returning even if
an error arises.
* gfortran.dg/pr20163-2.f: New test.
From-SVN: r97153
PR libfortran/19678
PR libfortran/19679
* gfortran.dg/dos_eol.f: New test.
PR libfortran/19678
* list_read.c (next_char, eat_separator, finish_separator, read_real)
(namelist_read): Add support for '\r' as well as '\n' as EOL
character.
PR libfortran/19679
* list_read.c (read_sf): Add a '\r' in a test to support DOS
line-endings when line length is exceeded.
From-SVN: r97041
PR libfortran/15332
* io/format.c (parse_format_list): format node for colon edit
descriptor needs a repeat counter set to 1.
* gfortran.dg/pr15332.f: New test.
From-SVN: r97036
* configure.ac: Do not invoke TL_AC_GCC_VERSION.
In all substitutions, leave gcc_version to be expanded by the Makefile.
* aclocal.m4, configure: Regenerate.
* Makefile.am: Set gcc_version.
* Makefile.in: Regenerate.
From-SVN: r96818
* open.c (new_unit): set record length to max_offset rather than
using a hard-coded limit (which was too low).
* write_big_array.f90: New test.
From-SVN: r96573
2005-03-12 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/20124
* gfortran.dg/pr20124.f90: New Test
2005-03-11 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/20124
* write.c (output_float): Adds a nzero_real variable to store
the number of leading zeros whatever the format width is. Corrects
the rounding of numbers less than 10^(-width). Fixes typo in an
error message. Updates copyright years
From-SVN: r96291
2004-02-22 Paul Thomas <paulthomas2@wannado.fr>
Bud Davis <bdavis@gfortran.org>
* io/list_read.c (read_real): Handle separators properly
in list directed read.
2005-02-22 Bud Davis <bdavis@gfortran.org>
* gfortran.dg/list_read_4.f90: new test.
From-SVN: r95436
2004-02-21 Bud Davis <bdavis@gfortran.org>
PR fortran/20086
* io/transfer.c (write_constant_string): accept an 'h' as
the start of a hollerith format string.
2005-02-21 Bud Davis <bdavis9659@comcast.net>
PR fortran/20086
* gfortran.dg/pr20086.f90: New test.
From-SVN: r95379
2005-02-01 Paul Thomas <paulthomas2@wanadoo.fr>
PR libgfortran/19363
PR libgfortran/19691
* libgfortran.h (isfinite): Work around broken isfinite(x) in Cygwin.
From-SVN: r94530