Commit Graph

381 Commits

Author SHA1 Message Date
Francois-Xavier Coudert ad238e4ff7 re PR libfortran/23272 ([mingw32] inquire via filename fails)
PR libfortran/23272
	* acinclude.m4 (LIBGFOR_CHECK_WORKING_STAT): New check.
	* configure.ac: Use LIBGFOR_CHECK_WORKING_STAT.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* io/unix.c (compare_file_filename): Add fallback case for
	systems without working stat.
	* io/open.c (already_open): Correct call to
	compare_file_filename.
	* io/io.h: Correct proto for compare_file_filename.

From-SVN: r105824
2005-10-23 20:43:54 +00:00
Francois-Xavier Coudert 17d6e514a1 fpu.c: Add _GNU_SOURCE definition.
* runtime/fpu.c: Add _GNU_SOURCE definition.
	* config/fpu-glibc.h: Remove __USE_GNU definition.

From-SVN: r105822
2005-10-23 20:06:08 +00:00
Paul Thomas 2853e5127d re PR fortran/18022 (problem with structure and calling a function)
2005-10-23  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/18022
	* trans-expr.c (gfc_trans_arrayfunc_assign): Return NULL
	if there is a component ref during an array ref to force
	use of temporary in assignment.

	PR fortran/24311
	PR fortran/24384
	* fortran/iresolve.c (check_charlen_present): New function to
	add a charlen to the typespec, in the case of constant
	expressions.
	(gfc_resolve_merge, gfc_resolve_spread): Call.the above.
	(gfc_resolve_spread): Make calls to library functions that
	handle the case of the spread intrinsic with a scalar source.
	* libgfortran/intrinsics/spread_generic.c (spread_internal
	_scalar): New function that handles the special case of spread
	with a scalar source. This has interface functions -
	(spread_scalar, spread_char_scalar): New functions to interface
	with the calls specified in gfc_resolve_spread.

2005-10-23  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/18022
	gfortran.dg/assign_func_dtcomp_1.f90: New test.

	PR fortran/24311
	gfortran.dg/merge_char_const.f90: New test.

	PR fortran/24384
	gfortran.dg/spread_scalar_source.f90: New test.

From-SVN: r105810
2005-10-23 06:59:17 +00:00
Francois-Xavier Coudert c7ba5f8dff re PR libfortran/24383 (mingw doesn't have SSIZE_MAX)
PR libfortran/24383
	* io/unix.c: Add fallback definition for SSIZE_MAX.

From-SVN: r105768
2005-10-21 19:40:32 +00:00
Francois-Xavier Coudert 2cdc88b64d re PR libfortran/24432 (Missing symbols)
PR libfortran/24432
	* c99_protos.h: Define preprocessor HAVE_ macros with value 1
	instead of empty value.
	* intrinsics/c99_functions.c: Likewise.
	* intrinsics/getXid.c: Define HAVE_GETPID with value 1 instead of
	empty value.
	* intrinsics/sleep.c: Define HAVE_SLEEP with value 1 instead of
	empty value.

From-SVN: r105603
2005-10-19 09:45:27 +00:00
Francois-Xavier Coudert 821af61997 re PR libfortran/24432 (Missing symbols)
PR libfortran/24432
	* c99_protos.h: Define HAVE_ macros for all provided functions.

From-SVN: r105597
2005-10-19 08:23:42 +00:00
Uros Bizjak 771c0562b5 fpu-387.h (set_fpu): Remove extra ":" in stmxcsr.
* config/fpu-387.h (set_fpu): Remove extra ":" in stmxcsr.
	Change cw and cw_sse variables to unsigned.
	(SSE): New definition.
	(has_sse): Use it.

From-SVN: r105402
2005-10-14 13:06:11 +02:00
Thomas Koenig c1d70e1a52 unix.c (fd_alloc_r_at): Use read() instead of do_read() only in case of special files (e.g.
2005-10-13  Thomas Koenig  <Thomas.Koenig@online.de>

	* io/unix.c(fd_alloc_r_at):  Use read() instead of do_read()
	only in case of special files (e.g. terminals).

From-SVN: r105373
2005-10-13 16:15:30 +00:00
Uros Bizjak 8d1d0da541 * config/fpu-387.h (set_fpu): Add "=m" for stmxcsr.
From-SVN: r105369
2005-10-13 14:54:30 +02:00
François-Xavier Coudert 944b8b35a9 gfortran.h: Add bitmasks for different FPE traps.
* gfortran.h: Add bitmasks for different FPE traps. Add fpe
	member to options_t.
	* invoke.texi: Document the new -ffpe-trap option.
	* lang.opt: Add -ffpe-trap option.
	* options.c (gfc_init_options): Initialize the FPE option.
	(gfc_handle_fpe_trap_option): New function to parse the argument
	of the -ffpe-trap option.
	(gfc_handle_option): Add case for -ffpe-trap.
	* trans-decl.c: Declare a tree for the set_fpe library function.
	(gfc_build_builtin_function_decls): Build this tree.
	(gfc_generate_function_code): Generate a call to set_fpe at
	the beginning of the main program.
	* trans.h: New tree for the set_fpe library function.

	* Makefile.am: Add fpu.c to the build process, and
	target-dependent code as fpu-target.h.
	* Makefile.in: Regenerate.
	* configure.ac: Add call to configure.host to set
	FPU_HOST_HEADER.
	* configure: Regenerate.
	* config.h.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure.host: New script to determine which host-dependent
	code should go in.
	* libgfortran.h: Add fpe option, remove previous fpu_ options.
	Add bitmasks for different FPE traps. Add prototype for set_fpu.
	* runtime/environ.c: Remove environment variables to control
	fpu behaviour.
	* runtime/fpu.c (set_fpe): New function for the front-end.
	* runtime/main.c (init): Set FPU state.
	* config: New directory to store host-dependent code.
	* config/fpu-387.h: New file with code handling the i387 FPU.
	* config/fpu-glibc.h: New file with code for glibc systems.
	* config/fpu-generic.h: Fallback for the most generic host. Issue
	warnings.

From-SVN: r105328
2005-10-12 20:21:31 +00:00
Janne Blomqvist 4def9c5307 unix.c: Remove parts of patch of 2005/10/07 that cause input from the terminal to hang.
2005-10-12  Janne Blomqvist <jblomqvi@cc.hut.fi>

	* io/unix.c: Remove parts of patch of 2005/10/07 that cause
	input from the terminal to hang.

From-SVN: r105324
2005-10-12 19:54:59 +00:00
Steven G. Kargl a2694f689c re PR libfortran/24313 (complex sqrt function does not return principal value)
PR libgfortran/24313
* c99_functions.c (csqrtf, csqrt): Fix choice of branch cut.  Note
  csqrt{f} were imported from glibc, and this bug is still present
  there. glibc PR is 1146.

From-SVN: r105274
2005-10-11 23:35:27 +00:00
Janne Blomqvist 0dc4346159 re PR libfortran/16339 (Unformatted i/o on large arrays inefficient)
2005-10-07  Janne Blomqvist <jblomqvi@cc.hut.fi>

	PR fortran/16339
	PR fortran/23363
	* io/io.h: Add read and write members to stream, define access
	macros.
	* io/transfer.c (read_block_direct): New function.
	(write_block_direct): New function.
	(unformatted_read): Change to use read_block_direct.
	(unformatted_write): Change to use write_block_direct.
	* io/unix.c: Remove mmap includes and defines.
	(writen): Remove.
	(readn): Remove.
	(reset_stream): New function.
	(do_read): New function.
	(do_write): New function.
	(fd_flush): Change to use do_write() instead of writen().
	(fd_alloc_r_at): Change to use do_read().
	(fd_seek): Change return type to try, as the prototype. Add check
	to avoid syscall overhead if possible.
	(fd_read): New function.
	(fd_write): New function.
	(fd_open): Set pointers for new functions.
	(mem_read): New function.
	(mem_write): New function.
	(open_internal): Set pointers for new functions.
	(is_seekable): Clean up comment.

From-SVN: r105101
2005-10-07 20:02:28 +00:00
Jerry DeLisle aed6ee2453 transfer.c (write_block): Add test for end-of-file condition, removed from mem_alloc_w_at.
2005-10-07  Jerry DeLisle  <jvdelisle@verizon.net>

        * io/transfer.c (write_block): Add test for end-of-file condition,
        removed from mem_alloc_w_at. (next_record_w): Clean up checks for
        NULL pointer returns from s_alloc_w.
        * io/unix.c (mem_alloc_w_at): Remove call to generate_error end-of-file.
        * io/write.c (write_float): Add checks for NULL pointer returns from
        write_block calls. (write_integer): Same.

From-SVN: r105092
2005-10-07 17:01:48 +00:00
Jakub Jelinek bb13c3502b * runtime/memory.c (allocate_size): Malloc 1 byte if size == 0.
From-SVN: r104909
2005-10-03 22:32:44 +02:00
François-Xavier Coudert 644cb69f80 re PR libfortran/19308 (I/O library should support more real and integer kinds)
PR libfortran/19308
	PR fortran/20120
	PR libfortran/22437

	* Makefile.am: Add generated files for large real and integers
	kinds. Add a rule to create the kinds.inc c99_protos.inc files.
	Use kinds.inc to preprocess Fortran generated files.
	* libgfortran.h: Add macro definitions for GFC_INTEGER_16_HUGE,
	GFC_REAL_10_HUGE and GFC_REAL_16_HUGE. Add types gfc_array_i16,
	gfc_array_r10, gfc_array_r16, gfc_array_c10, gfc_array_c16,
	gfc_array_l16.
	* mk-kinds-h.sh: Define macros HAVE_GFC_LOGICAL_* and
	HAVE_GFC_COMPLEX_* when these types are available.
	* intrinsics/ishftc.c (ishftc16): New function for GFC_INTEGER_16.
	* m4/all.m4, m4/any.m4, m4/count.m4, m4/cshift1.m4, m4/dotprod.m4,
	m4/dotprodc.m4, m4/dotprodl.m4, m4/eoshift1.m4, m4/eoshift3.m4,
	m4/exponent.m4, m4/fraction.m4, m4/in_pack.m4, m4/in_unpack.m4,
	m4/matmul.m4, m4/matmull.m4, m4/maxloc0.m4, m4/maxloc1.m4,
	m4/maxval.m4, m4/minloc0.m4, m4/minloc1.m4, m4/minval.m4, m4/mtype.m4,
	m4/nearest.m4, m4/pow.m4, m4/product.m4, m4/reshape.m4,
	m4/set_exponent.m4, m4/shape.m4, m4/specific.m4, m4/specific2.m4,
	m4/sum.m4, m4/transpose.m4: Protect generated functions with
	appropriate "#if defined (HAVE_GFC_type_kind)" preprocessor directives.
	* Makefile.in: Regenerate.
	* all files in generated/: Regenerate.

	* f95-lang.c (DO_DEFINE_MATH_BUILTIN): Add support for long
	double builtin function.
	(gfc_init_builtin_functions): Add mfunc_longdouble,
	mfunc_clongdouble and func_clongdouble_longdouble trees. Build
	them for round, trunc, cabs, copysign and pow functions.
	* iresolve.c (gfc_resolve_reshape, gfc_resolve_transpose): Add
	case for kind 10 and 16.
	* trans-decl.c: Add trees for cpowl10, cpowl16, ishftc16,
	exponent10 and exponent16.
	(gfc_build_intrinsic_function_decls): Build nodes for int16,
	real10, real16, complex10 and complex16 types. Build all possible
	combinations for function _gfortran_pow_?n_?n. Build function
	calls cpowl10, cpowl16, ishftc16, exponent10 and exponent16.
	* trans-expr.c (gfc_conv_power_op): Add case for integer(16),
	real(10) and real(16).
	* trans-intrinsic.c: Add suppport for long double builtin
	functions in BUILT_IN_FUNCTION, LIBM_FUNCTION and LIBF_FUNCTION
	macros.
	(gfc_conv_intrinsic_aint): Add case for integer(16), real(10) and
	real(16) kinds.
	(gfc_build_intrinsic_lib_fndecls): Add support for real10_decl
	and real16_decl in library functions.
	(gfc_get_intrinsic_lib_fndecl): Add cases for real and complex
	kinds 10 and 16.
	(gfc_conv_intrinsic_exponent): Add cases for real(10) and real(16)
	kinds.
	(gfc_conv_intrinsic_sign): Likewise.
	(gfc_conv_intrinsic_ishftc): Add case for integer(16) kind.
	* trans-types.c (gfc_get_int_type, gfc_get_real_type,
	gfc_get_complex_type, gfc_get_logical_type): Doesn't error out in
	the case of kinds not available.
	* trans.h: Declare trees for cpowl10, cpowl16, ishftc16,
	exponent10 and exponent16.

	* gfortran.dg/large_real_kind_2.F90: New test.
	* gfortran.dg/large_integer_kind_2.f90: New test.

From-SVN: r104889
2005-10-03 07:22:20 +00:00
Jakub Jelinek 0355186042 memory.c (malloc_t): Remove.
* runtime/memory.c (malloc_t): Remove.
	(GFC_MALLOC_MAGIC, HEADER_SIZE, DATA_POINTER, DATA_HEADER): Remove.
	(mem_root, runtime_cleanup, malloc_with_header): Remove.
	(internal_malloc_size): Use just get_mem if size != 0, return NULL
	otherwise.
	(internal_free): Just free if non-NULL.
	(internal_realloc_size): Remove debugging stuff.
	(allocate_size): Use malloc directly, remove debugging stuff.
	(deallocate): Use free directly, fix error message wording.

From-SVN: r104856
2005-10-01 13:55:02 +02:00
Jakub Jelinek 1449b8cba8 libgfortran.h (GFC_ITOA_BUF_SIZE, [...]): Define.
* libgfortran.h (GFC_ITOA_BUF_SIZE, GFC_XTOA_BUF_SIZE,
	GFC_OTOA_BUF_SIZE, GFC_BTOA_BUF_SIZE): Define.
	(gfc_itoa, xtoa): Add 2 extra arguments.
	* runtime/environ.c: Include stdio.h.
	(check_buffered): Use sprintf.
	* runtime/error.c: Include assert.h.
	(gfc_itoa, xtoa): Add 2 extra arguments, avoid using static
	buffers.
	(st_printf, st_sprintf): Adjust callers.
	* io/write.c (otoa, btoa): Add 2 extra arguments, avoid using
	static buffers.
	(write_int, write_decimal): Add 2 extra arguments to conv
	function pointer, adjust caller.
	(write_integer): Adjust gfc_itoa caller.

	* io/unit.c (get_array_unit_len): Return 0 rather than NULL.

	* io/read.c (read_f): Remove spurious pointer dereference.

From-SVN: r104855
2005-10-01 13:50:10 +02:00
Janne Blomqvist 21905d1b43 re PR libfortran/24112 (Reopening file with STATUS='OLD' doesn't work)
2005-09-30  Janne Blomqvist <jblomqvi@cc.hut.fi>
libgfortran/
PR 24112
* io/open.c (edit_modes): Check for correct flag.
gcc/testsuite/
PR 24112
* gfortran.dg/open_status_1.f90: New.

From-SVN: r104829
2005-09-30 20:47:54 +02:00
Jakub Jelinek 090037799c string.c (find_option): Change 3rd argument to const st_option *.
* runtime/string.c (find_option): Change 3rd argument to
	const st_option *.
	* libgfortran.h (find_option): Likewise.
	* runtime/environ.c (rounding, precision, signal_choices): Constify.
	(init_choice, show_choice): Change 2nd argument to const choice *.
	* io/open.c (access_opt, action_opt, blank_opt, delim_opt, form_opt,
	position_opt, status_opt, pad_opt): Constify.
	* io/transfer.c (advance_opt): Likewise.
	* io/inquire.c (undefined): Likewise.
	* io/close.c (status_opt): Likewise.
	* io/format.c (posint_required, period_required, nonneg_required,
	unexpected_element, unexpected_end, bad_string, bad_hollerith,
	reversion_error): Likewise.
	* io/unix.c (yes, no, unknown): Change from const char *
	into const char [].

From-SVN: r104773
2005-09-29 15:53:59 +02:00
Steve Ellcey 118ea208fa re PR target/23552 (FAIL: gfortran.dg/large_real_kind_1.f90)
PR target/23552
	* acinclude.m4 (LIBGFOR_CHECK_FOR_BROKEN_ISFINITE): New.
	(LIBGFOR_CHECK_FOR_BROKEN_ISNAN): New.
	(LIBGFOR_CHECK_FOR_BROKEN_FPCLASSIFY): New.
	* configure.ac (LIBGFOR_CHECK_FOR_BROKEN_ISFINITE): Add use.
	(LIBGFOR_CHECK_FOR_BROKEN_ISNAN): Add use.
	(LIBGFOR_CHECK_FOR_BROKEN_FPCLASSIFY): Add use.
	* configure: Regenerate.
	* config.h.in: Regenerate.
	* libgfortan.h (isfinite): undef if broken, set if needed.
	(isnan): undef if broken, set if needed.
        (fpclassify): undef if broken, set if needed.
	* io/write.c: Remove TODO comment about working isfinite.
	* intrinsics/c99_functions.c (round): Use isfinite instead
	of fpclassify.
	* intrinsics/c99_functions.c (roundf): Ditto.

From-SVN: r104710
2005-09-27 21:12:52 +00:00
David Edelsohn 63d261c617 Correct ChangeLog formatting and email address.
From-SVN: r104682
2005-09-27 00:02:35 -04:00
Janne Blomqvist 18623faed1 [multiple changes]
2005-09-24  Janne Blomqvist  <jblomqvi@cc.hut.fi>

	* trans-io.c (gfc_build_io_library_fndecls): Add entry
	iocall_x_array for transfer_array. (transfer_array_desc): New
	function. (gfc_trans_transfer): Add code to call
	transfer_array_desc.

2005-09-24  Janne Blomqvist <jblomqvi@cc.hut.fi>

	* io.h: Changed prototypes of list_formatted_{read|write}.
	* list_read.c (list_formatted_read): Renamed to
	list_formatted_read_scalar and made static. (list_formatted_read):
	New function.
	* transfer.c: Prototype for transfer_array. Changed transfer
	function pointer. (unformatted_read): Add nelems argument, use
	it. (unformatted_write): Likewise. (formatted_transfer): Changed
	name to formatted_transfer_scalar. (formatted_transfer): New
	function. (transfer_integer): Add nelems argument to transfer
	call, move updating item count to transfer
	functions. (transfer_real): Likewise. (transfer_logical):
	Likewise. (transfer_character): Likewise. (transfer_complex):
	Likewise. (transfer_array): New function. (data_transfer_init):
	Call formatted_transfer with new argument. (iolength_transfer):
	New argument, use it.
	* write.c (list_formatted_write): Renamed to
	list_formatted_write_scalar, made static. (list_formatted_write):
	New function.

From-SVN: r104662
2005-09-26 20:24:45 +00:00
David Edelsohn e097b4f158 configure.ac: Add check for __clog.
* configure.ac: Add check for __clog.
	* configure: Regenerate.

From-SVN: r104654
2005-09-26 19:08:27 +00:00
Francois-Xavier Coudert 1409cd0b8e c99_protos.h: Add prototypes for C99 complex functions.
* c99_protos.h: Add prototypes for C99 complex functions.
	* libgfortran.h: Include complex.h before c99_protos.h.
	* intrinsics/c99_functions.c: Define HAVE_ macros for the
	fallback functions we provide.
	(cabsf, cabs, cabsl, cargf, carg, cargl, cexpf, cexp, cexpl,
	clogf, clog, clogl, clog10f, clog10, clog10l, cpowf, cpow, cpowl,
	cqsrtf, csqrt, csqrtl, csinhf, csinh, csinhl, ccoshf, ccosh,
	ccoshl, ctanhf, ctanh, ctanhl, csinf, csin, csinl, ccosf, ccos,
	ccosl, ctanf, ctan, ctanl): New fallback functions.
	* Makefile.am (gfor_math_trig_c, gfor_math_trig_obj,
	gfor_specific_c, gfor_cmath_src, gfor_cmath_obj): Remove.
	* Makefile.in: Regenerate.
	* configure.ac: Remove checks for csin. Add checks for all C99
	complex functions.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* aclocal.m4: Regenerate.

From-SVN: r104626
2005-09-25 21:39:58 +00:00
Francois-Xavier Coudert 86ab632081 re PR libfortran/23803 ([mingw32] getlog malfunction)
PR libfortran/23803
	* intrinsics/getXid.c: Add getpid wrapper for MinGW.
	* intrinsics/getlog.c: Add getlogin wrapper for MinGW.
	* intrinsics/hostnm.c: Add gethostname wrapper for MinGW.

Co-Authored-By: Danny Smith <dannysmith@users.sourceforge.net>

From-SVN: r104624
2005-09-25 21:02:17 +00:00
Francois-Xavier Coudert 26b7ebf6bf re PR libfortran/23802 ([mingw32] sleep malfunction)
PR libfortran/23802
	* intrinsics/sleep.c: Add correct sleep macro for MinGW.

From-SVN: r104599
2005-09-24 08:55:37 +00:00
Francois-Xavier Coudert 399a39c720 re PR libfortran/23380 ([mingw32] cpu_time intrinsic malfunction)
PR libfortran/23380
	* intrinsics/cpu_time.c (__cpu_time_1): Provide a MS Windows
	version.

From-SVN: r104598
2005-09-24 08:39:35 +00:00
Jerry DeLisle 59154ed24c PR fortran/21875 Internal Unit Array I/O, NIST
2005-09-14  Jerry DeLisle  <jvdelisle@verizon.net

	PR fortran/21875 Internal Unit Array I/O, NIST
	* libgfortran.h: Add run time error code for array stride.
	* runtime/error.c (translate_error): Add error message for
	array stride.
	* io/io.h: Add array descriptor pointer to IOPARM structure.
	Add prtotypes for two new functions.
	* io/transfer.c (data_transfer_init): Removed initialization and
	moved to unit.c (get_unit)
	* io/transfer.c (next_record_r): Include internal unit read
	functionality.
	* io/transfer.c (next_record_w): Include internal unit write
	functionality, including padding of character array records.
	* io/unit.c (get_array_unit_len): New function to return the number
	of records in the character array 'file' from the array descriptor.
	* io/unit.c (get_unit): Gathered initialization code from
	init_data_transfer for internal units and added initialization of
	character array unit.
	* io/unit.c (is_array_io): New function to determine if internal unit
	is an array.
	* io/unix.c (mem_alloc_w_at): Add error checks for bad record length
	and end of file.

From-SVN: r104276
2005-09-14 20:18:19 +00:00
Richard Sandiford 7823229bc3 re PR fortran/19269 (transpose(reshape(...)) of character array segfaults.)
gcc/fortran/
	PR target/19269
	* iresolve.c (gfc_resolve_cshift, gfc_resolve_eoshift)
	(gfc_resolve_pack, gfc_resolve_reshape, gfc_resolve_spread)
	(gfc_resolve_transpose, gfc_resolve_unpack): Add "_char" to the name
	for character-based operations.
	(gfc_resolve_pack): Remove ATTRIBUTE_UNUSED from array argument.
	(gfc_resolve_unpack): Copy the whole typespec from the vector.
	* trans-array.c (gfc_conv_expr_descriptor): In the EXPR_FUNCTION
	case, get the string length from the scalarization state.

libgfortran/
	PR target/19269
	* intrinsics/cshift0.c (cshift0): Add an extra size argument.
	(cshift0_1, cshift0_2, cshift0_4, cshift0_8): Replace explicit
	implementations with...
	(DEFINE_CSHIFT): ...this new macro.  Define character versions too.
	* intrinsics/eoshift0.c (zeros): Delete.
	(eoshift0): Add extra size and filler arguments.  Use memset if no
	bound is provided.
	(eoshift0_1, eoshift0_2, eoshift0_4, eoshift0_8): Replace explicit
	implementations with...
	(DEFINE_EOSHIFT): ...this new macro.  Define character versions too.
	* intrinsics/eoshift2.c (zeros): Delete.
	(eoshift2): Add extra size and filler arguments.  Use memset if no
	bound is provided.
	(eoshift2_1, eoshift2_2, eoshift2_4, eoshift2_8): Replace explicit
	implementations with...
	(DEFINE_EOSHIFT): ...this new macro.  Define character versions too.
	* intrinsics/pack.c (pack_internal): New static function, reusing
	the contents of pack and adding an extra size argument.  Change
	"mptr" rather than "m" when calculating the array size.
	(pack): Redefine as a forwarder to pack_internal.
	(pack_s_internal): New static function, reusing the contents of
	pack_s and adding an extra size argument.
	(pack_s): Redefine as a forwarder to pack_s_internal.
	(pack_char, pack_s_char): New functions.
	* intrinsics/reshape.c (reshape_internal): New static function,
	reusing the contents of reshape and adding an extra size argument.
	(reshape): Redefine as a forwarder to reshape_internal.
	(reshape_char): New function.
	* intrinsics/spread.c (spread_internal): New static function,
	reusing the contents of spread and adding an extra size argument.
	(spread): Redefine as a forwarder to spread_internal.
	(spread_char): New function.
	* intrinsics/transpose.c (transpose_internal): New static function,
	reusing the contents of transpose and adding an extra size argument.
	(transpose): Redefine as a forwarder to transpose_internal.
	(transpose_char): New function.
	* intrinsics/unpack.c (unpack_internal): New static function, reusing
	the contents of unpack1 and adding extra size and fsize arguments.
	(unpack1): Redefine as a forwarder to unpack_internal.
	(unpack0): Call unpack_internal instead of unpack1.
	(unpack1_char, unpack0_char): New functions.
	* m4/cshift1.m4 (cshift1): New static function, reusing the contents
	of cshift1_<kind> and adding an extra size argument.
	(cshift1_<kind>): Redefine as a forwarder to cshift1.
	(cshift1_<kind>_char): New function.
	* m4/eoshift1.m4 (zeros): Delete.
	(eoshift1): New static function, reusing the contents of
	eoshift1_<kind> and adding extra size and filler arguments.
	Fix calculation of hstride.  Use memset if no bound is provided.
	(eoshift1_<kind>): Redefine as a forwarder to eoshift1.
	(eoshift1_<kind>_char): New function.
	* m4/eoshift3.m4 (zeros): Delete.
	(eoshift3): New static function, reusing the contents of
	eoshift3_<kind> and adding extra size and filler arguments.
	Use memset if no bound is provided.
	(eoshift3_<kind>): Redefine as a forwarder to eoshift3.
	(eoshift3_<kind>_char): New function.
	* generated/cshift1_4.c, generated/cshift1_8.c,
	* generated/eoshift1_4.c, generated/eoshift1_8.c,
	* generated/eoshift3_4.c, generated/eoshift3_8.c: Regenerate.

From-SVN: r104217
2005-09-13 07:15:01 +00:00
Francois-Xavier Coudert b65b81f935 re PR libfortran/20179 (cannot mix C and Fortran I/O)
PR libfortran/20179
	* io/unix.c (is_preconnected): Add function to test if a stream
	corresponds to a preconnected unit.
	* io/io.h: Add prototype for is_preconnected.
	* io/transfer.c (data_transfer_init): Do not truncate
	preconnected units.

From-SVN: r104141
2005-09-11 13:34:57 +00:00
Janne Blomqvist ca0d06ac97 unix.c: Remove mmap code.
2005-09-10  Janne Blomqvist  <jblomqvi@cc.hut.fi>

	* io/unix.c: Remove mmap code.

From-SVN: r104127
2005-09-10 18:31:28 +02:00
Francois-Xavier Coudert e0fd73d434 re PR libfortran/23784 (close doesn't reset ioparm on error exit)
PR libfortran/23784
	* io/close.c (st_close): Call library_end even in case of error.

From-SVN: r104108
2005-09-09 21:51:33 +00:00
Thomas Koenig 7aba8abebf gfortran.h: Add iomsg to gfc_open, gfc_close, gfc_filepos, gfc_inquire and gfc_dt.
2005-09-09  Thomas Koenig  <Thomas.Koenig@online.de>

	* gfortran.h:  Add iomsg to gfc_open, gfc_close, gfc_filepos,
	gfc_inquire and gfc_dt.
	* dump-parse-tree.c (gfc_show_code_node):  Add iomsg
	for open, close, file positioning, inquire and namelist.
	* io.c (io_tag):  Add tag_iomsg.
	(resolve_tag): Add standards warning for iomsg.
	(match_open_element):  Add iomsg.
	(gfc_free_open):  Add iomsg.
	(gfc_resolve_open):  Add iomsg.
	(gfc_free_close):  Add iomsg.
	(match_close_element):  Add iomsg.
	(gfc_resolve_close):  Add iomsg.
	(gfc_free_filepos):  Add iomsg.
	(match_file_element):  Add iomsg.
	(gfc_resolve_filepos):  Add iostat and iomsg.
	(match-dt_element):  Add iomsg.
	(gfc_free_dt):  Add iomsg.
	(gfc_resolve_dt):  Add iomsg.
	(gfc_free_inquire):  Add iomsg.
	(match_inquire_element):  Add iomsg.
	(gfc_resolve_inquire):  Add iomsg.
	* trans_io.c:  Add ioparm_iomsg and ioparm_iomsg_len.
	(gfc_build_io_library_fndecls):  Add iomsg as last field.
	(gfc_trans_open):  Add iomsg.
	(gfc_trans_close):  Add iomsg.
	(build_fileos):  Call set_string for iomsg.
	(gfc_trans_inquire):  Add iomsg.
	(build_dt):  Add iomsg.

2005-09-09  Thomas Koenig  <Thomas.Koenig@online.de>

	* io/io.h:  Add iomsg as last field of st_parameter.
	* runtime/error.c (generate_error):  If iomsg is present, copy
	the message there.

2005-09-09  Thomas Koenig  <Thomas.Koenig@online.de>

	* gfortran.dg/iomsg_1.f90:  New test case.

From-SVN: r104102
2005-09-09 18:21:45 +00:00
Richard Sandiford ec25720ba3 re PR fortran/12840 ([4.0 only] Unable to find scalarization loop specifier)
PR fortran/12840
	* trans.h (gfor_fndecl_internal_realloc): Declare.
	(gfor_fndecl_internal_realloc64): Declare.
	* trans-decl.c (gfor_fndecl_internal_realloc): New variable.
	(gfor_fndecl_internal_realloc64): New variable.
	(gfc_build_builtin_function_decls): Initialize them.
	* trans-array.h (gfc_trans_allocate_temp_array): Add a fourth argument.
	* trans-array.c (gfc_trans_allocate_array_storage): Add an argument
	to say whether the array can grow later.  Don't allocate the array
	on the stack if so.  Don't call malloc for zero-sized arrays.
	(gfc_trans_allocate_temp_array): Add a similar argument here.
	Pass it along to gfc_trans_allocate_array_storage.
	(gfc_get_iteration_count, gfc_grow_array): New functions.
	(gfc_iterator_has_dynamic_bounds): New function.
	(gfc_get_array_constructor_element_size): New function.
	(gfc_get_array_constructor_size): New function.
	(gfc_trans_array_ctor_element): Replace pointer argument with
	a descriptor tree.
	(gfc_trans_array_constructor_subarray): Likewise.  Take an extra
	argument to say whether the variable-sized part of the constructor
	must be allocated using realloc.  Grow the array when this
	argument is true.
	(gfc_trans_array_constructor_value): Likewise.
	(gfc_get_array_cons_size): Delete.
	(gfc_trans_array_constructor): If the loop bound has not been set,
	split the allocation into a static part and a dynamic part.  Set
	loop->to to the bounds for static part before allocating the
	temporary.  Adjust call to gfc_trans_array_constructor_value.
	(gfc_conv_loop_setup): Allow any constructor to determine the
	loop bounds.  Check whether the constructor has a dynamic size
	and prefer to use something else if so.  Expect the loop bound
	to be set later.  Adjust call to gfc_trans_allocate_temp_array.
	* trans-expr.c (gfc_conv_function_call): Adjust another call here.

From-SVN: r104073
2005-09-09 06:00:40 +00:00
Francois-Xavier Coudert 3c12752024 re PR libfortran/23262 ([mingw32] rewind truncates file)
PR libfortran/23262
	* acinclude.m4 (LIBGFOR_CHECK_CRLF): New check.
	* configure.ac: Use new check.
	* configure.in: Regenerate.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* io/transfer.c (next_record_w): Add case for CRLF as line
	terminator.
	* io/unix.c (tempfile, regular_file): Open files with
	O_BINARY on systems with CRLF.

From-SVN: r104009
2005-09-07 21:25:40 +00:00
Steve Ellcey 98cd8256af re PR libfortran/23419 (unformatted complex I/O with kind=10)
PR libfortran/23419
	* io/write.c (extract_int): Use memcpy to access buffer.
	(extract_uint): Ditto.
	(extract_real): Ditto.

From-SVN: r104000
2005-09-07 20:16:47 +00:00
Thomas Koenig a9390eaf27 list_read.c: Adjust size of of value to 32 (to hold kind=16 complex values).
2005-09-05  Thomas Koenig  <Thomas.Koenig@online.de>

	* io/list_read.c:  Adjust size of of value to 32 (to hold
	kind=16 complex values).

From-SVN: r103918
2005-09-05 21:13:39 +00:00
Thomas Koenig 0ef6349514 re PR libfortran/23321 (Direct unformatted read beyond EOF cores)
2005-09-04  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/23321
	* io/transfer.c(data_transfer_init):  Check for a too-large
	record number.  Return if sseek failed.

2005-09-04  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/23321
	* gfortran.dg/direct_io_4.f90:  New test case.

From-SVN: r103835
2005-09-04 20:36:52 +00:00
Jakub Jelinek 36dd4221c5 read.c (read_x): Take int argument instead of fnode * and digging the N from F->u.n.
* io/read.c (read_x): Take int argument instead of fnode * and
	digging the N from F->u.n.
	* io/io.h (read_x): Adjust prototype.
	* io/transfer.c (formatted_transfer): Adjust callers.  Don't clobber
	f->u.n for FMT_T.

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

From-SVN: r103811
2005-09-03 20:54:55 +02:00
Francois-Xavier Coudert 8845001b6c unix.c (stream_ttyname): Protect use of ttyname by HAVE_TTYNAME macro.
* io/unix.c (stream_ttyname): Protect use of ttyname by
	HAVE_TTYNAME macro.
	* configure.ac: Add check for ttyname.
	* config.h.in: Regenerate.
	* configure: Regenerate.

From-SVN: r103794
2005-09-02 20:24:49 +00:00
Andreas Jaeger e55a7487ca libgfortran.h: Add prototype for init_compile_options.
* libgfortran.h: Add prototype for init_compile_options.

	* io/io.h: Add prototype for notify_std.

From-SVN: r103778
2005-09-02 15:29:53 +02:00
Steve Ellcey af452a2bf9 * io/read.c (set_integer): Use memcpy to fill buffer.
From-SVN: r103687
2005-08-31 17:05:52 +00:00
Steve Ellcey 2efa12b340 re PR target/23556 (FAIL: gfortran.dg/pr18122.f90)
PR target/23556
	* io/read.c (convert_real): Use memcpy to fill buffer.

From-SVN: r103685
2005-08-31 16:58:28 +00:00
Thomas Koenig 827afb8629 [multiple changes]
2005-08-29  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/23598
	* io/lock.c(library_start):  If ioparm.iostat is present, clear
	it unconditionally.

2005-02-29  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/23598
	* gfortran.dg/iostat_1.f90:  New test.

From-SVN: r103613
2005-08-29 20:40:02 +00:00
Francois-Xavier Coudert 10c682a0cb acinclude.m4 (LIBGFOR_CHECK_UNLINK_OPEN_FILE): Add check to see if target can unlink open files.
* acinclude.m4 (LIBGFOR_CHECK_UNLINK_OPEN_FILE): Add check to see
	if target can unlink open files.
	* configure.ac: Use this new test.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* aclocal.ac: Regenerate.
	* io/io.h: Add prototype for unpack_filename.
	* io/close.c (st_close): Delete file after closing unit if
	HAVE_UNLINK_OPEN_FILE is not defined.
	* io/unix.c (unpack_filename): Unlink scratch file after opening
	it only if HAVE_UNLINK_OPEN_FILE is defined.

From-SVN: r103566
2005-08-27 16:01:54 +00:00
Kelley Cook fe2ae685a1 All files: Update FSF address.
2005-08-17  Kelley Cook  <kcook@gcc.gnu.org>

	* All files: Update FSF address.

From-SVN: r103194
2005-08-17 02:49:08 +00:00
Thomas Koenig 950ad21d34 re PR libfortran/23428 (inquire(iolength= ) for complex give incorrect value)
2005-08-16  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/23428
	* io/transfer.c (iolength_transfer):  Remove __attribute__ ((unused))
	from type.  Return correct length for inquire(iolength=)
	for complex variables.

2005-08-16  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/23428
	* gfortran.dg/inquire-complex.f90:  New test case.

From-SVN: r103168
2005-08-16 20:26:04 +00:00
Andreas Jaeger 5074edf00b Fix date of last entry, remove extra whitespace
From-SVN: r103019
2005-08-12 08:00:46 +02:00
Francois-Xavier Coudert 8b67b708f1 re PR libfortran/20006 ($ format extension doesn't work)
PR libfortran/20006
	* gfortran.h: Add is_main_program member to symbol_attribute.
	* trans-decl: Add a gfor_fndecl_set_std tree.
	(gfc_build_builtin_function_decls): Create it.
	(gfc_generate_function_code): Add this call at the beginning of
	the main program.
	* trans.c (gfc_generate_code): Move main_program and attr.
	* trans.h: Add declaration for gfor_fndecl_set_std.

	* Makefile.am: Add file runtime/compile_options.c.
	* Makefile.in: Regenerate.
	* libgfortran.h: Create structure compile_options_t. Define the
	compile_options variable and GFC_STD_ macros.
	* runtime/compile_options.c: New file.
	* runtime/error.c (notify_std): New function.
	* runtime/main.c (init): Call init_compile_options during
	initialization.
	* io/format.c: Use the new notify_std function for the $
	descriptor extension.

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

Co-Authored-By: Steven Bosscher <stevenb@suse.de>

From-SVN: r102990
2005-08-11 13:50:13 +00:00
François-Xavier Coudert ae8b87895f check.c (gfc_check_ttynam_sub, [...]): Add check functions for new intrinsics TTYNAM and ISATTY.
* check.c (gfc_check_ttynam_sub, gfc_check_isatty): Add check
	functions for new intrinsics TTYNAM and ISATTY.
	* intrinsic.c (add_functions, add_subroutines): Add new
	intrinsics.
	* intrinsic.h: Add prototypes for new check and resolve
	functions.
	* iresolve.c (gfc_resolve_isatty, gfc_resolve_ttynam_sub): New
	resolve functions for intrinsics TTYNAM and ISATTY.
	* gfortran.h (gfc_generic_isym_id): Add symbol for ISATTY.
	* trans-intrinsic.c: Add case for GFC_ISYM_ISATTY.
	* Makefile.am: Add file intrinsics/tty.c to Makefile process.
	* Makefile.in: Regenerate.
	* io/io.h: Prototypes for new functions stream_isatty and
	stream_ttyname.
	* io/unix (stream_isatty, stream_ttyname): New functions to call
	isatty() and ttyname() on a given unit.
	* intrinsics/tty.c: New file to implement g77 intrinsics TTYNAM
	and ISATTY.

From-SVN: r102915
2005-08-09 17:33:17 +00:00
Jerry DeLisle 3d092c45bf re PR libfortran/23154 (Currupt string and segfault in formatted read.)
2005-08-08  Jerry DeLisle  <jvdelisle@verizon.net>

        PR libfortran/23154
        * io/transfer.c (data_transfer_init): Initialize
        current_unit->bytes_left for a read.

From-SVN: r102893
2005-08-09 01:56:04 +00:00
Janne Blomqvist 6403ec5ff6 [multiple changes]
2005-08-07   Janne Blomqvist <jblomqvi@cc.hut.fi>

        PR fortran/22390
        * dump-parse-tree.c (gfc_show_code_node): Add case for FLUSH.
        * gfortran.h: Add enums for FLUSH.
        * io.c (gfc_free_filepos,match_file_element,match_filepos): Modify
        comment appropriately.  (gfc_match_flush): New function.
        * match.c (gfc_match_if): Add match for flush.
        * match.h: Add prototype.
        * parse.c (decode_statement): Add flush to 'f' case.
        (next_statement): Add case for flush. (gfc_ascii_statement): Likewise.
        * resolve.c (resolve_code): Add flush case.
        * st.c (gfc_free_statement): Add flush case.
        * trans-io.c: Add prototype for flush.
        (gfc_build_io_library_fndecls): Build fndecl for flush.
        (gfc_trans_flush): New function.
        * trans-stmt.h: Add prototype.
        * trans.c (gfc_trans_code): Add case for flush.

2005-08-07  Janne Blomqvist  <jblomqvi@cc.hut.fi>

        PR fortran/22390
        * io/backspace.c: File removed, contents moved to ...
        * io/endfile.c: Ditto.
        * io/rewind.c: Ditto.
        * io/file_pos.c: New file, ... here.
        * Makefile.am: Add file_pos.c to list, remove obsolete files.
        * Makefile.in: Regenerated.

2005-08-07  Janne Blomqvist <jblomqvi@cc.hut.fi>
            Steven G. Kargl <kargls@comcast.net>

        PR fortran/22390
        * gfortran.dg/flush_1.f90: New test.

Co-Authored-By: Steven G. Kargl <kargls@comcast.net>

From-SVN: r102835
2005-08-07 22:56:19 +00:00
Francois-Xavier Coudert e087fdd81c io.h: Change DEFAULT_TEMPDIR to /tmp instead of /var/tmp.
* io/io.h: Change DEFAULT_TEMPDIR to /tmp instead of /var/tmp.
	* io/unix.c (tempfile): Look at the TEMP environment variable
	to find the temporary files directory. Whitespace correction.

From-SVN: r102822
2005-08-06 22:57:46 +00:00
Francois-Xavier Coudert 2c4a108eec * io/unix.c: Add O_RDWR to open() call.
From-SVN: r102811
2005-08-06 15:38:49 +00:00
Paul Thomas 9427924ef8 transfer.c (data_transfer_init): Truncate file in sequential WRITE when last_record == 0, rather than current_record.
2005-08-04 Paul Thomas  <pault@gcc.gnu.org>

	* transfer.c (data_transfer_init): Truncate file in
	sequential WRITE when last_record == 0, rather than
	current_record.  Cures problem on RH9.

From-SVN: r102746
2005-08-04 20:26:29 +00:00
Francois-Xavier Coudert 06b23b9287 libgfortran.h: When isfinite is not provided by the system...
* libgfortran.h: When isfinite is not provided by the system,
	define it as a macro, so that it can accept any floating point
	type.

From-SVN: r102707
2005-08-03 20:00:00 +00:00
François-Xavier Coudert 5e9d09007d re PR libfortran/23178 (Undefined symbol: __gfortran_flush_i8)
PR libfortran/23178
	* intrinsics/flush.c (flush_i8): Add function flush_i8. Update
	copyright years.

From-SVN: r102641
2005-08-01 21:13:39 +00:00
Francois-Xavier Coudert d4d145acd4 re PR libfortran/21787 (flush I/O before calling abort())
PR libfortran/21787
	* intrinsics/abort.c (abort): Close units before aborting.
	Updated copyright years.

From-SVN: r102600
2005-07-31 07:30:34 +00:00
Francois-Xavier Coudert 6d56728a75 re PR libfortran/22436 (print *,tiny(1._10) yields asterisks)
PR libfortran/22436
	* io/write.c (write_real): Add default formats for real(10) and
	real(16).

From-SVN: r102590
2005-07-30 20:45:02 +00:00
Paul Thomas b6f571b7d3 PR fortran/22570 and related issues.
2005-07-30 Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/22570 and related issues.
	* transfer.c (formatted_transfer): Make sure that there
	really is data present before X- or T- editing. Move all
	treatment of tabbing during writes to start of next data
	producing format. Suppress incorrect zeroing of bytes_left
	in slash formating. Insert int cast for assignment of a
	difference of two gfc_offsets.

	PR fortran/22570 an related issues.
	* gfortran.dg/x_slash_1.f: New test.

From-SVN: r102583
2005-07-30 05:33:39 +00:00
Steven Bosscher 75554d5149 whitespace fixes for my scripts
From-SVN: r102333
2005-07-24 10:37:48 +00:00
Jerry DeLisle 35fd722b61 write.c (write_float): Revise output of IEEE exceptional values to comply with F95 and F2003 standards.
2005-07-23  Jerry DeLisle  <jvdelisle@verizon.net>

    * io/write.c (write_float): Revise output of IEEE exceptional
    values to comply with F95 and F2003 standards.

From-SVN: r102324
2005-07-24 02:24:15 +00:00
Jerry DeLisle d1cc97e081 re PR libfortran/22570 (Null Characters instead of blanks in text output.)
2005-07-22 Jerry DeLisle <jvdelisle@verizon.net>

	PR libfortran/22570
	* io/unit.c (init_units): Replace BLANK_ZERO with
	BLANK_UNSPECIFIED.

From-SVN: r102288
2005-07-22 17:43:31 +00:00
Paul Thomas 94e2b58a28 [multiple changes]
2005-07-22 Jerry DeLisle <jvdelisle@verizon.net>

	PR libfortran/21875  (FM111.f)
	* io/read.c (next_char): Return a ' ' character when BLANK_ZERO
	or BLANK_NULL are active.
	(read_decimal): Interpret ' ' character correctly for BZ or BN.
	(read_radix): Interpret ' ' character correctly for BZ or BN.
	(read_f): Interpret ' ' character correctly for BZ or BN.

2005-07-22 Paul Thomas  <pault@gcc.gnu.org>

	PR libfortran/22570
	* read.c (read_x): Correct the condition for doing the
	x-editing during formatted input.
	* transfer.c (formatted_transfer): Cast offset difference
	as int, clean-up arithmetic with new variable, bytes_used,
	zero counters for FMT_SLASH,
	(data_transfer_init) Zero X- and T-editing counters
	unconditionally.
	(next_record_w) Zero X- and T-editing counters.
	unconditionally.

From-SVN: r102284
2005-07-22 14:07:19 +00:00
Jerry DeLisle b60f1196cf ChangeLog: Fix date on last commit.
2005-07-17  Jerry DeLisle  <jvdelisle@verizon.net>

    * libfortran/ChangeLog: Fix date on last commit.

From-SVN: r102116
2005-07-17 20:53:18 +00:00
Jerry DeLisle 2c01a7204f write.c (write_float): Fix field width checks for printing 'Infinity' or 'Inf'.
2005-07-14  Jerry DeLisle  <jvdelisle@verizon.net>

    * io/write.c (write_float): Fix field width checks for
    printing 'Infinity' or 'Inf'.
    (output_float): Fix typo in comment.

From-SVN: r102115
2005-07-17 20:28:14 +00:00
Paul Thomas be0cc7e21c [multiple changes]
2005-07-12 Paul Thomas  <pault@gcc.gnu.org>

	PR libfortran/16435
	* transfer.c (formatted_transfer): Correct the problems
	with X- and T-editting that caused TLs followed by TRs
	to overwrite data, which caused NIST FM908.FOR to fail
	on many tests.
	(data_transfer_init): Zero X- and T-editting counters at
	the start of formatted IO.
	* write.c (write_x): Write specified number of skips with
	specified number of spaces at the end.

2005-07-12  Paul Thomas  <pault@gcc.gnu.org>

	PR libfortran/16435
	* gfortran.dg/tl_editting.f90: New.
	* gfortran.dg/g77/f77-edit-x-out.f: Remove XFAIL.

From-SVN: r102008
2005-07-14 06:21:59 +00:00
Paul Thomas b125b4cf0f [multiple changes]
2005-07-13 Paul Thomas  <pault@gcc.gnu.org>

	* io/read.c (read_complex): Prevent X formatting during reads
	from going beyond EOR to fix NIST fm908.FOR failure.
	* io/list_read.c (read_complex): Allow complex data in list-
	directed reads to have eols either side of the comma to
	fix NIST FM906.FOR failure.

2005-07-13  Paul Thomas  <pault@gcc.gnu.org>

	* gfortran.dg/past_eor.f90: New.
	* gfortran.dg/complex_read.f90: New.

From-SVN: r101984
2005-07-13 18:43:14 +00:00
Thomas Koenig 0d579784b4 re PR libfortran/21593 ([4.0 only] FAIL: gfortran.dg/dev_null.f90)
2005-07-12  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/21593
	gfortran.dg/dev_null.f90:  Remove outdated comment about
	PR libfortran/21593.
	libgfortran/ChangeLog:  Add PR to entry.

From-SVN: r101940
2005-07-12 20:39:11 +00:00
Thomas Koenig 5133e4b923 io/unix.c: Add member special_file to type unix_stream.
2005-07-12  Thomas Koenig  <Thomas.Koenig@online.de>

	io/unix.c:  Add member special_file to type unix_stream.
	(fd_truncate):  Don't call ftruncate or chsize if
	s refers to a special file.
	(fd_to_stream):  initialize s->special_file.

2005-07-12  Thomas Koenig  <Thomas.Koenig@online.de>

	gfortran.dg/dev_null.f90:  Remove targets.

From-SVN: r101937
2005-07-12 19:52:19 +00:00
David Edelsohn 4e402b2ce3 re PR libfortran/22412 ([4.0 only] Fortran B edit descriptor error)
PR libgfortran/22412
        * io/write.c (otoa): Bias p by SCRATCH_SIZE, not
        sizeof (SCRATCH_SIZE).
        (btoa): Same.

From-SVN: r101908
2005-07-11 23:27:40 -04:00
Jerry DeLisle 9fa276de85 PR libfortran/21875 (FM111.f)
2005-07-09  Jerry DeLisle  <jvdelisle@verizon.net>

    PR libfortran/21875  (FM111.f)
    * io/read.c (next_char): Return a ' ' character when BLANK_ZERO or
    BLANK_NULL are active.
    (read_decimal): Interpret ' ' character correctly for BZ or BN.
    (read_radix): Interpret ' ' character correctly for BZ or BN.
    (read_f): Interpret ' ' character correctly for BZ or BN.
    * gfortran.dg/test (fmt_read_bz_bn.f90): New test case.

From-SVN: r101837
2005-07-09 23:40:31 +00:00
Thomas Koenig 999a06a0da [multiple changes]
2005-07-07  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
	    Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/22217
	* io/write.c (extract_unit):  New function; extract
	ints as unsigned signed int of the correct size.
	* io/write.c (write_int):  Use it.
	* runtime/error.c:  Adjust copyright years.
	Adjust size of buffer to maximum that can occur.

2005-07-07  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/22217
	* gfortran.dg/negative-z-descriptor.f90:  New test.

From-SVN: r101829
2005-07-09 09:33:31 +00:00
Tobias Schlüter efd4dc1a15 libgfortran.h (GFC_ARRAY_DESCRIPTOR): Replace 'type *base' by 'size_t offset'.
* libgfortran.h (GFC_ARRAY_DESCRIPTOR): Replace 'type *base' by
	'size_t offset'.
	* intrinsics/cshift0.c, intrinsics/eoshift0.c,
	intrinsics/eoshift2.c,intrinsics/pack_generic.c,
	intrinsics/reshape_generic.c, intrinsics/spread_generic.c,
	intrinsics/transpose_generic.c, intrinsics/unpack_generic,
	m4/cshift1.m4, m4/eoshift1.m4, m4/eoshift3.m4, m4/iforeach.m4,
	m4/ifunction.m4, m4/matmul.m4, m4/matmull.m4, m4/reshape.m4,
	m4,transpose.m4: Set renamed field 'offset' to zero instead of
	'base'.
	* generated/all_l4.c, generated/all_l8.c,
	generated/any_l4.c, generated/any_l8.c, generated/count_4_l4.c,
	generated/count_4_l8.c, generated/count_8_l4.c,
	generated/count_8_l8.c, generated/chift1_4.c,
	generated/cshift1_8.c, generated/eoshift1_4.c,
	generated/eoshift1_8.c, generated/eoshift3_4.c,
	generated/eoshift3_8.c, generated/matmul_c4.c,
	generated/matmul_c8.c, generated/matmul_i4.c, matmul_i8.c,
	generated/matmul_l4.c, generated/matmul_l8.c,
	generated/matmul_r4.c, generated/matmul_r8.c,
	generated/maxloc0_4_i4.c, generated/maxloc0_4_i8.c,
	generated/maxloc0_4_r4.c, generated/maxloc0_4_r8.c,
	generated/maxloc0_8_i4.c, generated/maxloc0_8_i8.c,
	generated/maxloc0_8_r4.c, generated/maxloc0_8_r8.c,
	generated/maxloc1_4_i4.c, generated/maxloc1_4_i8.c,
	generated/maxloc1_4_r4.c, generated/maxloc1_4_r8.c,
	generated/maxloc1_8_i4.c, generated/maxloc1_8_i8.c,
	generated/maxloc1_8_r4.c, generated/maxloc1_8_r8.c,
	generated/maxval_i4.c, generated/maxval_i8.c,
	generated/maxval_r4.c, generated/maxval_r8.c,
	generated/minloc0_4_i4.c, generated/minloc0_4_i8.c,
	generated/minloc0_4_r4.c, generated/minloc0_4_r8.c,
	generated/minloc0_8_i4.c, generated/minloc0_8_i8.c,
	generated/minloc0_8_r4.c, generated/minloc0_8_r8.c,
	generated/minloc1_4_i4.c, generated/minloc1_4_i8.c,
	generated/minloc1_4_r4.c, generated/minloc1_4_r8.c,
	generated/minloc1_8_i4.c, generated/minloc1_8_i8.c,
	generated/minloc1_8_r4.c, generated/minloc1_8_r8.c,
	generated/minval_i4.c, generated/minval_i8.c,
	generated/minval_r4.c, generated/minval_r8.c,
	generated/product_c4.c, generated/product_c8.c,
	generated/product_i4.c, generated/product_i8.c,
	generated/product_r4.c, generated/product_r8.c,
	generated/reshape_c4.c, generated/reshape_c8.c,
	generated/reshape_i4.c, generated/reshape_i8.c,
	generated/sum_c4.c, generated/sum_c8.c, generated/sum_i4.c,
	generated/sum_i8.c, generated/sum_r4.c, generated/sum_r8.c,
	generated/transpose_c4.c, generated/transpose_c8.c,
	generated/transpose_i4.c, generated/transpose_i8.c: Regenerate:

From-SVN: r101739
2005-07-08 00:08:06 +02:00
Thomas Koenig 47b3a403a5 re PR fortran/21594 ([4.0 only] FAIL: gfortran.dg/eoshift.f90 -O0 execution test)
2005-07-07  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/21594
	* intrinsics/eoshift0.c:  If abs(shift) > len, fill the
	the whole array with the boundary value, but don't overrun it.
	* intrinsics/eoshift2.c:  Likewise.
	* m4/eoshift1.m4:  Likewise.
	* m4/eoshift3.m4:  Likewise.
	* generated/eoshift1_4.c:  Regenerated.
	* generated/eoshift1_8.c:  Regenerated.
	* generated/eoshift3_4.c:  Regenerated.
	* generated/eoshift3_8.c:  Regenerated.

2005-07-07  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/21594
	* gfortran.fortran-torture/execute/intrinsic_eoshift.f90:
	Add test cases where the shift length is greater than the
	array length.

From-SVN: r101738
2005-07-07 22:01:41 +00:00
Feng Wang d3642f893a For the 60th anniversary of Chinese people��s Anti-Japan war victory.
2005-07-07  Feng Wang  <fengwang@nudt.edu.cn>

	PR fortran/16531
	PR fortran/15966
	PR fortran/18781
	* arith.c (gfc_hollerith2int, gfc_hollerith2real,
	gfc_hollerith2complex, gfc_hollerith2character, gfc_hollerith2logical):
	New functions.
	(eval_intrinsic): Don't evaluate if Hollerith constant arguments exist.
	* arith.h (gfc_hollerith2int, gfc_hollerith2real,
	gfc_hollerith2complex, gfc_hollerith2character, gfc_hollerith2logical):
	Add prototypes.
	* expr.c (free_expr0): Free memery allocated for Hollerith constant.
	(gfc_copy_expr): Allocate and copy string if Expr is from Hollerith.
	(gfc_check_assign): Enable conversion from Hollerith to other.
	* gfortran.h (bt): Add BT_HOLLERITH.
	(gfc_expr): Add from_H flag.
	* intrinsic.c (gfc_type_letter): Return 'h' for BT_HOLLERITH.
	(add_conversions): Add conversions from Hollerith constant to other.
	(do_simplify): Don't simplify if  Hollerith constant arguments exist.
	* io.c (resolve_tag): Enable array in FORMAT tag under GFC_STD_GNU.
	* misc.c (gfc_basetype_name): Return "HOLLERITH" for BT_HOLLERITH.
	(gfc_type_name): Print "HOLLERITH" for BT_HOLLERITH.
	* primary.c (match_hollerith_constant): New function.
	(gfc_match_literal_constant): Add match Hollerith before Integer.
	* simplify.c (gfc_convert_constant): Add conversion from Hollerith
	to other.
	* trans-const.c (gfc_conv_constant_to_tree): Use VIEW_CONVERT_EXPR to
	convert Hollerith constant to tree.
	* trans-io.c (gfc_convert_array_to_string): Get array's address and
	length to set string expr.
	(set_string): Deal with array assigned Hollerith constant and character
	array.
	* gfortran.texi: Document Hollerith constants as extention support.

2005-07-07  Feng Wang  <fengwang@nudt.edu.cn>

	PR fortran/16531
	PR fortran/15966
	PR fortran/18781
	* gfortran.dg/hollerith.f90: New.
	* gfortran.dg/hollerith2.f90: New.
	* gfortran.dg/hollerith3.f90: New.
	* gfortran.dg/hollerith4.f90: New.
	* gfortran.dg/hollerith_f95.f90: New.
	* gfortran.dg/hollerith_legacy.f90: New.
	* gfortran.dg/g77/cpp4.F: New. Port from g77.

2005-07-07  Feng Wang  <fengwang@nudt.edu.cn>

	PR fortran/16531
	* io/transfer.c (formatted_transfer): Enable FMT_A on other types to
	support Hollerith constants.

From-SVN: r101688
2005-07-07 07:54:58 +00:00
Andreas Jaeger a3b6aba29c unpack_generic.c: Remove const from parameter.
* intrinsics/unpack_generic.c: Remove const from parameter.

	* io/transfer.c (formatted_transfer): Remove unused variable.

From-SVN: r101499
2005-07-01 07:44:50 +02:00
Thomas Koenig 7f8f6d5f05 re PR libfortran/22142 ([4.0 only] eoshift: boundary not filled in correctly)
2005-06-28  Thomas Koenig  <Thomas.Koenig@online.de>

        PR libfortran/22142
        * m4/eoshift1.m4:  Correct bstride (it needs to be multiplied
        by size since it's a char pointer).
        * m4/eoshift1_4.c:  Regenerated.
        * m4/eoshift1_8.c:  Regenerated.

2005-06-28  Thomas Koenig  <Thomas.Koenig@online.de>

        PR libfortran/22142
        * gfortran.fortran-torture/execute/intrinsic_eoshift.f90:
        Add testcase also testing eoshift1 for PR 22142.

From-SVN: r101398
2005-06-28 23:07:20 +00:00
Thomas Koenig 0f363a3b8c re PR libfortran/22142 ([4.0 only] eoshift: boundary not filled in correctly)
2005-06-28  Thomas Koenig  <Thomas.Koenig@online.de>

        PR libfortran/22142
        * m4/eoshift3.m4:  Correct bstride (it needs to be multiplied
        by size since it's a char pointer).
        * m4/eoshift3_4.c:  Regenerated.
        * m4/eoshift3_8.c:  Regenerated.

2005-06-28  Thomas Koenig  <Thomas.Koenig@online.de>

        PR libfortran/22142
        * gfortran.fortran-torture/execute/intrinsic_eoshift.f90:
        Add testcase for PR 22142.

From-SVN: r101392
2005-06-28 21:57:45 +00:00
Francois-Xavier Coudert e082bf48ca re PR libfortran/22170 ([4.0 only] Handle format slash error)
PR libfortran/22170
	* io/transfer.c (formatted_transfer): Do not iterate on the
	repeat count of a FMT_SLASH, since this is already done in
	next_format().

From-SVN: r101377
2005-06-28 10:43:23 +00:00
Jerry DeLisle dc9207b34e 2005-06-24 Jerry DeLisle <jvdelisle@verizon.net>
libgfortran/ChangeLog: Clean up format for entry of 2005-06-24.

From-SVN: r101346
2005-06-27 01:27:18 +00:00
Thomas Koenig 0e6d033bc8 [multiple changes]
2005-06-25  Thomas Koenig  <Thomas.Koenig@online.de>

        PR libfortran/22144
        * m4/cshift1.m4: Remove const from argument ret.
        Populate return array descriptor if ret->data is NULL.
        * m4/eoshift1.m4: Likewise.
        * m4/eoshift3.m4: Likewise.
        * generated/cshift1_4.c:  Regenerated.
        * generated/cshift1_8.c:  Regenerated.
        * generated/eoshift1_4.c:  Regenerated.
        * generated/eoshift1_8.c:  Regenerated.
        * generated/eoshift3_4.c:  Regenerated.
        * generated/eoshift3_8.c:  Regenerated.

2005-06-25  Thomas Koenig <Thomas.Koenig@online.de>

        PR libfortran/21144
        * gfortran.dg/shift-alloc.f90:  New testcase.

From-SVN: r101318
2005-06-25 09:56:37 +00:00
Jerry DeLisle f02d008e26 re PR fortran/21915 ([4.0 only] Would like atanh etc. as intrinsics)
2005-06-24  Jerry DeLisle <jvdelisle@verizon.net>

    PR libfortran/21915
    * Makefile.am: include intrinsics/hyper.c
    * c99_protos.h: add prototypes for single precision versions of
    acosh, asinh, and atanh for platforms that do not have these
    * config.h.in: add #undef for wrappers
    * configure.ac: add checks for single precision versions
    * aclocal.m4: generated
    * Makefile.in: generated
    * configure: generated

From-SVN: r101302
2005-06-24 23:07:13 +00:00
Francois-Xavier Coudert 32aa3bffc3 c99_functions.c (log10l): New log10l function for systems where this is not available.
* 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
2005-06-23 18:50:25 +00:00
Janne Blomqvist b68d2bed0d unix.c (stream_at_bof): Don't assume that all non-mmapped files are non-seekable.
* unix.c (stream_at_bof): Don't assume that all non-mmapped files
	are non-seekable.
	(stream_at_eof): Likewise.

From-SVN: r101164
2005-06-18 20:09:28 +00:00
Francois-Xavier Coudert 853a4203b7 re PR libfortran/19155 ([4.0 only] blanks not treated as zeros in 'E' format read (NIST FM110.FOR))
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
2005-06-17 16:20:29 +00:00
Francois-Xavier Coudert 04d9e6bdd3 re PR libfortran/19216 (list directed read with leading slash (NIST FM923))
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
2005-06-16 22:50:51 +00:00
Francois-Xavier Coudert b9297522fd * io/transfer.c (formatted_transfer): Fix typo in error message.
From-SVN: r101102
2005-06-16 22:31:32 +00:00
Francois-Xavier Coudert 2f06ccc69e re PR libfortran/16436 (gfortran TL edit descriptor failure - test f77-edit-t-in.f)
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-16 22:13:26 +00:00
François-Xavier Coudert ae973d6ae8 re PR libfortran/21950 (All gfortran execution tests fail on Tru64 UNIX V4.0F: scalbn unresolved)
PR libfortran/21950
	* intrinsics/c99_functions.c (scalbn): Provide fallback
	implementation for scalbn.
	* c99_protos.h: Prototype for scalbn.
	* configure.ac: Add check for scalbn.
	* configure: Regenerate.
	* config.h.in: Regenerate.

From-SVN: r100974
2005-06-15 08:40:35 +00:00
Thomas Koenig 5721f015bb eoshift0.c: Removed prototype for eoshift0.
2005-06-14  Thomas Koenig  <Thomas.Koenig@online.de>

        * intrinsics/eoshift0.c:  Removed prototype for eoshift0.
        * intrinsics/eoshift2.c:  Removed prototype for eoshift2.

From-SVN: r100954
2005-06-14 20:45:21 +00:00
Tom Tromey cd11181329 re PR libgcj/19877 (sometimes reconfiguring leads to incorrect config.h)
config/:
	PR libgcj/19877:
	* no-executables.m4: Call real AC_FUNC_MMAP when cache variable
	is set but not 'no'.
libstdc++-v3/:
	PR libgcj/19877:
	* configure, aclocal.m4: Rebuilt.
	* Makefile.in, include/Makefile.in, libmath/Makefile.in,
	libsupc++/Makefile.in, po/Makefile.in, src/Makefile.in,
	testsuite/Makefile.in: Likewise.
libjava/:
	PR libgcj/19877:
	* configure, aclocal.m4, Makefile.in: Rebuilt.
libgfortran/:
	PR libgcj/19877:
	* configure, aclocal.m4, Makefile.in: Rebuilt.
zlib/:
	PR libgcj/19877:
	* configure, aclocal.m4, Makefile.in: Rebuilt.

From-SVN: r100953
2005-06-14 20:05:59 +00:00
Thomas Koenig 2b5554f3c0 re PR fortran/21594 ([4.0 only] FAIL: gfortran.dg/eoshift.f90 -O0 execution test)
2005-06-12  Thomas Koenig  <Thomas.Koenig@online.de>

        PR libfortran/21594
        * intrinsics/eoshift0.c:  Add prototype for eoshift0.
        * intrinsics/eoshift2.c:  Add prototype for eoshift2.

From-SVN: r100907
2005-06-13 22:37:39 +00:00
Steven G. Kargl bf0606afc1 PR libfortran/PR21797
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-12 21:00:57 +00:00
Thomas Koenig 181786a7dd re PR libfortran/21333 ([4.0 only] in_pack / in_unpack alignment issues)
2005-06-12  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/21333
	* Changelog: Really update.

From-SVN: r100862
2005-06-12 20:27:59 +00:00
Francois-Xavier Coudert 57504df9ee re PR libfortran/19155 ([4.0 only] blanks not treated as zeros in 'E' format read (NIST FM110.FOR))
PR libfortran/19155
	* io/read.c (read_f): Take care of spaces after initial sign.
	* gfortran.dg/pr19155.f: Add test.

From-SVN: r100861
2005-06-12 19:59:17 +00:00
Thomas Koenig 92f5e87c2b re PR fortran/21480 ([4.0 only] trivial reshape operation gives erroneous results)
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-09 19:43:27 +00:00
Thomas Koenig ae740ccecd re PR libfortran/21926 ([4.0 only] matmul does not deal with non-packed result)
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
2005-06-07 20:46:17 +00:00
François-Xavier Coudert 771e816bd8 * libgfortran/ChangeLog: fix date for previous commit.
From-SVN: r100354
2005-05-30 07:41:23 +00:00