Commit Graph

588 Commits

Author SHA1 Message Date
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
Steven G. Kargl c7877252d4 Forgot to remove and add these files in the previous commit.
* io/backspace.c: File removed, contents moved to ...
	* io/endfile.c: Ditto.
	* io/rewind.c: Ditto.
	* io/file_pos.c: New file, ... here.

From-SVN: r102836
2005-08-07 22:59:00 +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 e138a19f6b re PR fortran/21915 ([4.0 only] Would like atanh etc. as intrinsics)
2005-06-24  Jerry DeLisle <jvdelisle@verizon.net>

    PR libfortran/21915
    * intrinsics/hyper.c: New file, adds wrapper functions

From-SVN: r101303
2005-06-24 23:09:47 +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 3932808120 [multiple changes]
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-11 19:39:13 +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
Francois-Xavier Coudert 12e59662e3 re PR libfortran/20179 (cannot mix C and Fortran I/O)
PR libfortran/20179
	* io/unix.c (fd_close): Add test so that we don't close()
	stdout and stderr.

From-SVN: r100353
2005-05-30 07:38:36 +00:00
Francois-Xavier Coudert c9330b0331 re PR libfortran/20006 ($ format extension doesn't work)
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-29 12:22:49 +00:00
Thomas Koenig f827a7d0f3 in_pack_generic.c: Adjust copyright years.
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-27 19:00:50 +00:00
Thomas Koenig ba4a3d54ba re PR fortran/17283 (UNPACK issues)
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-26 06:26:17 +00:00
Peter Wainwright de3e06c62c * libgfortran/ChangeLog: Corrected author name.
From-SVN: r100114
2005-05-24 20:46:54 +00:00
Peter Wainwright c220bdaec9 re PR libfortran/21376 (libfortran "E" output format causes FPE)
PR libfortran/21376
	* io/write.c (output_float): Rework logic to avoid call to log10
	with argument equal to zero.

From-SVN: r100068
2005-05-22 21:17:42 +00:00
Eric Botcazou 69a2d125d6 configure.ac: Check for trunc and truncf in libm.
* configure.ac: Check for trunc and truncf in libm.
	* configure: Regenerate.
	* config.h.in: Likewise.
	* intrinsics/c99_functions.c (trunc, truncf): New functions.
	* c99_protos.h (trunc, truncf): Declare them.

From-SVN: r100040
2005-05-21 06:44:50 +00:00
Thomas Koenig 5ac7af02ea re PR libfortran/21127 (reshape of complex broken)
2005-05-18  Thomas Koenig  <Thomas.Koenig@online.de>

        PR libfortran/21127
        * Makefile.am:  Really commit.
        * Makefile.in:  Really commit.

From-SVN: r99926
2005-05-18 20:35:25 +00:00
Thomas Koenig 8f4dc7afb1 re PR libfortran/21127 (reshape of complex broken)
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
2005-05-18 20:24:32 +00:00
Andreas Jaeger a0f94629e9 unit.c (get_unit): Mark argument as unused.
* io/unit.c (get_unit): Mark argument as unused.
	(init_units): Avoid warning about signed comparision.

From-SVN: r99842
2005-05-17 19:02:38 +02:00
Andreas Jaeger 8f2a14065c configure.ac: Add additional warning flags.
* configure.ac: Add additional warning flags.
	* configure: Regenerate.

	* io/write.c (calculate_G_format): Remove unused parameter.
	(output_float): Remove unused parameter.
	(write_float): Change callers.
	(nml_write_obj): Avoid signed warning.
	Make variable const to support -Wwrite-strings.

	* io/unix.c (fd_alloc, mmap_open, mmap_sfree, mem_sfree,
	mem_truncate): Mark argument as unused.

	* io/unit.c (get_unit): Mark argument as unused.
	(init_units): Avoid warning about signed comparision.

	* io/transfer.c (next_record_r): Remove unused parameter.
	(next_record_w): Remove unused parameter.
	(next_record): Change callers.
	(iolength_transfer): Mark arguments as unused.

	* io/open.c: Add initializer.

	* io/list_read.c (read_character): Mark argument as unused.
	(nml_match_name): Add const to make compile with -Wwrite-strings.

	* io/format.c: Add initializer.

From-SVN: r99839
2005-05-17 18:54:58 +02:00
Andreas Jaeger 7672ae2082 eoshift1.m4: Initialize variables to avoid warnings.
* m4/eoshift1.m4: Initialize variables to avoid warnings.
	* m4/eoshift3.m4: Initialize variables to avoid warnings.
	* generated/eoshift1_4.c, generated/eoshift1_8.c,
	generated/eoshift3_4.c, generated/eoshift3_8.c: Regenerated.

	* intrinsics/spread_generic.c (spread): Initialize variables to
	avoid warnings.

	* intrinsics/eoshift0.c (eoshift0): Initialize variables to avoid
	warnings.
	* intrinsics/eoshift2.c (eoshift2): Initialize variables to avoid
	warnings.

	* io/list_read.c (nml_get_obj_data): Initialize variables to avoid
	warnings.

From-SVN: r99726
2005-05-15 17:50:09 +02:00
Andreas Jaeger 7d3cdba142 * aclocal.m4: Regenerated.
From-SVN: r99724
2005-05-15 17:38:21 +02:00
Andreas Jaeger e606fb399e pack_generic.c (pack): Remove unneeded calculation.
* intrinsics/pack_generic.c (pack): Remove unneeded calculation.

	* m4/matmull.m4 (matmul_): Remove unneeded calculations, fix
	pointer cast to avoid warning.
	* generated/matmul_l4.c: Regenerated.
	* generated/matmul_l8.c: Regenerated.

	* Makefile.am: Remove AM_CFLAGS here.
	* configure.ac: Define AM_CFLAGS and AM_FCFLAGS so that warnings
	are set.  Set additionally -Wstrict-prototypes for CFLAGS.
	* Makefile.in: Regenerated
	* configure: Regenerated.

From-SVN: r99723
2005-05-15 17:37:18 +02:00
Andreas Jaeger 6b0215364d system_clock.c (system_clock_4, [...]): Add missing returns, reformat a bit.
* 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-15 17:33:12 +02:00
Andreas Jaeger 944e86ee09 unit.c (is_internal_unit): Add void as parameter list.
* io/unit.c (is_internal_unit): Add void as parameter list.

	* io/transfer.c: Move prototype declarations before the functions.

From-SVN: r99721
2005-05-15 15:25:19 +02:00
Andreas Jaeger 420aa7b82c Remove extra whitespace.
From-SVN: r99720
2005-05-15 14:49:45 +02:00
Andreas Jaeger 4b6903ec2f normalize.c (almostone_r4, [...]): Fix parameter list.
* runtime/normalize.c (almostone_r4, almostone_r8): Fix parameter
	list.

	* intrinsics/random.c (KISS_DEFAULT_SEED): Remove extra semicolon.

	* io/transfer.c: Do not use empty initializers for global objects.
	Add missing initializers.

	* io/lock.c: Do not use empty initializers for global objects.

	* io/close.c: Add missing initializers.

	* runtime/environ.c: Add missing initializers. Do not use empty
	initializers for global object.
	(init_string): Mark argument as unused.

	* runtime/main.c (cleanup): Fix parameter list.

	* io/io.h: Fix parameter lists.

	* m4/transpose.m4, m4/matmul.m4: Fix pointer cast to avoid
	warning.

	* generated/transpose_c4.c, generated/transpose_c8.c,
	generated/transpose_i4.c, generated/transpose_i8.c,
	generated/matmul_c4.c, generated/matmul_c8.c,
	generated/matmul_i4.c, generated/matmul_i8.c,
	generated/matmul_r4.c, generated/matmul_r8.c: Regenerated.

	* io/write.c (nml_write_obj): Fix 64-bit problem.

	* io/list_read.c (nml_get_obj_data): Add missing braces around
	initializer to avoid warnings.

	* intrinsics/etime.c (etime_sub): Remove unused variable.

From-SVN: r99719
2005-05-15 14:44:42 +02:00
Andreas Jaeger deeab82073 chdir.c, [...]: Include <string.h> for prototypes.
* intrinsics/chdir.c, intrinsics/getlog.c, intrinsics/link.c,
	intrinsics/symlnk.c, intrinsics/perror.c: Include <string.h> for
	prototypes.

	* runtime/string.c (compare0): Remove unused variable.
	* io/unit.c (init_units): Remove unused variables.
	* intrinsics/getcwd.c (getcwd_i4_sub): Remove unused variable.
	* intrinsics/unlink.c (unlink_i4_sub): Remove unused variable.
	* intrinsics/stat.c (stat_i4_sub, fstat_i8_sub, fstat_i4_sub,
	stat_i8_sub): Remove unused variable.

From-SVN: r99716
2005-05-15 10:25:52 +02:00
Thomas Koenig c42a19d5e3 re PR libfortran/21324 (#undef GFC_CLEAR_MEMORY causes testsuite failures)
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
2005-05-12 17:50:33 +00:00
Bud Davis 802fc8260d re PR libfortran/19478 (reading back from /dev/null)
PR fortran/19478
	* io/unix.c (fd_truncate): update positions when ftruncate
	fails (like writing to /dev/null).
	* gfortran.dg/dev_null.f90: New test.

From-SVN: r99570
2005-05-11 10:34:05 +00:00
Francois-Xavier Coudert da32fddcb6 re PR libfortran/21471 ('POSITION = "APPEND"' doesn't seem to work)
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
2005-05-11 05:56:20 +00:00
Tobias Schlüter 973ff4c052 re PR fortran/20178 (COMPLEX function returns incompatible with g77)
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
2005-05-11 00:06:55 +02:00
Francois-Xavier Coudert 8809f6f945 re PR libfortran/20788 (Loading libgfortran.so clobbers C redirection of stdin/stdout/stderr)
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
2005-05-10 08:34:58 +00:00
Mike Stump f4c767fdc2 * configure: Regenerate.
From-SVN: r99498
2005-05-10 01:43:00 +00:00
Francois-Xavier Coudert 4581ba9d4f 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): 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-05-09 11:21:01 +00:00
Thomas Koenig e33e218bad re PR libfortran/21354 ([4.0 only] Rank 7 not handled correctly)
2005-05-04  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/21354
	* m4/cshift1.m4: Change dimension of auxiliary arrays from
	GFC_MAX_DIMENSION - 1 to GFC_MAX_DIMENSION.
	* m4/eoshift1.m4: Likewise.
	* m4/eoshift3.m4: Likewise.
	* m4/ifunction.m4: Likewise.
	* m4/in_pack.m4: Likewise.
	* m4/in_unpack.m4: Likewise.
	* intrinsics/cshift0.c: Likewise.
	* intrinsics/eoshift0.c: Likewise.
	* intrinsics/eoshift2.c: Likewise.
	* intrinsics/random.c: Likewise.
	* intrinsics/spread_generic.c: Likewise.
	* intrinsics/stat.c: Likewise.
	* generated/all_l4.c: Regenerated.
	* generated/all_l8.c: Regenerated.
	* generated/any_l4.c: Regenerated.
	* generated/any_l8.c: Regenerated.
	* generated/count_4_l4.c: Regenerated.
	* generated/count_4_l8.c: Regenerated.
	* generated/count_8_l4.c: Regenerated.
	* generated/count_8_l8.c: Regenerated.
	* 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.
	* 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/maxloc0_4_i4.c: Regenerated.
	* generated/maxloc0_4_i8.c: Regenerated.
	* generated/maxloc0_4_r4.c: Regenerated.
	* generated/maxloc0_4_r8.c: Regenerated.
	* generated/maxloc0_8_i4.c: Regenerated.
	* generated/maxloc0_8_i8.c: Regenerated.
	* generated/maxloc0_8_r4.c: Regenerated.
	* generated/maxloc0_8_r8.c: Regenerated.
	* generated/maxloc1_4_i4.c: Regenerated.
	* generated/maxloc1_4_i8.c: Regenerated.
	* generated/maxloc1_4_r4.c: Regenerated.
	* generated/maxloc1_4_r8.c: Regenerated.
	* generated/maxloc1_8_i4.c: Regenerated.
	* generated/maxloc1_8_i8.c: Regenerated.
	* generated/maxloc1_8_r4.c: Regenerated.
	* generated/maxloc1_8_r8.c: Regenerated.
	* generated/maxval_i4.c: Regenerated.
	* generated/maxval_i8.c: Regenerated.
	* generated/maxval_r4.c: Regenerated.
	* generated/maxval_r8.c: Regenerated.
	* generated/minloc0_4_i4.c: Regenerated.
	* generated/minloc0_4_i8.c: Regenerated.
	* generated/minloc0_4_r4.c: Regenerated.
	* generated/minloc0_4_r8.c: Regenerated.
	* generated/minloc0_8_i4.c: Regenerated.
	* generated/minloc0_8_i8.c: Regenerated.
	* generated/minloc0_8_r4.c: Regenerated.
	* generated/minloc0_8_r8.c: Regenerated.
	* generated/minloc1_4_i4.c: Regenerated.
	* generated/minloc1_4_i8.c: Regenerated.
	* generated/minloc1_4_r4.c: Regenerated.
	* generated/minloc1_4_r8.c: Regenerated.
	* generated/minloc1_8_i4.c: Regenerated.
	* generated/minloc1_8_i8.c: Regenerated.
	* generated/minloc1_8_r4.c: Regenerated.
	* generated/minloc1_8_r8.c: Regenerated.
	* generated/minval_i4.c: Regenerated.
	* generated/minval_i8.c: Regenerated.
	* generated/minval_r4.c: Regenerated.
	* generated/minval_r8.c: Regenerated.
	* generated/product_c4.c: Regenerated.
	* generated/product_c8.c: Regenerated.
	* generated/product_i4.c: Regenerated.
	* generated/product_i8.c: Regenerated.
	* generated/product_r4.c: Regenerated.
	* generated/product_r8.c: Regenerated.
	* generated/sum_c4.c: Regenerated.
	* generated/sum_c8.c: Regenerated.
	* generated/sum_i4.c: Regenerated.
	* generated/sum_i8.c: Regenerated.
	* generated/sum_r4.c: Regenerated.
	* generated/sum_r8.c: Regenerated.

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

	PR libfortran/21354
	gfortran.dg/in_pack_rank7.f90:  New test.

From-SVN: r99232
2005-05-04 21:38:23 +00:00
Thomas Koenig 8e249b232d re PR libfortran/18958 ([4.0 only] eoshift segfaults when shifting off the end of an array)
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
2005-04-30 20:51:39 +00:00
Paul Thomas f6c7d65b66 Fix matmul PR18857 and supply testcase
From-SVN: r99041
2005-04-30 18:17:54 +00:00
Francois-Xavier Coudert 1fb2002d69 configure.ac: Check for ftruncate and chsize.
* 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
2005-04-29 14:24:04 +00:00
Tobias Schlüter d8955e4baf * intrinsics/rename.c: Add missing #includes.
From-SVN: r98961
2005-04-29 02:46:36 +02:00
Tobias Schlüter 0ffcc9e7dd * AUTHORS, COPYING, INSTALL, NEWS, README: Remove.
From-SVN: r98935
2005-04-28 22:25:11 +02:00
David Edelsohn f5b092e391 Add PR to ChangeLog.
From-SVN: r98796
2005-04-26 18:17:41 -04:00
David Edelsohn 9adcdfb365 rewind.c (st_rewind): Flush the stream when resetting the mode from WRITING to READING.
* io/rewind.c (st_rewind): Flush the stream when resetting the mode
        from WRITING to READING.

From-SVN: r98788
2005-04-26 15:27:11 -04:00
Paul Thomas bfe936c0c1 Fix bug that causes testsuite failure in namelist_13.f90 on some systems.
Co-Authored-By: Jerry DeLisle <jvdelisle@verizon.net>

From-SVN: r98610
2005-04-23 12:38:08 +00:00
Thomas Koenig da8f3dcc5b 05-04-22 Thomas Koenig <Thomas.Koenig@online.de>
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
2005-04-22 20:02:44 +00:00
Paul Thomas 883dd42959 correct memory leaks in namelist code for derived types
From-SVN: r98352
2005-04-18 22:19:27 +00:00
Francois-Xavier Coudert 293fcb2e28 re PR libfortran/20950 ([4.0 only] segfault in INQUIRE asking for SEQUENTIAL status)
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-18 07:34:32 +00:00
Thomas Koenig 5f9bfaf2bc 005-04-17 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/21075
        * m4/reshape.m4 (reshape_`'rtype_kind):  Change dimension
        of auxiliary arrays from GFC_MAX_DIMENSIONS - 1 to
        GFC_MAX_DIMENSIONS.
        * intrinsics/reshape_generic.c (reshape_generic):  Likewise.
        * generated/reshape_i4.c:  Regenerated.
        * generated/reshape_i8.c:  Regenerated.

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

        PR libfortran/21075
        * gfortran.dg/reshape_rank7.f90: New test.

From-SVN: r98288
2005-04-17 20:26:57 +00:00
Paul Thomas 29dc5138c3 re PR fortran/17472 ([4.0 only] namelist does not handle arrays)
-------------------------------------------------------------------

From-SVN: r98287
2005-04-17 20:09:37 +00:00
Thomas Koenig 8e6d7b8a35 re PR libfortran/18495 ([4.0 only] Intrinisc function SPREAD is broken)
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
2005-04-15 20:06:17 +00:00
Mike Stump 6dab073ba7 * configure: Regenerate.
From-SVN: r98065
2005-04-13 01:41:26 +00:00
Thomas Koenig c6abe94dc1 re PR libfortran/19106 ([4.0 only] segfault in executable for print *,sum(a,dim=2,mask=a>0))
2005-04-13  Thomas Koenig  <Thomas.Koenig@online.de>

        PR libfortran/19106
        * m4/iforeach.c (name`'rtype_qual`_'atype_code):  Add TODO
        that setting correct strides is a front end job.
        (`m'name`'rtype_qual`_'atype_code):  Likewise.  If mask has
        a lowest stride of 0, adjust to 1.
        * m4/ifunction.c (name`'rtype_qual`_'atype_code):  Add TODO
        that setting correct strides is a front end job.
        (`m'name`'rtype_qual`_'atype_code):  Likewise.  If mask has
        a lowest stride of 0, adjust to 1.
        * maxloc0_4_i4.c: Regenerated
        * maxloc0_4_i8.c: Regenerated
        * maxloc0_4_r4.c: Regenerated
        * maxloc0_4_r8.c: Regenerated
        * maxloc0_8_i4.c: Regenerated
        * maxloc0_8_i8.c: Regenerated
        * maxloc0_8_r4.c: Regenerated
        * maxloc0_8_r8.c: Regenerated
        * maxloc1_4_i4.c: Regenerated
        * maxloc1_4_i8.c: Regenerated
        * maxloc1_4_r4.c: Regenerated
        * maxloc1_4_r8.c: Regenerated
        * maxloc1_8_i4.c: Regenerated
        * maxloc1_8_i8.c: Regenerated
        * maxloc1_8_r4.c: Regenerated
        * maxloc1_8_r8.c: Regenerated
        * maxval_i4.c: Regenerated
        * maxval_i8.c: Regenerated
        * maxval_r4.c: Regenerated
        * maxval_r8.c: Regenerated
        * minloc0_4_i4.c: Regenerated
        * minloc0_4_i8.c: Regenerated
        * minloc0_4_r4.c: Regenerated
        * minloc0_4_r8.c: Regenerated
        * minloc0_8_i4.c: Regenerated
        * minloc0_8_i8.c: Regenerated
        * minloc0_8_r4.c: Regenerated
        * minloc0_8_r8.c: Regenerated
        * minloc1_4_i4.c: Regenerated
        * minloc1_4_i8.c: Regenerated
        * minloc1_4_r4.c: Regenerated
        * minloc1_4_r8.c: Regenerated
        * minloc1_8_i4.c: Regenerated
        * minloc1_8_i8.c: Regenerated
        * minloc1_8_r4.c: Regenerated
        * minloc1_8_r8.c: Regenerated
        * minval_i4.c: Regenerated
        * minval_i8.c: Regenerated
        * minval_r4.c: Regenerated
        * minval_r8.c: Regenerated
        * product_c4.c: Regenerated
        * product_c8.c: Regenerated
        * product_i4.c: Regenerated
        * product_i8.c: Regenerated
        * product_r4.c: Regenerated
        * product_r8.c: Regenerated
        * sum_c4.c: Regenerated
        * sum_c8.c: Regenerated
        * sum_i4.c: Regenerated
        * sum_i8.c: Regenerated
        * sum_r4.c: Regenerated
        * sum_r8.c: Regenerated

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

        PR libfortran/19016
        * gfortran.fortran-torture/execute/intrinsic_mmloc.f90:
        Add tests with mask generated by expression.
        * gfortran.fortran-torture/execute/intrinsic_mmval.f90:  Likewise.
        * gfortran.fortran-torture/execute/intrinsic_product.f90:  Likewise.
        * gfortran.fortran-torture/execute/intrinsic_sum.f90:  Likewise.

From-SVN: r98052
2005-04-12 22:57:10 +00:00
François-Xavier Coudert b45ea4d28c * runtime/environ.c: Correct previous commit for obvious typo.
From-SVN: r97947
2005-04-10 13:08:12 +00:00
Francois-Xavier Coudert 64d5075d0b re PR libfortran/20788 (Loading libgfortran.so clobbers C redirection of stdin/stdout/stderr)
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 10:37:59 +00:00
Thomas Koenig 1d1df67fa9 2005-05-10 Thomas Koenig <Thomas Koenig>
Removed erroneous line from Changelog.

From-SVN: r97944
2005-04-10 08:43:55 +00:00
Thomas Koenig 59afe4b424 [multiple changes]
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
2005-04-10 08:35:39 +00:00
Bud Davis 48248fa771 re PR libfortran/19872 ([4.0 only] closed and re-opened file not overwriten)
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-10 03:43:09 +00:00
Thomas Koenig 50dd63a962 re PR libfortran/19106 ([4.0 only] segfault in executable for print *,sum(a,dim=2,mask=a>0))
2005-04-09  Thomas Koenig  <Thomas.Koenig@online.de>

        PR libfortran/19106
        PR libfortran/19014
        * m4/ifunction.m4 (name`'rtype_qual`_'atype_code): ditto.
        If retarray->data is NULL (i.e. the front end does not
        know the rank and dimenson of the array), fill in its
        properties and allocate memory.
        Change the assertions about rank and dimension of retarray into
        runtime errors and only check them for retarray->data != NULL.
        Do the same for correcting the stride from 0 to 1 in retarray.
        (`m'name`'rtype_qual`_'atype_code): Likewise.
        * m4/iforeach.m4 (name`'rtype_qual`_'atype_code): Likewise.
        Change assertion about rank of array to runtime error.
        (`m'name`'rtype_qual`_'atype_code): Likewise.
        * generated/all_l4.c: Regenerated.
        * generated/all_l8.c: Regenerated.
        * generated/any_l4.c: Regenerated.
        * generated/any_l8.c: Regenerated.
        * generated/count_4_l4.c: Regenerated.
        * generated/count_4_l8.c: Regenerated.
        * generated/count_8_l4.c: Regenerated.
        * generated/count_8_l8.c: Regenerated.
        * generated/maxloc0_4_i4.c: Regenerated.
        * generated/maxloc0_4_i8.c: Regenerated.
        * generated/maxloc0_4_r4.c: Regenerated.
        * generated/maxloc0_4_r8.c: Regenerated.
        * generated/maxloc0_8_i4.c: Regenerated.
        * generated/maxloc0_8_i8.c: Regenerated.
        * generated/maxloc0_8_r4.c: Regenerated.
        * generated/maxloc0_8_r8.c: Regenerated.
        * generated/maxloc1_4_i4.c: Regenerated.
        * generated/maxloc1_4_i8.c: Regenerated.
        * generated/maxloc1_4_r4.c: Regenerated.
        * generated/maxloc1_4_r8.c: Regenerated.
        * generated/maxloc1_8_i4.c: Regenerated.
        * generated/maxloc1_8_i8.c: Regenerated.
        * generated/maxloc1_8_r4.c: Regenerated.
        * generated/maxloc1_8_r8.c: Regenerated.
        * generated/maxval_i4.c: Regenerated.
        * generated/maxval_i8.c: Regenerated.
        * generated/maxval_r4.c: Regenerated.
        * generated/maxval_r8.c: Regenerated.
        * generated/minloc0_4_i4.c: Regenerated.
        * generated/minloc0_4_i8.c: Regenerated.
        * generated/minloc0_4_r4.c: Regenerated.
        * generated/minloc0_4_r8.c: Regenerated.
        * generated/minloc0_8_i4.c: Regenerated.
        * generated/minloc0_8_i8.c: Regenerated.
        * generated/minloc0_8_r4.c: Regenerated.
        * generated/minloc0_8_r8.c: Regenerated.
        * generated/minloc1_4_i4.c: Regenerated.
        * generated/minloc1_4_i8.c: Regenerated.
        * generated/minloc1_4_r4.c: Regenerated.
        * generated/minloc1_4_r8.c: Regenerated.
        * generated/minloc1_8_i4.c: Regenerated.
        * generated/minloc1_8_i8.c: Regenerated.
        * generated/minloc1_8_r4.c: Regenerated.
        * generated/minloc1_8_r8.c: Regenerated.
        * generated/minval_i4.c: Regenerated.
        * generated/minval_i8.c: Regenerated.
        * generated/minval_r4.c: Regenerated.
        * generated/minval_r8.c: Regenerated.
        * generated/product_c4.c: Regenerated.
        * generated/product_c8.c: Regenerated.
        * generated/product_i4.c: Regenerated.
        * generated/product_i8.c: Regenerated.
        * generated/product_r4.c: Regenerated.
        * generated/product_r8.c: Regenerated.
        * generated/sum_c4.c: Regenerated.
        * generated/sum_c8.c: Regenerated.
        * generated/sum_i4.c: Regenerated.
        * generated/sum_i8.c: Regenerated.
        * generated/sum_r4.c: Regenerated.
        * generated/sum_r8.c: Regenerated.

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

        * gfortran.fortran-torture/execute/intrinsic_anyall.f90:
        Added test for callee-allocated arrays with write statements.
        * gfortran.fortran-torture/execute/intrinsic_count.f90: Likewise.
        * gfortran.fortran-torture/execute/intrinsic_mmloc.f90: Likewise.
        * gfortran.fortran-torture/execute/intrinsic_mmval.f90: Likewise.
        * gfortran.fortran-torture/execute/intrinsic_product.f90: Likewise.
        * gfortran.fortran-torture/execute/intrinsic_sum.f90: Likewise.

From-SVN: r97929
2005-04-09 21:38:47 +00:00
Thomas Koenig 130bcb37be re PR libfortran/20163 ([4.0 only] gfortran - error opening direct access file)
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
2005-04-09 19:37:14 +00:00
Andrew Pinski 53d8a8ac22 re PR fortran/13257 ([4.0 only] Error instead of warning for missing comma in format string)
PR fortran/13257

fortran/ChangeLog:
	* io.c (check_format): Allow an optional comma
	between descriptors.

libgfortran/ChangeLog:
	* format.c (parse_format_list): Allow an optional comma
	between descriptors.

testsuite/ChangeLog:
	* comma_format_extension_[1234].f: New tests.

From-SVN: r97919
2005-04-09 11:44:07 -07:00
Eric Botcazou 01d87b6f3d backspace.c (unformatted_backspace): Do not dereference the pointer to the stream.
* io/backspace.c (unformatted_backspace): Do not dereference
	the pointer to the stream.

From-SVN: r97851
2005-04-08 19:07:54 +00:00
Andrew Pinski e87045f3ae re PR libfortran/20766 ([darwin] - run time error when calling fortran subroutine from c)
2005-04-07  Andrew Pinski  <pinskia@physics.uc.edu>

        PR libfortran/20766
        * configure.ac (extra_ldflags_libgfortran): Set for *-darwin* to
        "-Wl,-single_module".
        * configure: Regenerate.
        * Makefile.am (libgfortran_la_LDFLAGS): Add extra_ldflags_libgfortran.
        * Makefile.in: Regenerate.

From-SVN: r97804
2005-04-07 14:06:27 -07:00
Francois-Xavier Coudert 51e9d74cb8 re PR libfortran/20755 (gfortran - prints the same number with 1p4G12.3 two different ways)
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
2005-04-05 14:20:10 +00:00
Dale Ranta 00f07d96bd re PR libfortran/20068 (Backspace problems)
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
2005-04-03 08:07:43 +00:00
Francois-Xavier Coudert 14fd645e24 re PR libfortran/20660 (INQUIRE incorrectly reports the existence of UNITS)
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
2005-03-31 15:30:06 +00:00
François-Xavier Coudert 82498ed4b9 re PR libfortran/20163 ([4.0 only] gfortran - error opening direct access file)
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
2005-03-29 08:37:32 +00:00
Francois-Xavier Coudert 94887ef478 re PR libfortran/19678 (DOS files don't work for list directed input)
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
2005-03-25 13:35:29 +00:00
Francois-Xavier Coudert a50f3cd3e6 re PR libfortran/15332 (colon edit descriptor not handled correctly)
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
2005-03-25 07:04:27 +00:00
Francois-Xavier Coudert ee4b41afc7 * config.h.in: Regenerate.
From-SVN: r96998
2005-03-24 17:55:31 +00:00
François-Xavier Coudert 85624ffd34 * libgfortran/io/write.c (output_float): fix typo in last commit.
From-SVN: r96958
2005-03-23 22:31:56 +00:00
François-Xavier Coudert 2852cd64d8 * libgfortran/Changelog: last commit had wrong date in Changelog
From-SVN: r96954
2005-03-23 21:45:04 +00:00
Francois-Xavier Coudert fd4f678cf2 re PR libfortran/18025 (libgfortran: format, incompatible "minimum width" edit descriptor)
PR libfortran/18025
        * write.c (output_float): Handling the "F0.d" format similarly as
        commercial compilers.

        * pr18025.f90: New test.

From-SVN: r96953
2005-03-23 21:42:10 +00:00
François-Xavier Coudert f77b6ca3da Makefile.am: Added new files.
* Makefile.am: Added new files.
        * Makefile.in: Regenerate.
        * aclocal.m4: Regenerate.
        * configure.ac: add checks for signal.h headers file, as well as
        following functions: chdir, strerror, getlogin, gethostname, kill,
        link, symlink, perror, sleep, time.
        * configure: Regenerate.
        * intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
        intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
        intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
        intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
        implementend g77 intrinsics.

        * check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
        gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
        gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
        gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
        gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
        gfc_check_perror): new functions to check newly implemented
        g77 intrinsics.
        * gfortran.h: adding symbols for new intrinsics.
        * intrinsic.c (add_functions): adding new intrinsics.
        (add_subroutines): adding new intrinsics.
        * intrinsic.h: prototype for all checking and resolving
        functions.
        * iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
        gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
        gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
        gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
        gfc_resolve_kill_sub, gfc_resolve_link_sub,
        gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
        gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
        gfc_resolve_perror): new functions to resolve intrinsics.
        * trans-intrinsic.c (gfc_conv_intrinsic_function): add case
        for new symbols.

        * g77_intrinsics_funcs.f: New test.
        * g77_intrinsics_sub.f: New test.

From-SVN: r96893
2005-03-22 22:08:22 +00:00
Zack Weinberg 140e859c6c configure.ac: Do not invoke TL_AC_GCC_VERSION.
* 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
2005-03-21 17:46:19 +00:00
François-Xavier Coudert 0376d694c2 * io.h: Setting higher default record length.
From-SVN: r96574
2005-03-16 19:33:07 +00:00
Francois-Xavier Coudert 2786eb77b2 open.c (new_unit): set record length to max_offset rather than using a hard-coded limit (which was...
* 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-16 19:32:08 +00:00
Francois-Xavier Coudert dcdeec06a0 write.c (output_float): special check when writing 0.0 with EN and ES formats.
* write.c (output_float): special check when writing 0.0 with
          EN and ES formats.

        * pr20480.f90: New test.

From-SVN: r96566
2005-03-16 18:09:03 +00:00
Francois-Xavier Coudert 0b2df4a703 [multiple changes]
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
2005-03-11 08:03:02 +00:00
Toon Moene 5bae4ce839 ChangeLog: Fix typo in Peter O'Gorman's name.
2005-02-27  Toon Moene  <toon@moene.indiv.nluug.nl>

	* ChangeLog: Fix typo in Peter O'Gorman's name.
	* runtime/environ.c: Update copyright years.

From-SVN: r95635
2005-02-27 20:59:02 +00:00
Tobias Schlüter c7c61e5ec5 * io/write.c: Update copyright years.
From-SVN: r95630
2005-02-27 21:11:01 +01:00
Francois-Xavier Coudert d8f92af2cf re PR libfortran/20101 (zero prints incorrectly with 1pe12.4)
libgfortran/
2005-02-27  Fran��ois-Xavier Coudert  <coudert@clipper.ens.fr>

 PR libfortran/20101
* write.c (output_float): Adding special check for value 0.0 in
PE format.

gcc/testsuite/
2005-02-27  Fran��ois-Xavier Coudert  <coudert@clipper.ens.fr>

PR libfortran/20101
* gfortran.dg/write_0_pe_format.f90: New test.

From-SVN: r95628
2005-02-27 20:47:12 +01:00
Tobias Schlüter 34d6d42fb4 write.c (output_float): Fix typo in condition.
libgfortran/
* io/write.c (output_float): Fix typo in condition.

gcc/testsuite/
* gfortran.dg/e_d_fmt.f90: New test.

From-SVN: r95615
2005-02-27 17:17:56 +01:00
Peter O'Gorman b239be8150 re PR libfortran/17748 (libgfortran contains undefined references to _environ)
2005-02-26  Peter O'Gorman  <peter@pogman.com>
            Toon Moene  <toon@moene.indiv.nluug.nl>

	PR libgfortran/17748
	* runtime/environ.c: Remove references to environ.
	(show_variables): remove GFORTRAN_UNBUFFERED_* and
	GFORTRAN_NAME_* because they require environ.
	(pattern_scan): Remove function.

Co-Authored-By: Toon Moene <toon@moene.indiv.nluug.nl>

From-SVN: r95593
2005-02-26 18:33:11 +00:00
Bud Davis 397763d2af [multiple changes]
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
2005-02-23 04:09:17 +00:00
Bud Davis ec88bf8bb7 [multiple changes]
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-22 03:26:25 +00:00
Eric Botcazou 7442146939 re PR libfortran/19302 (intrinsic_nearest.f90 fails)
PR libfortran/19302
	* intrinsics/c99_functions.c (nextafterf): Special-case infinite
	numbers.

From-SVN: r95353
2005-02-21 21:39:33 +00:00
Steven G. Kargl 95b49c6f9d * io/write.c(output_float): Typo in error message.
From-SVN: r95343
2005-02-21 19:59:58 +00:00
Steven G. Kargl 5920b5d2e8 re PR libfortran/20085 (iargc returns wrong count for number of program arguments)
PR 20085
* intrinsic/args.c (iargc): Off by 1.

From-SVN: r95302
2005-02-20 15:24:02 +00:00
Steven G. Kargl d3f9c1b9bc * intrinsic/date_and_time.c: Fix conformance problems.
From-SVN: r95284
2005-02-19 18:06:00 +00:00
Paul Thomas e88334a68f re PR libfortran/19363 (List directed write of Infinity and NaN has regressed)
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
2005-02-01 09:06:22 +00:00
Bud Davis 23e044cc1d re PR libfortran/19647 (inquire(delim=) returns garbage)
2005-01-30  Bud Davis  <bdavis@gfortran.org>

        PR fortran/19647
        * io/inquire.c (inquire_via_unit): Use correct variable for
        pad.

        * gfortan.dg/inquire_7.f90

From-SVN: r94439
2005-01-30 13:16:19 +00:00
Thomas Koenig 24a09741e4 re PR libfortran/19595 ([4.0 only] eor does not work)
2005-01-29  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/19595
	* io/transfer.c (data_transfer_init): eor requires advance="NO".
testsuite/
	* gfortran.dg/eor_1.f90:  New test.

From-SVN: r94410
2005-01-29 15:45:17 +00:00
Tobias Schlüter 8dac1b213e re PR libfortran/19524 (5 times uninitialized var in libgfortran)
PR libfortran/19524
* io/read.c (read_f): Don't free uninitialized pointer.

From-SVN: r94232
2005-01-25 22:40:25 +01:00
Paul Brook 2d304c90bd Update Copyright.
From-SVN: r94118
2005-01-23 17:16:43 +00:00
James A. Morrison 587579571d re PR fortran/19294 (intrinsic_transpose.f90 runtime crash)
2005-01-23  James A. Morrison  <phython@gcc.gnu.org>
	Paul Brook  <paul@codesourcery.com>

	PR fortran/19294
	* iresolve.c (gfc_resolve_transpose): Resolve to transpose_c4 or
	transpose_c8 for complex types.
libgfortran/
	* Makefile.am: Add transpose_c4.c and transpose_c8.c.
	* intrinsics/cshift0.c: Use separate optimized loops for complex types.
	* m4/transpose.m4: Include type letter in function name.
	* Makefile.in: Regenerate.
	* generated/transpose_*.c: Regenerate.

Co-Authored-By: Paul Brook <paul@codesourcery.com>

From-SVN: r94116
2005-01-23 17:01:00 +00:00
Thomas Koenig 0e69bba9fc re PR libfortran/19451 (Read after a write with a read only file)
2005-01-22  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/19451
	* io/transfer.c (finalize_transfer):  Don't do anything if
	there is an error condition.
	* open_readonly_1.f90:  New test.

From-SVN: r94101
2005-01-23 02:18:33 +00:00
David Edelsohn fbac336391 re PR libfortran/19052 (unit 0 not preconnected to standard error)
PR libgfortran/19052
        * libgfortran.h (options_t): Add stderr_unit.
        * io/io.h (error_stream): Declare.
        * io/open.c (new_unit): Do not terminate abnormally if opening
        file preconnected to stdin, stdout, or stderr.
        * io/unit.c (init_units): Initialize stderr_unit.
        * io/unix.c (error_stream): New function.
        * runtime/environ.c (GFORTRAN_STDERR_UNIT): New environment variable.

From-SVN: r94090
2005-01-22 19:14:31 -05:00
Thomas Koenig d02b2c6474 re PR libfortran/18982 (open(status="new") does not generate an error if the file exists)
2005-01-22  Thomas Koenig  <Thomas.Koenig@online.de>

	PR libfortran/18982
	* io/unix.c (regular_file):  No need to change flags->action
	if an error occurs.  Document this.
	No need to call stat() for STATUS_OLD, open() will
	fail anyway.
	For ACTION_UNSPECIFIED, try open for read-write, then for
	read-only if open fails with EACCES, then for write-only
	if that fails with EACCES again.
	* io/unix.c (open_external): Document changed behavior of
	regular_file.
testsuite/
	* gfortran.dg/open_new.f90: New file.

From-SVN: r94076
2005-01-22 19:49:18 +00:00
Tobias Schlüter b8d5e92646 re PR fortran/19194 (Missing RECL parameter in OPEN statement)
gcc/fortran/
PR fortran/19194
* trans-io.c (ADD_STRING): Use gfc_charlen_type_node for string
length parameters.
(gfc_build_io_library_fndecls): 'rec' and 'recl_in' are not
pointer fields.

libgfortran/
PR fortran/19194
* io/io.h (st_parameter): Use 'GFC_INTEGER_4' instead of 'int',
use CHARACTER macro for definition of string valued paramters.

Also fix years in recent ChangeLog entries.

From-SVN: r94065
2005-01-22 15:37:39 +01:00
Bud Davis b1a807057e re PR libfortran/19314 (inquire(position=) segfaults at runtime)
2004-01-22  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/19314
        * io/inquire.c(inquire_via_unit): implement POSITION=.
        * io/transfer.c(next_record): update position for
        INQUIRE.
        * io/rewind.c(st_rewind): update position for
        INQUIRE.

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

From-SVN: r94060
2005-01-22 03:51:12 +00:00
Bud Davis f53d3f9317 re PR libfortran/18778 (ENDFILE is not functionnal)
2005-01-16  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/18778
        * gfortran.dg/endfile_2.f90: New test.

        * io/transfer.c (us_read): no bytes available is not a
        runtime error.

From-SVN: r93737
2005-01-16 20:44:01 +00:00
Bud Davis e1c74af03a re PR libfortran/18983 (can't open /dev/null as an output file)
2005-01-15  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/18983
        * io/transfer.c (st_write_done): only truncate when it
        is required.

2005-01-15  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/18983
        * gfortran.dg/write_to_null.f90: New test.

From-SVN: r93689
2005-01-15 08:10:23 +00:00
Toon Moene 57dea9f62e re PR libfortran/19280 (Inconsistent licensing of libgfortran)
2005-01-12  Toon Moene  <toon@moene.indiv.nluug.nl>

	PR libfortran/19280
	c99_protos.h: License changed to GPL+exception.
	libgfortran.h: Ditto.
	intrinsics/abort.c: Ditto.
	intrinsics/args.c: Ditto.
	intrinsics/associated.c: Ditto.
	intrinsics/bessel.c: Ditto.
	intrinsics/c99_functions.c: Ditto.
	intrinsics/cpu_time.c: Ditto.
	intrinsics/cshift0.c: Ditto.
	intrinsics/date_and_time.c: Ditto.
	intrinsics/env.c: Ditto.
	intrinsics/eoshift0.c: Ditto.
	intrinsics/eoshift2.c: Ditto.
	intrinsics/erf.c: Ditto.
	intrinsics/etime.c: Ditto.
	intrinsics/exit.c: Ditto.
	intrinsics/flush.c: Ditto.
	intrinsics/fnum.c: Ditto.
	intrinsics/getXid.c: Ditto.
	intrinsics/getcwd.c: Ditto.
	intrinsics/ishftc.c: Ditto.
	intrinsics/mvbits.c: Ditto.
	intrinsics/pack_generic.c: Ditto.
	intrinsics/rand.c: Ditto.
	intrinsics/random.c: Ditto.
	intrinsics/reshape_generic.c: Ditto.
	intrinsics/reshape_packed.c: Ditto.
	intrinsics/size.c: Ditto.
	intrinsics/spread_generic.c: Ditto.
	intrinsics/stat.c: Ditto.
	intrinsics/string_intrinsics.c: Ditto.
	intrinsics/system.c: Ditto.
	intrinsics/system_clock.c: Ditto.
	intrinsics/transpose_generic.c: Ditto.
	intrinsics/umask.c: Ditto.
	intrinsics/unlink.c: Ditto.
	intrinsics/unpack_generic.c: Ditto.
	io/backspace.c: Ditto.
	io/close.c: Ditto.
	io/endfile.c: Ditto.
	io/format.c: Ditto.
	io/inquire.c: Ditto.
	io/io.h: Ditto.
	io/list_read.c: Ditto.
	io/lock.c: Ditto.
	io/open.c: Ditto.
	io/read.c: Ditto.
	io/rewind.c: Ditto.
	io/transfer.c: Ditto.
	io/unit.c: Ditto.
	io/unix.c: Ditto.
	io/write.c: Ditto.
	m4/all.m4: Ditto.
	m4/any.m4: Ditto.
	m4/cexp.m4: Ditto.
	m4/chyp.m4: Ditto.
	m4/count.m4: Ditto.
	m4/cshift1.m4: Ditto.
	m4/ctrig.m4: Ditto.
	m4/dotprod.m4: Ditto.
	m4/dotprodc.m4: Ditto.
	m4/dotprodl.m4: Ditto.
	m4/eoshift1.m4: Ditto.
	m4/eoshift3.m4: Ditto.
	m4/exponent.m4: Ditto.
	m4/fraction.m4: Ditto.
	m4/head.m4: Ditto.
	m4/iforeach.m4: Ditto.
	m4/ifunction.m4: Ditto.
	m4/in_pack.m4: Ditto.
	m4/in_unpack.m4: Ditto.
	m4/iparm.m4: Ditto.
	m4/matmul.m4: Ditto.
	m4/matmull.m4: Ditto.
	m4/maxloc0.m4: Ditto.
	m4/maxloc1.m4: Ditto.
	m4/maxval.m4: Ditto.
	m4/minloc0.m4: Ditto.
	m4/minloc1.m4: Ditto.
	m4/minval.m4: Ditto.
	m4/mtype.m4: Ditto.
	m4/nearest.m4: Ditto.
	m4/pow.m4: Ditto.
	m4/product.m4: Ditto.
	m4/reshape.m4: Ditto.
	m4/set_exponent.m4: Ditto.
	m4/shape.m4: Ditto.
	m4/specific.m4: Ditto.
	m4/specific2.m4: Ditto.
	m4/sum.m4: Ditto.
	m4/transpose.m4: Ditto.
	m4/types.m4: Ditto.
	runtime/environ.c: Ditto.
	runtime/error.c: Ditto.
	runtime/in_pack_generic.c: Ditto.
	runtime/in_unpack_generic.c: Ditto.
	runtime/main.c: Ditto.
	runtime/memory.c: Ditto.
	runtime/normalize.c: Ditto.
	runtime/pause.c: Ditto.
	runtime/select.c: Ditto.
	runtime/stop.c: Ditto.
	runtime/string.c: Ditto.
	generated/_abs_c4.f90: Regenerated.
	generated/_abs_c8.f90: Regenerated.
	generated/_abs_i4.f90: Regenerated.
	generated/_abs_i8.f90: Regenerated.
	generated/_abs_r4.f90: Regenerated.
	generated/_abs_r8.f90: Regenerated.
	generated/_acos_r4.f90: Regenerated.
	generated/_acos_r8.f90: Regenerated.
	generated/_aint_r4.f90: Regenerated.
	generated/_aint_r8.f90: Regenerated.
	generated/_anint_r4.f90: Regenerated.
	generated/_anint_r8.f90: Regenerated.
	generated/_asin_r4.f90: Regenerated.
	generated/_asin_r8.f90: Regenerated.
	generated/_atan2_r4.f90: Regenerated.
	generated/_atan2_r8.f90: Regenerated.
	generated/_atan_r4.f90: Regenerated.
	generated/_atan_r8.f90: Regenerated.
	generated/_conjg_c4.f90: Regenerated.
	generated/_conjg_c8.f90: Regenerated.
	generated/_cos_c4.f90: Regenerated.
	generated/_cos_c8.f90: Regenerated.
	generated/_cos_r4.f90: Regenerated.
	generated/_cos_r8.f90: Regenerated.
	generated/_cosh_r4.f90: Regenerated.
	generated/_cosh_r8.f90: Regenerated.
	generated/_dim_i4.f90: Regenerated.
	generated/_dim_i8.f90: Regenerated.
	generated/_dim_r4.f90: Regenerated.
	generated/_dim_r8.f90: Regenerated.
	generated/_exp_c4.f90: Regenerated.
	generated/_exp_c8.f90: Regenerated.
	generated/_exp_r4.f90: Regenerated.
	generated/_exp_r8.f90: Regenerated.
	generated/_log10_r4.f90: Regenerated.
	generated/_log10_r8.f90: Regenerated.
	generated/_log_c4.f90: Regenerated.
	generated/_log_c8.f90: Regenerated.
	generated/_log_r4.f90: Regenerated.
	generated/_log_r8.f90: Regenerated.
	generated/_mod_i4.f90: Regenerated.
	generated/_mod_i8.f90: Regenerated.
	generated/_mod_r4.f90: Regenerated.
	generated/_mod_r8.f90: Regenerated.
	generated/_sign_i4.f90: Regenerated.
	generated/_sign_i8.f90: Regenerated.
	generated/_sign_r4.f90: Regenerated.
	generated/_sign_r8.f90: Regenerated.
	generated/_sin_c4.f90: Regenerated.
	generated/_sin_c8.f90: Regenerated.
	generated/_sin_r4.f90: Regenerated.
	generated/_sin_r8.f90: Regenerated.
	generated/_sinh_r4.f90: Regenerated.
	generated/_sinh_r8.f90: Regenerated.
	generated/_sqrt_c4.f90: Regenerated.
	generated/_sqrt_c8.f90: Regenerated.
	generated/_sqrt_r4.f90: Regenerated.
	generated/_sqrt_r8.f90: Regenerated.
	generated/_tan_r4.f90: Regenerated.
	generated/_tan_r8.f90: Regenerated.
	generated/_tanh_r4.f90: Regenerated.
	generated/_tanh_r8.f90: Regenerated.
	generated/all_l4.c: Regenerated.
	generated/all_l8.c: Regenerated.
	generated/any_l4.c: Regenerated.
	generated/any_l8.c: Regenerated.
	generated/count_4_l4.c: Regenerated.
	generated/count_4_l8.c: Regenerated.
	generated/count_8_l4.c: Regenerated.
	generated/count_8_l8.c: Regenerated.
	generated/cshift1_4.c: Regenerated.
	generated/cshift1_8.c: Regenerated.
	generated/dotprod_c4.c: Regenerated.
	generated/dotprod_c8.c: Regenerated.
	generated/dotprod_i4.c: Regenerated.
	generated/dotprod_i8.c: Regenerated.
	generated/dotprod_l4.c: Regenerated.
	generated/dotprod_l8.c: Regenerated.
	generated/dotprod_r4.c: Regenerated.
	generated/dotprod_r8.c: Regenerated.
	generated/eoshift1_4.c: Regenerated.
	generated/eoshift1_8.c: Regenerated.
	generated/eoshift3_4.c: Regenerated.
	generated/eoshift3_8.c: Regenerated.
	generated/exp_c4.c: Regenerated.
	generated/exp_c8.c: Regenerated.
	generated/exponent_r4.c: Regenerated.
	generated/exponent_r8.c: Regenerated.
	generated/fraction_r4.c: Regenerated.
	generated/fraction_r8.c: Regenerated.
	generated/hyp_c4.c: Regenerated.
	generated/hyp_c8.c: Regenerated.
	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/matmul_c4.c: Regenerated.
	generated/matmul_c8.c: Regenerated.
	generated/matmul_i4.c: Regenerated.
	generated/matmul_i8.c: Regenerated.
	generated/matmul_l4.c: Regenerated.
	generated/matmul_l8.c: Regenerated.
	generated/matmul_r4.c: Regenerated.
	generated/matmul_r8.c: Regenerated.
	generated/maxloc0_4_i4.c: Regenerated.
	generated/maxloc0_4_i8.c: Regenerated.
	generated/maxloc0_4_r4.c: Regenerated.
	generated/maxloc0_4_r8.c: Regenerated.
	generated/maxloc0_8_i4.c: Regenerated.
	generated/maxloc0_8_i8.c: Regenerated.
	generated/maxloc0_8_r4.c: Regenerated.
	generated/maxloc0_8_r8.c: Regenerated.
	generated/maxloc1_4_i4.c: Regenerated.
	generated/maxloc1_4_i8.c: Regenerated.
	generated/maxloc1_4_r4.c: Regenerated.
	generated/maxloc1_4_r8.c: Regenerated.
	generated/maxloc1_8_i4.c: Regenerated.
	generated/maxloc1_8_i8.c: Regenerated.
	generated/maxloc1_8_r4.c: Regenerated.
	generated/maxloc1_8_r8.c: Regenerated.
	generated/maxval_i4.c: Regenerated.
	generated/maxval_i8.c: Regenerated.
	generated/maxval_r4.c: Regenerated.
	generated/maxval_r8.c: Regenerated.
	generated/minloc0_4_i4.c: Regenerated.
	generated/minloc0_4_i8.c: Regenerated.
	generated/minloc0_4_r4.c: Regenerated.
	generated/minloc0_4_r8.c: Regenerated.
	generated/minloc0_8_i4.c: Regenerated.
	generated/minloc0_8_i8.c: Regenerated.
	generated/minloc0_8_r4.c: Regenerated.
	generated/minloc0_8_r8.c: Regenerated.
	generated/minloc1_4_i4.c: Regenerated.
	generated/minloc1_4_i8.c: Regenerated.
	generated/minloc1_4_r4.c: Regenerated.
	generated/minloc1_4_r8.c: Regenerated.
	generated/minloc1_8_i4.c: Regenerated.
	generated/minloc1_8_i8.c: Regenerated.
	generated/minloc1_8_r4.c: Regenerated.
	generated/minloc1_8_r8.c: Regenerated.
	generated/minval_i4.c: Regenerated.
	generated/minval_i8.c: Regenerated.
	generated/minval_r4.c: Regenerated.
	generated/minval_r8.c: Regenerated.
	generated/nearest_r4.c: Regenerated.
	generated/nearest_r8.c: Regenerated.
	generated/pow_c4_i4.c: Regenerated.
	generated/pow_c4_i8.c: Regenerated.
	generated/pow_c8_i4.c: Regenerated.
	generated/pow_c8_i8.c: Regenerated.
	generated/pow_i4_i4.c: Regenerated.
	generated/pow_i4_i8.c: Regenerated.
	generated/pow_i8_i4.c: Regenerated.
	generated/pow_i8_i8.c: Regenerated.
	generated/pow_r4_i4.c: Regenerated.
	generated/pow_r4_i8.c: Regenerated.
	generated/pow_r8_i4.c: Regenerated.
	generated/pow_r8_i8.c: Regenerated.
	generated/product_c4.c: Regenerated.
	generated/product_c8.c: Regenerated.
	generated/product_i4.c: Regenerated.
	generated/product_i8.c: Regenerated.
	generated/product_r4.c: Regenerated.
	generated/product_r8.c: Regenerated.
	generated/reshape_i4.c: Regenerated.
	generated/reshape_i8.c: Regenerated.
	generated/set_exponent_r4.c: Regenerated.
	generated/set_exponent_r8.c: Regenerated.
	generated/shape_i4.c: Regenerated.
	generated/shape_i8.c: Regenerated.
	generated/sum_c4.c: Regenerated.
	generated/sum_c8.c: Regenerated.
	generated/sum_i4.c: Regenerated.
	generated/sum_i8.c: Regenerated.
	generated/sum_r4.c: Regenerated.
	generated/sum_r8.c: Regenerated.
	generated/transpose_i4.c: Regenerated.
	generated/transpose_i8.c: Regenerated.
	generated/trig_c4.c: Regenerated.
	generated/trig_c8.c: Regenerated.

From-SVN: r93235
2005-01-12 21:27:33 +00:00
Bud Davis a7e8d7dbe7 re PR libfortran/18398 (Formatted I/O problems)
2005-01-07  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/18398
        * transfer.c (next_record_r): always skip the
        eol search if it was found during sf_read.

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

From-SVN: r93035
2005-01-07 03:25:47 +00:00
Tobias Schlüter 963fe80802 Fix typo in ChangeLog
From-SVN: r92643
2004-12-27 17:43:47 +01:00
Tobias Schlüter 56746a0745 trans-intrinsic.c (gfc_conv_intrinsic_ishft): Change to logicalshift.
gcc/fortran/
* trans-intrinsic.c (gfc_conv_intrinsic_ishft): Change to
logicalshift.  Call fold.  Remove 0-bit shift shortcut.
(gfc_conv_intrinsic_ishftc): Convert first argument to at least
4 bytes bits.  Convert 2nd and 3rd argument to 4 bytes.  Convert
result if width(arg 1) < 4 bytes.  Call fold.

libgfortran/
* libgfortran/libgfortran.h (GFC_UINTEGER_1, GFC_UINTEGER_2):
Define.
* intrinsics/ishftc.c: Update copyright years.
(ishftc8): Change 'shift' and 'size' to GFC_INTEGER_4.
* intrinsics/mvbits.c: Correcty non-ASCII character in my name.
Add implementations for GFC_INTEGER_1 and GFC_INTEGER_2.

gcc/testsuite/
* gfortran.dg/g77/f90-intrinsic-bit.f: New.

From-SVN: r92642
2004-12-27 17:43:25 +01:00
Bud Davis 5d3a981694 re PR libfortran/19071 (complex formatted output has too many items)
2004-12-23  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/19071
        * io/tranfer.c (formatted_transfer): moved check for
        format reversion inside the processing loop.

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

From-SVN: r92582
2004-12-24 00:29:07 +00:00
Aaron W. LaFramboise 9548f05908 libgfortran.h (itoa): Rename to gfc_itoa.
* libgfortran.h (itoa): Rename to gfc_itoa.
	* io/write.c (itoa): Same.
	* runtime/environ.c (itoa): Same.
	* runtime/error.c (itoa): Same.

From-SVN: r92380
2004-12-19 12:54:00 -06:00
Bud Davis c8c83c1828 re PR libfortran/17597 (list directed read has error)
2004-12-15  Bud Davis  <bdavis9659@comcast.net>
            Steven G. Kargl  <kargls@comcast.net>

        PR fortran/17597
        * io/list_read.c (read_real): do not push back a comma when
        it delimits a real value without a decimal point


2004-12-15  Bud Davis  <bdavis9659@comcast.net>
            Steven G. Kargle  <kargls@comcast.net>

        PR fortran/17597
        * gfortran.dg/list_read_3.f90: New test.

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

From-SVN: r92190
2004-12-15 12:42:39 +00:00
Tobias Schlüter cf77e601e5 Fix date on ChangeLog
From-SVN: r92163
2004-12-14 23:00:54 +01:00
Steve Ellcey 0865674700 transfer.c (us_read): Use memcpy/memset instead of assignment to fill unaligned buffer.
* libgfortran/io/transfer.c (us_read): Use memcpy/memset
	instead of assignment to fill unaligned buffer.
	(us_write): Ditto.
	(next_record_w): Ditto.

From-SVN: r92143
2004-12-14 16:34:08 +00:00
Steven G. Kargl 985791f6fe re PR libfortran/18966 (cshift etc. not implemented for kind=1 and kind=2 actual arguments)
PR libfortran/18966
        * gfortran.h: typedef GFC_INTEGER_1 and GFC_INTEGER_2
        * intrinsics/cshift0.c (cshift0_1,cshift0_2): New functions.
        * intrinsics/eoshift0.c (eoshift0_1,eoshift0_2): New functions.
        * intrinsics/eoshift2.c (eoshift2_1,eoshift2_2): New functions.

From-SVN: r92132
2004-12-14 10:43:36 +00:00
David Edelsohn 681b5028d9 * io/transfer.c (read_sf): Change bitwise "and" to logical "and".
From-SVN: r92094
2004-12-13 11:06:57 -05:00
Richard Henderson 7f68c75fb3 iresolve.c (gfc_resolve_all, [...]): Use PREFIX.
gcc/fortran/
        * iresolve.c (gfc_resolve_all, gfc_resolve_any, gfc_resolve_count,
        gfc_resolve_cshift, gfc_resolve_dot_product, gfc_resolve_eoshift,
        gfc_resolve_matmul, gfc_resolve_maxloc, gfc_resolve_maxval,
        gfc_resolve_minloc, gfc_resolve_minval, gfc_resolve_pack,
        gfc_resolve_product, gfc_resolve_reshape, gfc_resolve_shape,
        gfc_resolve_spread, gfc_resolve_sum, gfc_resolve_transpose,
        gfc_resolve_unpack: Use PREFIX.
libgfortran/
        * 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.c, m4/cshift1.m4, m4/dotprod.m4,
        m4/dotprodc.m4, m4/dotprodl.m4, m4/eoshift1.m4, m4/eoshift3.m4,
        m4/iforeach.m4, m4/ifunction.m4, m4/matmul.m4, m4/matmull.m4,
        m4/reshape.m4, m4/shape.m4, m4/transpose.m4: Use standard prefix
        instead of "__".
        * generated/*: Rebuild.

From-SVN: r92075
2004-12-12 18:47:58 -08:00
Richard Henderson 7d7b8bfe55 acinclude.m4 (LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY): New.
* acinclude.m4 (LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY): New.
        (LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT): New.
        (LIBGFOR_CHECK_ATTRIBUTE_ALIAS): New.
        * configure.ac: Use them.
        * configure, config.h.in, aclocal.m4: Rebuild.
        * libgfortran.h (prefix): Remove.
        (PREFIX, IPREFIX): New.
        (sym_rename, sym_rename1, sym_rename2): New.
        (internal_proto, export_proto, export_proto_np): New.
        (iexport_proto, iexport): New.
        (iexport_data_proto, iexport_data): New.
        * intrinsics/abort.c, intrinsics/args.c, intrinsics/associated.c,
        intrinsics/cpu_time.c, intrinsics/cshift0.c,
        intrinsics/date_and_time.c, intrinsics/env.c, intrinsics/eoshift0.c,
        intrinsics/eoshift2.c, intrinsics/etime.c, intrinsics/exit.c,
        intrinsics/flush.c, intrinsics/fnum.c, intrinsics/getXid.c,
        intrinsics/getcwd.c, intrinsics/ishftc.c, intrinsics/mvbits.c,
        intrinsics/pack_generic.c, intrinsics/rand.c, intrinsics/random.c,
        intrinsics/reshape_generic.c, intrinsics/size.c,
        intrinsics/spread_generic.c, intrinsics/stat.c,
        intrinsics/string_intrinsics.c, intrinsics/system.c,
        intrinsics/system_clock.c, intrinsics/transpose_generic.c,
        intrinsics/umask.c, intrinsics/unlink.c, intrinsics/unpack_generic.c,
        io/backspace.c, io/close.c, io/endfile.c, io/inquire.c, io/io.h,
        io/open.c, io/rewind.c, io/transfer.c, libgfortran.h, 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/iforeach.m4,
        m4/ifunction.m4, m4/matmul.m4, m4/matmull.m4, m4/nearest.m4,
        m4/pow.m4, m4/reshape.m4, m4/set_exponent.m4, m4/shape.m4,
        m4/transpose.m4, runtime/environ.c, runtime/error.c,
        runtime/in_pack_generic.c, runtime/in_unpack_generic.c,
        runtime/main.c, runtime/memory.c, runtime/pause.c, runtime/select.c,
        runtime/stop.c: Use them to mark symbols internal or external.
        * generated/*: Rebuild.

From-SVN: r92045
2004-12-12 00:59:05 -08:00
David Edelsohn ad87ad6788 re PR bootstrap/18895 (libgfortran AM_MAKEFLAGS arg list + environment too large)
PR bootstrap/18895
        Revert 2004-12-07 change.
        * Makefile.am (AM_MAKEFLAGS): Delete.
        * Makefile.in: Regenerate.

From-SVN: r91955
2004-12-09 11:31:19 -05:00
Steve Ellcey 7dd42019e7 Makefile.am (AM_MAKEFLAGS): New.
* libgfortran/Makefile.am (AM_MAKEFLAGS): New.
	* libgfortran/Makefile.in: Regenerate

From-SVN: r91844
2004-12-08 00:43:34 +00:00
Steve Ellcey 6ecf6dcbb8 io.h (open_external): Change prototype.
* io/io.h (open_external): Change prototype.
	* io/unix.c (regular_file): Change prototype and set flags->action if
	needed.
	(open_external): Ditto.
	* io/open.c (new_unit): Let open_external set flags->action.

From-SVN: r91843
2004-12-08 00:32:39 +00:00
Eric Botcazou 6e4d9244f7 configure.ac: Check for ieeefp.h.
* configure.ac: Check for ieeefp.h.  Check for fabsf in libm.
	* configure: Regenerate.
	* config.h.in: Likewise.
	* c99_protos.h: New file.
	* libgfortran.h: Include c99_protos.h and conditionally ieeefp.h.
	* intrinsics/c99_functions.c (fabsf): New function.

From-SVN: r91832
2004-12-07 23:43:40 +00:00
Richard Henderson 07d3cebe24 cshift0.c, [...]: Use internal_malloc_size instead of internal_malloc.
* intrinsics/cshift0.c, intrinsics/eoshift0.c, intrinsics/eoshift2.c,
        intrinsics/pack_generic.c, intrinsics/string_intrinsics.c,
        intrinsics/transpose_generic.c, m4/ifunction.m4, m4/matmul.m4,
        m4/matmull.m4, m4/transpose.m4: Use internal_malloc_size instead
        of internal_malloc.
        * generated/*: Rebuild.

From-SVN: r91799
2004-12-06 16:24:44 -08:00
Richard Henderson f21edfd62d c99_functions.c, [...]: Whitespace fixes.
* intrinsics/c99_functions.c, intrinsics/eoshift0.c,
        intrinsics/eoshift2.c, intrinsics/exit.c, intrinsics/flush.c,
        intrinsics/ishftc.c, intrinsics/mvbits.c, intrinsics/pack_generic.c,
        intrinsics/random.c, intrinsics/reshape_generic.c, intrinsics/size.c,
        intrinsics/spread_generic.c, intrinsics/stat.c,
	intrinsics/string_intrinsics.c, intrinsics/system_clock.c,
        intrinsics/transpose_generic.c, intrinsics/unlink.c,
        intrinsics/unpack_generic.c, io/backspace.c, io/format.c,
        io/list_read.c, io/lock.c, io/open.c, io/transfer.c, io/unix.c,
        io/write.c, runtime/environ.c, runtime/error.c,
        runtime/in_pack_generic.c, runtime/in_unpack_generic.c, runtime/main.c,
        runtime/memory.c, runtime/pause.c, runtime/stop.c,
        runtime/string.c: Whitespace fixes.

From-SVN: r91794
2004-12-06 16:01:01 -08:00
Richard Henderson a8bc7089b5 Makefile.am: Generate all m4 output under $(srcdir).
* Makefile.am: Generate all m4 output under $(srcdir).
        * Makefile.in: Regenerate.

From-SVN: r91788
2004-12-06 13:29:57 -08:00
Tobias Schlüter abd7fea9f9 re PR libfortran/18710 (img part of complex number not written to direct access file)
libgfortran/
PR fortran/18710
* io/transfer.c (unformatted_read, unformatted_write): width of
a COMPLEX is twice its kind.

gcc/testsuite/
PR fortran/18170
* gfortran.dg/direct_io_3.f90: New test.

From-SVN: r91656
2004-12-02 20:39:15 +01:00
Richard Sandiford afabd8e62c Introduce and use config/gcc-version.m4.
From-SVN: r91625
2004-12-02 11:05:13 +00:00
Bud Davis 78579b601d re PR libfortran/18284 (BACKSPACE broken)
2004-12-02  Bud Davis  <bdavis9659@comcast.net>

        PR libfortran/18284
        * io/unix.c (fd_alloc_w_at): Update file_length when extending.
        * io/backspace.c (formatted_backspace): Reset endfile after backspace.

        PR fortran/18284
        * gfortran.dg/backspace.f90

From-SVN: r91612
2004-12-02 04:29:00 +00:00
Steven G. Kargl f177a08700 flush.c: New file.
2004-12-02  Steven G. Kargl  <kargls@comcast.net>
	Paul Brook  <paul@codesourcery.com>

libgfortran/
	* intrinsics/flush.c: New file.
	* intrinsics/fnum.c: ditto
	* intrinsics/stat.c: ditto
	* io/io.h (unit_to_fd): Add prototype.
	* io/unix.c (unit_to_fd): New function.
	* configure.ac: Add test for members of struct stat.  Check for
	sys/types.h and sys/stat.h
	* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
	* configure.in: Regenerate.
	* config.h.in: Regenerate.
	* Makefile.in: Regenerate.
fortran/
	* check.c (gfc_check_flush, gfc_check_fnum): New functions.
	(gfc_check_fstat, gfc_check_fstat_sub): New functions.
	(gfc_check_stat, gfc_check_stat_sub): New functions.
	* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
	* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
	fstat, and stat to intrinsics symbol tables.
	* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
	(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
	* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
	(gfc_resolve_stat, gfc_resolve_flush): New functions.
	(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
	* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.

From-SVN: r91611
2004-12-02 04:20:09 +00:00
Bud Davis 8dc4d66aa7 inquire.c (inquire_via_unit): do not allow a direct access file to be opened for sequential I/O.
2004-12-02  Bud Davis  <bdavis9659@comcast.net>

        * io/inquire.c (inquire_via_unit): do not allow a direct access
        file to be opened for sequential I/O.

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

From-SVN: r91610
2004-12-02 04:13:21 +00:00
Steven G. Kargl df65f0938c flush.c: New file.
2004-12-02  Steven G. Kargl  <kargls@comcast.net>
	Paul Brook  <paul@codesourcery.com>

libgfortran/
	* intrinsics/flush.c: New file.
	* intrinsics/fnum.c: ditto
	* intrinsics/stat.c: ditto
	* io/io.h (unit_to_fd): Add prototype.
	* io/unix.c (unit_to_fd): New function.
	* configure.ac: Add test for members of struct stat.  Check for
	sys/types.h and sys/stat.h
	* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
	* configure.in: Regenerate.
	* config.h.in: Regenerate.
	* Makefile.in: Regenerate.
fortran/
	* check.c (gfc_check_flush, gfc_check_fnum): New functions.
	(gfc_check_fstat, gfc_check_fstat_sub): New functions.
	(gfc_check_stat, gfc_check_stat_sub): New functions.
	* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
	* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
	fstat, and stat to intrinsics symbol tables.
	* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
	(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
	* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
	(gfc_resolve_stat, gfc_resolve_flush): New functions.
	(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
	* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.

Co-Authored-By: Paul Brook <paul@codesourcery.com>

From-SVN: r91609
2004-12-02 04:10:26 +00:00
Aaron W. LaFramboise f49b3d3628 Makefile.am (AM_CPPFLAGS): Use -iquote instead of -I.
2004-12-01  Aaron W. LaFramboise  <aaronavay62@aaronwl.com>

	* Makefile.am (AM_CPPFLAGS): Use -iquote instead of -I.

From-SVN: r91602
2004-12-02 00:42:12 +00:00
R. Kelley Cook 0d0a093554 Correct my erronous ChangeLog entries.
From-SVN: r91496
2004-11-29 23:51:45 +00:00
Bud Davis 905d47a950 direct_io_2.f90: New test.
2004-11-28  Bud Davis  <bdavis9659@comcast.net>

        * gcc/gcc/gfortran.dg/direct_io_2.f90: New test.

        * gcc/libgfortran/io/unix.c (mmap_alloc_w_a): check for a write
	to a location less than the mapped area.

From-SVN: r91426
2004-11-28 21:14:02 +00:00
Bud Davis 203f344c3d re PR libfortran/18364 (endfile does not truncate file)
2004-11-27  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/18364
        * gfortran.dg/endfile.f90: New test.
        *  io/endfile.c (st_endfile): flush the stream before truncating.

From-SVN: r91400
2004-11-27 23:35:47 +00:00
Kelley Cook 767f726e10 libtool.m4 (AC_DEPLIBS_CHECK_METHOD): Revert previous change.
2004-11-24  Kelley Cook  <kcook@gcc.gnu.org>

	* libtool.m4 (AC_DEPLIBS_CHECK_METHOD): Revert previous change.
	* boehm-gc/configure: Regenerate.
	* libffi/configure: Regenerate.
	* libgfortran/configure: Regenerate.
	* libjava/configure: Regenerate.
	* libobjc/configure: Regenerate.
	* libstdc++-v3/configure: Regenerate.
	* zlib/configure: Regenerate.

From-SVN: r91293
2004-11-25 13:43:43 +00:00
Kelley Cook 2c92e90fa5 libtool.m4 (AC_DEPLIBS_CHECK_METHOD): Import linux-gnu case from CVS libtool to always pass_all.
2004-11-24  Kelley Cook  <kcook@gcc.gnu.org>

	* libtool.m4 (AC_DEPLIBS_CHECK_METHOD): Import linux-gnu case
	from CVS libtool to always pass_all.
	* boehm-gc/configure: Regenerate.
	* libffi/configure: Regenerate.
	* libgfortran/configure: Regenerate.
	* libjava/configure: Regenerate.
	* libobjc/configure: Regenerate.
	* libstdc++-v3/configure: Regenerate.
	* zlib/configure: Regenerate.

From-SVN: r91200
2004-11-24 22:04:38 +00:00
Steven Bosscher 69d3c9a43e re PR libfortran/15960 (missing function 'finite' on HP-UX 11.11)
PR libfortran/15960
	* configure.ac: Check for finite in libm.
	* libgfortran.h: Define isfinite macro if not defined.
	* intrinsics/c99_functions.c: Use defined(fpclassify) instead of
	HAVE_FPCLASSIFY.
	* io/write.c (write_float): Use isfinite instead of finite.
	* configure, config.h.in: Rebuilt.

From-SVN: r91064
2004-11-23 02:02:38 +00:00
Roger Sayle b10cf17380 * io/write.c (write_float, list_formatted_write): Fix indentation.
From-SVN: r90975
2004-11-21 05:08:14 +00:00
Eric Botcazou 3969c39f61 re PR libfortran/16135 (libfortran doesn't build, use of C99 types)
PR target/16135
	* acinclude.m4 (LIBGFOR_TARGET_ILP32): New check.
	* configure.ac: Include LIBGFOR_TARGET_ILP32.
	* configure: Regenerate.
	* config.h.in: Likewise.
	* libgfortran.h: Provide default definitions for C99 types
	on ILP32 targets that don't have them.

	PR target/17999
	* configure.ac: Check for snprintf.
	* configure: Regenerate.
	* config.h.in: Likewise.
	* intrinsics/date_and_time.c (date_and_time): Do not
	use snprinf if it is not available.
	* io/write.c (output_float): Likewise.

From-SVN: r90964
2004-11-20 13:15:17 +00:00
Paul Brook edca1aa6ec Really regenerate Makefile.in.
From-SVN: r90950
2004-11-20 01:57:41 +00:00
Steven G. Kargl d8fe26b2cd check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.

	* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
	gfc_check_unlink,gfc_check_unlink_sub): New functions
	* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
	* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
	exit to intrinsics symbol tables.
	* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
	gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
	gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
	gfc_resolve_unlink_sub): Add and sort prototypes.
	* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
	gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
	* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols

libgfortran/
	* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
	* Makefile.in: Regenerated
	* intrinsics/umask.c: New file
	* intrinsics/unlink.c: ditto
	* intrinsics/exit.c: ditto

From-SVN: r90949
2004-11-20 01:44:49 +00:00
Victor Leikehman 410d3bbaa2 Modified Files:
ChangeLog generated/matmul_c4.c generated/matmul_c8.c
	generated/matmul_i4.c generated/matmul_i8.c
	generated/matmul_r4.c generated/matmul_r8.c m4/matmul.m4

2004-11-18  Victor Leikehman  <lei@il.ibm.com>

	* m4/matmul.m4: Loops reordered to improve cache behavior.
	* generated/matmul_??.c: Regenerated.

From-SVN: r90853
2004-11-18 08:45:11 +00:00
Paul Brook 9686c8110e Committed wrong version of previous patch.
From-SVN: r90384
2004-11-10 02:44:39 +00:00
Paul Brook 2cbcdebaf9 re PR fortran/18218 (Miscompare in sixtrack benchmark caused by loss of precision)
PR fortran/18218
	* configure.ac: Check for strtof.
	* configure: Regenerate.
	* config.h.in: Regenerate.
	* io/read.c (convert_real): Use strtof if available.
	(convert_precision_real): Remove.
	(read_f): Avoid poor exponentiation algorithm.
gcc/testsuite/
	* gfortran.dg/list_read.c: New test.

From-SVN: r90382
2004-11-10 02:19:27 +00:00
Andreas Schwab c7a35fe9f3 configure.ac: Use AC_PROG_FC, FC and FCFLAGS instead of AC_PROG_F77, F77 and FFLAGS.
* configure.ac: Use AC_PROG_FC, FC and FCFLAGS instead of
	AC_PROG_F77, F77 and FFLAGS.
	* Makefile.am (selected_int_kind.inc, selected_real_kind.inc): Use
	FCCOMPILE instead of F77COMPILE.
	* configure, Makefile.in: Regenerate.

From-SVN: r90122
2004-11-05 12:50:53 +00:00
Kelley Cook d49ec2d1a8 acinclude.m4: Properly quote AC_CACHE_CHECK.
2004-11-05  Kelley Cook  <kcook@gcc.gnu.org>

	* acinclude.m4: Properly quote AC_CACHE_CHECK.
	* Makefile.am: Add in ACLOCAL_AMFLAGS.
	* aclocal.m4, configure, Makefile.in: Regenerate.

From-SVN: r90114
2004-11-05 03:49:25 +00:00
Aaron W. LaFramboise 41724e6a13 config.h.in: Regenerate.
2004-10-30  Aaron W. LaFramboise <aaronavay62@aaronwl.com>

	* config.h.in: Regenerate.
	* configure: Regenerate.
	* configure.ac (AC_CHECK_FUNCS): Add mkstemp.
	* io/unix.c (S_IRGRP): Define if undefined.
	(S_IWGRP): Same.
	(S_IROTH): Same.
	(S_IWOTH): Same.
	(tempfile): Use mktemp if mkstemp missing, fix typos.

From-SVN: r89893
2004-10-30 16:23:23 +00:00
Aaron W. LaFramboise 47289a4e33 Missing bit of previous patch.
2004-09-15  Aaron W. LaFramboise <aaronavay62@aaronwl.com>
	* unix.c: Include stdio.h.

From-SVN: r89892
2004-10-30 15:15:27 +00:00
Aaron W. LaFramboise 8cfe17f951 system.c ("libgfortran.h"): Move after system headers.
2004-10-30  Aaron W. LaFramboise <aaronavay62@aaronwl.com>

	*  intrinsics/system.c ("libgfortran.h"): Move after system headers.

From-SVN: r89891
2004-10-30 15:04:20 +00:00
Canqun Yang 7a003d8e2e check.c (gfc_check_rand): Allow missing optional argument.
2004-10-30  Canqun Yang  <canqun@nudt.edu.cn>

	* check.c (gfc_check_rand): Allow missing optional argument.
	(gfc_check_irand): Ditto.
	* intrinsic.c (add_functions): Set arg optional flag for {i,}rand.
libgfortran/
	* intrinsics/rand.c (irand): Handle NULL argument.

From-SVN: r89886
2004-10-30 14:18:34 +00:00
Paul Brook 5615e8cdce transfer.c (finalize_transfer): Free internal streams.
* io/transfer.c (finalize_transfer): Free internal streams.
	* io/unix.c (mem_close): Free stream object.

From-SVN: r88709
2004-10-07 21:30:50 +00:00
Paul Brook 82e7998648 string_intrinsics.c (string_verify): Fix off by one error.
* intrinsics/string_intrinsics.c (string_verify): Fix off by one
	error.
testsuite/
	* gfortran.dg/intrinsic_verify_1.f90: New test.

From-SVN: r88704
2004-10-07 20:19:32 +00:00
Paul Brook 7726f633fa re PR libfortran/17709 (NULL I/O list and Format error.)
PR libfortran/17709
	* io/transfer.c (data_transfer_init): Reset sf_seen_eor.
testsuite/
	* gfortran.dg/empty_format_1.f90: New test.

From-SVN: r88615
2004-10-06 18:27:58 +00:00
Andrew Pinski 1ee3acfb08 mvbits.c: Commit the file.
2004-10-04  Andrew Pinski  <pinskia@physics.uc.edu>

        * intrinsics/mvbits.c: Commit the file.

From-SVN: r88541
2004-10-04 19:31:10 -07:00
Tobias Schlüter 5b1374e965 re PR fortran/17776 (no subroutine system)
fortran/
PR fortran/17776
* check.c (gfc_check_system_sub): New function.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SYSTEM.
* intrinsic.c (add_functions): Add 'system'.
(add_subroutines): Add 'system'.
* intrinsic.h (gfc_check_etime_sub, gfc_check_getcwd_sub):
Move prototypes to other suborutines.
(gfc_check_system_sub, gfc_resolve_system, gfc_resolve_system_sub):
Add prototype.
(gfc_resolve_system_clock): Fix formatting of prototype.
* iresolve.c (gfc_resolve_system, gfc_resolve_system_sub): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Deal with
GFC_ISYM_SYSTEM.

libgfortran/
PR fortran/17776
* intrinsics/system.c: New file.
* Makefile.am: Add dependency for the new file.
* Makefile.in: Regenerate.

From-SVN: r88532
2004-10-04 23:30:32 +02:00
Tobias Schlüter ee569894e7 re PR libfortran/17631 (libfortran: intrinsic subroutine MVBITS not implemented)
PR fortran/17631
fortran/
* intrinsic.c (add_sym_5): Remove.
(add_subroutines): Add resolution function for MVBITS.
* intrinsic.h (gfc_resolve_mvbits): Declare resolution function for
MVBITS
* iresolve.c (gfc_resolve_mvbits): New function.
(gfc_resolve_random_number): Remove empty line at end of function.
libgfortran/
* Makefile.am (gfor_helper_src): Add intrinsics/mvbits.h.
* intrinsics/mvbits.h: New file.
testsuite/
* gfortran.fortran-torture/execute/intrinsic_mvbits.f90: New test.

From-SVN: r88527
2004-10-04 22:49:39 +02:00
Tobias Schlüter 58c5b409e8 re PR fortran/17283 (UNPACK issues)
PR fortran/17283
fortran/
* iresolve.c (gfc_resolve_pack): Choose function depending if mask is
scalar.
libgfortran/
* intrinsics/pack_generic.c (__pack): Allocate memory for return array
if not done by caller.
(__pack_s): New function.
* runtime/memory.c (internal_malloc, internal_malloc64): Allow
allocating zero memory.
testsuite/
* gfortran.fortran-torture/execute/intrinsic_pack.f90: Add more tests.

From-SVN: r88526
2004-10-04 21:27:29 +02:00
Paul Brook 06e4f02a16 re PR libfortran/17706 (reading a value of 0.0 gives a value of -0.0)
2004-10-04  Paul Brook  <paul@codesourcery.com>
	Bud Davis  <bdavis9659@comcast.net>

	PR fortran/17706
	PR fortran/16434
	* io/format.c (parse_format_list): Set repeat count for S, SP, SS,
	BN and BZ formats.
	* io/write.c (output_float): Don't output minus zero.
libgfortran/
	* gfortran/pr17706.f90: New test.
	* gfortran.dg/g77/f77-edit-s-out.f: Remove xfail.

Actually apply the patch this time.

From-SVN: r88513
2004-10-04 15:33:18 +00:00
Paul Brook f3e4170112 re PR libfortran/17706 (reading a value of 0.0 gives a value of -0.0)
2004-10-04  Paul Brook  <paul@codesourcery.com>
	Bud Davis  <bdavis9659@comcast.net>

	PR fortran/17706
	PR fortran/16434
	* io/format.c (parse_format_list): Set repeat count for S, SP, SS,
	BN and BZ formats.
	* io/write.c (output_float): Don't output minus zero.
libgfortran/
	* gfortran/pr17706.f90: New test.
	* gfortran.dg/g77/f77-edit-s-out.f: Remove xfail.

Co-Authored-By: Bud Davis <bdavis9659@comcast.net>

From-SVN: r88512
2004-10-04 15:32:13 +00:00
Aaron W. LaFramboise 830219eec1 abort.c ("libgfortran.h"): Move.
2004-10-03  Aaron W. LaFramboise <aaronavay62@aaronwl.com>

	* intrinsics/abort.c ("libgfortran.h"): Move.
	* intrinsics/date_and_time.c ("libgfortran.h"): Same.
	* intrinsics/write.c ("libgfortran.h"): Same.

From-SVN: r88444
2004-10-03 12:04:15 +00:00
Tobias Schlüter bf4d99cf13 re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libfortran/16137
* config.h.in (HAVE_POWF): Undefine.
* configure.ac: Check for 'powf' in library.
* configure: Regenerate.
* intrinsics/c99_functions.c (powf): New function.

From-SVN: r88128
2004-09-26 16:52:04 +02:00
Tobias Schlüter 487c67b637 * intrinsics/etime.c (etime_): New function.
From-SVN: r88052
2004-09-24 18:49:10 +02:00
Steven G. Kargl c6847e25b9 libgfortran.h: define gfc_alloca()
2004-09-21  Steven G. Kargl  <kargls@comcast.net>

* libgfortran.h: define gfc_alloca()
* intrinsics/env.c (getenv, get_environment_variable_i4): Use it.

From-SVN: r87801
2004-09-21 14:38:34 +02:00
Bud Davis 77747e5f2d re PR libfortran/17286 (namelist containing more than one value cannot contain whitespace or newlines for READ)
2004-09-21  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/17286
        * io/list_read.c (namelist_read): ignore spaces after
        the '=' for namelist reads.

2004-09-21  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/17286
        * gfortran.dg/pr17286.f90: New test.

From-SVN: r87799
2004-09-21 11:22:47 +00:00
Aaron W. LaFramboise f596fc98ea config.h.in: Regenerate.
2004-09-15  Aaron W. LaFramboise <aaronavay62@aaronwl.com>

	* config.h.in: Regenerate.
	* configure: Regenerate.
	* configure.ac (AC_CHECK_HEADERS): Check for sys/mman.h.
	* unix.c: Include stdio.h.
	(HAVE_SYS_MMAN_H): Check.
	(PROT_READ, PROT_WRITE): Provide default definitions.

From-SVN: r87714
2004-09-18 23:55:22 +00:00
Steven G. Kargl 0110c1ec15 check.c (gfc_check_getcwd_sub): New function.
2004-09-15  Steven G. Kargl  <kargls@comcast.net>

	* check.c (gfc_check_getcwd_sub): New function.
	* gfortran.h (GFC_ISYM_GETCWD): New symbol.
	* intrinsic.c (add_functions): Add function definition;
	Use symbol.
	* intrinsic.c (add_subroutines): Add subroutine definitions.
	* intrinsic.h: Add prototypes.
	* iresolve.c (gfc_resolve_getcwd, gfc_resolve_getcwd_sub):
	New functions.
	* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbol.
libgfortran/
	* intrincics/getcwd.c: New file.
	* Makefile.am: Add getcwd.c.
	* Makefile.in: Regenerated.

From-SVN: r87555
2004-09-15 14:17:26 +00:00
Steven G. Kargl a8c60d7fff check.c (gfc_check_getcwd_sub): New function.
2004-09-15  Steven G. Kargl  <kargls@comcast.net>

	* check.c (gfc_check_getcwd_sub): New function.
	* gfortran.h (GFC_ISYM_GETCWD): New symbol.
	* intrinsic.c (add_functions): Add function definition;
	Use symbol.
	* intrinsic.c (add_subroutines): Add subroutine definitions.
	* intrinsic.h: Add prototypes.
	* iresolve.c (gfc_resolve_getcwd, gfc_resolve_getcwd_sub):
	New functions.
	* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbol.
libgfortran/
	* intrinsics/getcwd.c: New file.
	* Makefile.am: Add getcwd.c.
	* Makefile.in: Regenerated.

From-SVN: r87552
2004-09-15 14:09:17 +00:00
Paul Brook a8ea34ebed Fix typo.
From-SVN: r87548
2004-09-15 13:02:08 +00:00
Steven G. Kargl 3869a92c04 env.c (getenv, [...]): Remove trailing white space.
2004-09-15  Steven G. Kargl  <kargls@comcast.net>
	Paul Brook  <paul@codesourcery.com>

	* intrinsics/env.c (getenv, get_environmental_variable): Remove
	trailing white space.  Uase alloca.  Honour trim_name.

Co-Authored-By: Paul Brook <paul@codesourcery.com>

From-SVN: r87547
2004-09-15 12:59:22 +00:00
Bud Davis c72477d6a6 re PR libfortran/17090 (Runtime I/O error)
2004-09-13  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/17090

        * io/list_read.c (list_formatted_read): Handle trailing spaces
        at end of line.


2004-09-13  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/17090
        * gfortran.dg/pr17090.f90: New test.

From-SVN: r87474
2004-09-14 00:56:46 +00:00
Paul Brook 8a57cd3d5e Put ChangeLog entry in the right place.
From-SVN: r87120
2004-09-06 16:58:16 +00:00
Paul Brook 2cada022f1 [multiple changes]
2004-09-06  Steven G. Kargl  <kargls@comcast.net>

	* io/write.c (output_float): Typo in comment.  Remove debugging
	printf.  Fix format for FP of form 1e10.

2004-09-06  Paul Brook  <paul@codesourcery.com>

	* gfortran.dg/edit_real_1.f90: Add new test.

From-SVN: r87119
2004-09-06 16:33:52 +00:00
Richard Henderson 803a6ff52c cshift0.c (DEF_COPY_LOOP, [...]): New.
* intrinsics/cshift0.c (DEF_COPY_LOOP, copy_loop_int, copy_loop_long,
        copy_loop_double, copy_loop_ldouble): New.
        (__cshift0): Make shift type ssize_t.  Use % operator instead of
        div.  Use specialized versions of copy loop depending on the shape.

From-SVN: r87045
2004-09-03 12:03:43 -07:00
Paul Brook d809264e86 format.c (parse_format_list): Set repeat count for P descriptors.
* io/format.c (parse_format_list): Set repeat count for P descriptors.
	* write.c (output_float): Fix condition.  Correctly handle nonzero
	scale factor.
testsuite/
	* gfortran.dg/edit_real_1.f90: Add new tests.

From-SVN: r86952
2004-09-02 01:33:01 +00:00
Eric Botcazou 130abd1728 mk-sik-inc.sh: Use a temporary string instead of 'echo -n'.
* mk-sik-inc.sh: Use a temporary string instead of 'echo -n'.
	* mk-srk-inc.sh: Likewise.

From-SVN: r86919
2004-09-01 17:51:42 +00:00
Paul Brook 244fada7d0 error.c (generate_error): Set both iostat and library_return.
* runtime/error.c (generate_error): Set both iostat and
	library_return.
testsuite/
	* gfortran.dg/eof_2.f90: New test.

From-SVN: r86852
2004-08-31 23:43:21 +00:00
Paul Brook 334ff453ea re PR libfortran/16805 (Runtime failure using list directed read from string)
PR libfortran/16805
	* io/list_read.c (next_char): Don't signal EOF for internal files.
	* io/unix.c (mem_alloc_r_at): Don't return NULL for incomplete reads.
testsuite/
2004-08-31  Bud Davis  <bdavis9659@comcast.net>

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

From-SVN: r86844
2004-08-31 20:37:43 +00:00
Tobias Schlüter 43b4305759 unit.c: Separate copyright years by ','.
* io/unit.c: Separate copyright years by ','.
(compare, insert_unit, delete_unit, is_internal_unit, close_units):
Remove blank line in beginning of function.
(get_unit): Simplify code.

From-SVN: r86841
2004-08-31 21:49:33 +02:00
Paul Brook 8a210b0fb0 * io/unit.c (get_unit): Remove superfluous if.
From-SVN: r86838
2004-08-31 18:59:42 +00:00
Paul Brook bd72d66cb5 transfer.c (read_sf): Rename uinty to readlen.
* io/transfer.c (read_sf): Rename uinty to readlen.  Detect EOF.
	(finalize_transfer): Move setjmp after namlist IO.
	* io/unix.c (mem_alloc_r_at): Calculate remaining length correctly.
testsuite/
	* gfortran.dg/eof_1.f90: New test.

From-SVN: r86831
2004-08-31 15:53:31 +00:00
Paul Brook c789f36b21 list_read.c (eat_separator): Set at_eo when a '/' is seen.
* list_read.c (eat_separator): Set at_eo when a '/' is seen.
testsuite/
	* gfortran.dg/list_read_1.f90: New file.

From-SVN: r86830
2004-08-31 14:56:09 +00:00
Tobias Schlüter d7177ab25e trans-decl.c, [...]: Replace all occurences of 'gfc_strlen_type_node' by 'gfc_charlen_type_node'.
fortran/
* trans-decl.c, trans-expr.c, trans-io.c, trans-types.c: Replace
all occurences of 'gfc_strlen_type_node' by
'gfc_charlen_type_node'.
* trans-types.h: Same. Also update comment accordingly.

libgfortran/
* libgfortran.h: Replace 'gfc_strlen_type' by
'gfc_charlen_type'. Update comment accordingly.
* intrinsics/args.c, intrinsics/env.c, io/io.h, io/transfer.c:
Replace all occurences of 'gfc_strlen_type' by 'gfc_charlen_type'.

From-SVN: r86828
2004-08-31 16:06:48 +02:00
Paul Brook da17f5599e trans-types.h: Add comments.
* trans-types.h: Add comments.
	(intmax_type_node, string_type_node, const_string_type_node): Remove.
libgfortran/
	* libgfortran.h: Add comments.

From-SVN: r86810
2004-08-30 23:28:56 +00:00
Richard Henderson 625be28635 Makefile.am (gfor_helper_src): Split selected_kind.f90.
* Makefile.am (gfor_helper_src): Split selected_kind.f90.
        (gfor_built_src): Add selected_int_kind.inc selected_real_kind.inc.
        (selected_int_kind.inc selected_real_kind.inc): New rules.
        * Makefile.in: Regenerate.
        * mk-sik-inc.sh, mk-srk-inc.sh: New files.
        * intrinsics/selected_int_kind.f90: Split from selected_kind.f90,
        include table of detected kinds.
        * intrinsics/selected_real_kind.f90: Similarly.

From-SVN: r86801
2004-08-30 14:34:37 -07:00
Steven G. Kargl 048c989961 bessel.c: New file.
2004-08-29  Steven G. Kargl  <kargls@comcast.net>
	Paul Brook  <paul@codesourcery.com>

	* intrinsics/bessel.c: New file.
	* intrinsics/erf.c: New file.
	* Makefie.am: Add intrinsics/bessel.c and intrinsics/erf.c.
	* configure.ac: Test for C99 Bessel and Error functions.
	* Makefile.in: Regenerate.
	* config.h.in: Regenerate.
	* configure: Regenerate.

From-SVN: r86728
2004-08-29 16:31:16 +00:00
Steven G. Kargl e8525382d9 check.c (gfc_check_besn, [...]): New functions.
2004-08-29  Steven G. Kargl  <kargls@comcast.net>
	Paul Brook  <paul@codesourcery.com>

	* check.c (gfc_check_besn, gfc_check_g77_math1): New functions.
	* f95-lang.c (DO_DEFINE_MATH_BUILTIN): Define.
	(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
	(build_builtin_fntypes): New function.
	(gfc_init_builtin_functions): Use it.
	* gfortran.h (enum gfc_generic_isym_id): Add GFC_ISYM_{J,Y}{0,1,N}
	and GFC_ISYM_ERF{,C}.
	(gfc_c_int_kind): Declare.
	* intrinsic.c (add_functions): Add [d]bes* and [d]erf*.
	* intrinsic.h (gfc_check_besn, gfc_check_g77_math1, gfc_resolve_besn,
	gfc_resolve_g77_math1): Add prototypes.
	* resolve.c (gfc_resolve_besn, gfc_resolve_g77_math1): New functions.
	* mathbuiltins.def: Add comment.  Change third argument.  Use
	DEFINE_MATH_BUILTIN_C.  Add bessel and error functions.
	* trans-intrinsic.c (BUILT_IN_FUNCTION): Define.
	(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
	* trans-types.c (gfc_c_int_kind): Declare.
	(gfc_init_kinds): Set it.
testsuite/
	* gfortran.dg/g77/README: Update.
	* gfortran.dg/g77/erfc.f: Copy from g77.f-torture.
	* gfortran.dg/g77/intrinsic-unix-bessel.f: Ditto.
	* gfortran.dg/g77/intrinsic-unix-erf.f: Ditto.
libgfortran/
	* intrinsics/bessel.c: New file.
	* intrinsics/erf.c: New file.
	* Makefie.am: Add intrinsics/bessel.c and intrinsics/erf.c.
	* configure.ac: Test for C99 Bessel and Error functions.
	* Makefile.in: Regenerate.
	* config.h.in: Regenerate.
	* configure: Regenerate.

Co-Authored-By: Paul Brook <paul@codesourcery.com>

From-SVN: r86727
2004-08-29 15:58:16 +00:00
Steven G. Kargl 4c0c6b9f2c gfortran.h (enum gfc_generic_isym_id): Add GFC_ISYM_GET?ID.
2004-08-29  Steven G. Kargl  <kargls@comcast.net>
	Paul Brook  <paul@codesourcery.com>

	* gfortran.h (enum gfc_generic_isym_id): Add GFC_ISYM_GET?ID.
	(gfc_check_f, gfc_simplify_f): Add f0.
	* intrinsic.c (do_check): Call f0.  Flatten.
	(add_sym_0): Fix prototype.  Set f0.
	(add_functions): Add getgid, getgid and getuid.
	(resolve_intrinsic): Remove obsolete comment.
	(do_simplify): Call f0.
	* intrinsic.h (gfc_resolve_getgid, gfc_resolve_getpid,
	gfc_resolve_getuid): Add prototypes.
	* iresolve.c (gfc_resolve_getgid, gfc_resolve_getpid,
	gfc_resolve_getuid): New functions.
	* trans-intrinsic.c (gfc_conv_intrinsic_function): Handle
	GFC_ISYM_GET?ID.
libgfortran/
	* Makefile.am: Add intrinsics/getXid.c.
	* configure.ac: Add tests for get{g,p,u}id.
	* config.h.in: Regenerate.
	* Makefile.in: Regenerate.
	* configure: Regenerate.

Co-Authored-By: Paul Brook <paul@codesourcery.com>

From-SVN: r86703
2004-08-28 23:43:41 +00:00
Paul Brook 7984a2f04b re PR libfortran/17195 (Infinite loop in output_float in libgfortran/io/write.c)
PR libfortran/17195
	* libgfortran.h (rtoa): Remove prototype.
	* runtime/error.c (rtoa): Remove.
	* io/write.c (calculate_G_format): Don't add blanks if E format is
	used.  Add correct number of blanks when exponent width is specified.
	(output_float): Rewrite.
testsuite/
	* gfortran.dg/edit_real_1.f90: New test.

From-SVN: r86701
2004-08-28 19:48:02 +00:00
Paul Brook e041cc5aff Comment typo.
From-SVN: r86660
2004-08-27 14:37:13 +00:00
Paul Brook c100eff11e rewind.c (st_rewind): Reset unit to read mode.
* io/rewind.c (st_rewind): Reset unit to read mode.
testsuite/
	* gfortran.dg/rewind_1.f90: New test.

From-SVN: r86659
2004-08-27 13:44:52 +00:00
Bud Davis 55948b693e re PR libfortran/16597 (gfortran: bug in unformatted I/O on scratch files)
2004-08-27  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/16597
        * io/io.h: created typedef for unit_mode.
        * io/io.h (gfc_unit): added mode to unit structure.
        * io/transfer.c (data_transfer_init): flush if a write then
        read is done on a unit (direct access files).
        * io/rewind.c (st_rewind): Used unit mode instead of global.

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

From-SVN: r86654
2004-08-27 07:59:30 +00:00
Tobias Schlüter 20edd06b2f io.h, [...]: Fix formatting issues, update copyright years.
* io/io.h, io/list_read.c, io/open.c, io/transfer.c, io/write.c:
Fix formatting issues, update copyright years.
(Add Previously missing ChangeLog entry)

From-SVN: r86621
2004-08-26 15:25:16 +02:00
Bud Davis 5352bda03e re PR libfortran/17143 (2**63 prints garbage)
2004-08-24  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/17143
        * runtime/error.c (itoa): keep from overflowing during
        mod operation by using unsigned variable.

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

From-SVN: r86532
2004-08-25 00:31:33 +00:00
Bud Davis 02d735f6bd re PR libfortran/17164 (index function not working properly)
2004-08-24  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/17164
        * runtime/string_intrinsics.c (string_index):check for
        substring longer than string.
        * gfortran.dg/pr17164.f90: New test.

From-SVN: r86527
2004-08-25 00:14:07 +00:00
David Edelsohn 6fd7cc5419 Makefile.am (libgfortran_la_LDFLAGS): Add -lm.
* Makefile.am (libgfortran_la_LDFLAGS): Add -lm.
	* Makefile.in: Rebuilt.

From-SVN: r86486
2004-08-24 11:20:52 -04:00
R. Kelley Cook 2709e6af02 ignore autom4te.cache
From-SVN: r86446
2004-08-23 23:51:56 +00:00
Tobias Schlüter 7fcb18047a io.h, [...]: Fix formatting issues, update copyright years.
* io/io.h, io/list_read.c, io/open.c, io/transfer.c, io/write.c:
Fix formatting issues, update copyright years.

From-SVN: r86425
2004-08-23 16:28:31 +02:00
Paul Brook 22e4cb8c23 Fix typo.
From-SVN: r86363
2004-08-21 13:23:13 +00:00
Bud Davis 0fa1b65cad re PR libfortran/16908 (Segfault in libgfortran/io/transfer.c)
2004-08-21  Bud Davis  <bdavis9659@comcast.net>

	PR 16908
	* io/transfer.c (next_record_w): Do not blank pad.
	* io/transfer.c (next_record): Take into account partial records.
testsuite/
	* gfortran.dg/direct_io.f90: New test.

From-SVN: r86361
2004-08-21 11:20:29 +00:00
Victor Leikehman 3bc268e64b re PR fortran/13278 (derived type namelist I/O support missing, causes ICE)
2004-08-18  Victor Leikehman  <lei@il.ibm.com>

	PR fortran/13278
	* trans-io.c (transfer_namelist_element): New. Recursively handle
	derived-type variables.  Pass string lengths.
	(build_dt): Code moved to build_namelist, with some
	changes and additions.
	(gfc_build_io_library_fndecls): Declare the fifth
	argument in st_set_nml_var_char -- string_length.
libgfortran/
	* io/transfer.c (st_set_nml_var)
	* io/write.c (namelist_write): Allow var_name and var_name_len to be
	null. For strings, use string_length field instead of len.
	* io/io.h (struct namelist_type): New field string_length.
	(st_set_nml_var_char): New argument string_length.

From-SVN: r86166
2004-08-18 01:20:06 +00:00
Bud Davis 4fe6e46bcd Corrected typo in PR number, previous commit
From-SVN: r85969
2004-08-13 22:25:06 +00:00
Bud Davis 1ef02b9de5 re PR libfortran/16935 (Segmentation fault of compiler with unsupported control items in OPEN)
2004-08-13  Bud Davis  <bdavis9659@comcast.net>

        PR gfortran/13965
        * gfortran.fortran-torture/execute/open_rewind.f90: New test.
        * io/open.c (st_open): use flags instead of the unit structure.

From-SVN: r85966
2004-08-13 22:01:02 +00:00
Victor Leikehman a57bb5f6a5 list_read.c (namelist_read): Convert variable names to lower case, so that mixed-case names are recognized.
2004-08-10  Victor Leikehman  <lei@il.ibm.com>

	* io/list_read.c (namelist_read): Convert variable names
	to lower case, so that mixed-case names are recognized.
	Don't read beyond terminating slash.

From-SVN: r85751
2004-08-10 13:34:04 +00:00
Roger Sayle 067a5735c5 c99_functions.c (nextafterf): New implementation that works correctly with denormalized numbers.
* intrinsics/c99_functions.c (nextafterf): New implementation that
	works correctly with denormalized numbers.

From-SVN: r85724
2004-08-09 21:09:41 +00:00
Victor Leikehman 883c9d4d12 matmul.m4, [...]: Allocate space if return value has NULL in its data field.
2004-09-09  Victor Leikehman  <lei@il.ibm.com>

	* m4/matmul.m4, m4/matmull.m4, intrinsics/eoshift0.c,
	intrinsics/eoshift2.c, intrinsics/transpose_generic.c:
	Allocate space if return value has NULL in its data field.
	* generated/*.c: Regenerate.

From-SVN: r85717
2004-08-09 14:34:39 +00:00
Janne Blomqvist aa6fc63508 intrinsic.c (add_subroutines): Add getenv and get_environment_variable.
2004-08-06  Janne Blomqvist  <jblomqvi@cc.hut.fi>

	* intrinsic.c (add_subroutines): Add getenv and
	get_environment_variable. (add_sym_5s): New function.
	* intrinsic.h (gfc_resolve_get_environment_variable): Add
	prototype.
	* iresolve.c (gfc_resolve_get_environment_variable): New
	function.
libgfortran/
	* intrinsics/env.c: New file.
	* Makefile.am: Add env.c to build.
	* Makefile.in: Regenerate.
testsuite/
	* gfortran.dg/getenv_1.f90: New test.

From-SVN: r85656
2004-08-06 21:47:03 +00:00
Victor Leikehman 943bf8b513 Commit for Victor Leikehman <lei@il.ibm.com>
PR libgfortran/16704
	* io/read.c (read_radix): Understand letters f and F as hex digits.

From-SVN: r85596
2004-08-05 08:37:42 +00:00
Victor Leikehman 6c167c45b1 * libgfortran.h (array_t, size0) New declarations.
* m4/ifunction.m4, m4/transpose.m4, intrinsics/cshift0.c: Allocate
	space if return value descriptor has NULL in its data field,
	and initialize bounds and stride.
	* intrinsics/size.c (array_t, size0): Declarations moved to
	libgfortran.h.
	* generated/*.c: Regenerate.

From-SVN: r85558
2004-08-04 14:30:46 +00:00
Roger Sayle 453310d80b re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
	* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
	copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
	scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
	* config.h.in: Regenerate.
	* configure: Regenerate.

	* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
	copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
	nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
	implementations for targets that don't support C99 float functions.

From-SVN: r85473
2004-08-03 13:28:26 +00:00
Roger Sayle 023d776a11 write.c (write_float): Use the slightly more portable isnan in preference to isinf.
* io/write.c (write_float): Use the slightly more portable isnan
	in preference to isinf.

From-SVN: r85407
2004-08-01 13:40:52 +00:00
Bud Davis 9cdc381b1a configure.ac: Add check for LFS support.
2004-07-18  Bud Davis  <bdavis9659@comcast.net>
	* configure.ac: Add check for LFS support.
	* configure: Regenerate

From-SVN: r84890
2004-07-18 12:46:39 +00:00
Paul Brook 1e38f15929 re PR fortran/16303 (Complex logarithm function sometimes chooses a non-principal branch)
PR fortran/16303
	* m4/cexp.m4 (carg): Return -pi to pi.
	* generated/exp_c?.c: Regenerate.

From-SVN: r84516
2004-07-11 16:05:08 +00:00
Andreas Krebbel dbe81a8b25 re PR libfortran/16291 (F2003 formatting of Inf /Nan on irix6.5)
PR fortran/16291
	* libgfortran/io/write.c: (write_float): Added length check.
	Remove pointless memset calls.

From-SVN: r84308
2004-07-08 19:58:56 +00:00
Bud Davis bf1df0a046 re PR libfortran/15472 (implicit open for unformatted file causes run-time error)
2004-07-04  Bud Davis  <bdavis9659@comcast.net>
            Paul Brook  <paul@codesourcery.com>

        PR fortran/15472
        * io/transfer.c(us_write): set recl for seq unform writes to max size.
        * io/transfer.c(data_transfer_init): handle un-opened seq unform unit.
        * io/unix.c(fd_alloc_w_at): handle requests at start, fd_flush at
          right time.
        * io/unix.c(is_seekable): set based upon the file/device, not the
          method being used to access it (fd or mmap).
        * io/unix.c(fd_flush): don't set file_size if !seekable.
        * io/unix.c(fd_truncate: ditto.
        * gfortran.fortran-torture/execute/seq_io.f90: New test.

Co-Authored-By: Paul Brook <paul@codesourcery.com>

From-SVN: r84104
2004-07-05 01:19:08 +00:00
Janne Blomqvist b41b25345b re PR libfortran/15280 (Fortran9x commandline not accessable)
PR fortran/15280
	PR fortran/15665
	* gfortran.h (enum gfc_generic_isym_id): Add GFC_ISYM_IARGC and
	GFC_ISYM_COMMAND_ARGUMENT_COUNT.
	* intrinsic.c (add_functions):  Identify iargc.  Add
	command_argument_count.
	(add_subroutines): Resolve getarg.  Add get_command and
	get_command_argument.
	* intrinsic.h (gfc_resolve_getarg, gfc_resolve_get_command,
	gfc_resolve_get_command_argument): Add prototypes.
	* iresolve.c (gfc_resolve_getarg, gfc_resolve_get_command,
	gfc_resolve_get_command_argument): New functions.
	* trans-decl.c (gfor_fndecl_iargc): New variable.
	(gfc_build_intrinsic_function_decls): Set it.
	* trans-intrinsic.c (gfc_conv_intrinsic_iargc): New function.
	(gfc_conv_intrinsic_function): Use it.
	* trans.h (gfor_fndecl_iargc): Declare.
libgfortran/
	* libgfortran.h (gfc_strlen_type): Define.
	* intrinsics/args.c (getarg): Rename ...
	(getarg_i4): ... to this.
	(getarg_i8, get_command_argument_i4, get_command_argument_i8,
	get_command_i4, get_command_i8): New functions.

Co-Authored-By: Paul Brook <paul@codesourcery.com>

From-SVN: r84087
2004-07-04 17:00:12 +00:00
Matthias Klose 1657a8095b libtool-version: New.
2004-07-04  Matthias Klose  <doko@debian.org>

        * libtool-version: New.
        * Makefile.am (libgfortran_la_LDFLAGS): Use -version-info for soname.
        * Makefile.in: Regenerate.
        * configure.ac: Remove libtool_VERSION macro
        * configure: Regenerate

From-SVN: r84074
2004-07-04 09:06:54 +00:00
Steve Kargl fd53dbe051 rand.c (rand): Wrap the irand() call from the previous commit in prefix.
* intrinsics/rand.c (rand): Wrap the irand() call from the previous
	commit in prefix.

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

From-SVN: r83895
2004-06-30 08:21:54 +00:00
Tobias Schlüter beabab5904 Paul Brook <paul@codesourcery.com>
2004-06-29  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
Paul Brook  <paul@codesourcery.com>

* runtime/normalize.c (normalize_r4_i4, normalize_r8_i8): Fix
comments.
* intrinsics/rand.c (rand): Call irand() in call to normalize_r4_i4.

Co-Authored-By: Paul Brook <paul@codesourcery.com>

From-SVN: r83880
2004-06-30 00:52:58 +02:00
Bud Davis 519b0e16cd re PR libfortran/12839 (incorrect IO of Inf)
2004-06-27  Bud Davis  <bdavis9659@comcast.net>

        PR gfortran/12839
        * io/write.c (write_float): check signbit for Infinity.

From-SVN: r83757
2004-06-28 01:30:26 +00:00
Bud Davis 3e14aaa2aa re PR libfortran/16196 (gfortran fails to create file with OPEN(...,status='REPLACE'))
2004-06-26  Bud Davis  <bdavis9659@comcast.net>

        PR gfortran/16196
        * unix.c(regular_file): create file if it does not exist.
        * gfortran.fortran-torture/execute/open_replace.f90: New test case.

From-SVN: r83709
2004-06-26 11:49:06 +00:00
Andrew Pinski d42093a1db darwin7.h (MATH_LIBRARY): Remove.
gcc/ChangeLog:
        * config/darwin7.h (MATH_LIBRARY): Remove.
        (LIB_SPEC): Define.
        * config/darwin.h (MATH_LIBRARY): Define always to empty.
        (LIB_SPEC): Only define if not already defined.

libstdc++/ChangeLog:
	* linkage.m4: Remove check for libmx.
	* configure: Regenerate.

libgfortran/ChangeLog:
	* configure.ac: Remove check for libmx.
	* configure: Regenerate.

From-SVN: r83603
2004-06-24 10:53:07 -07:00
Janne Blomqvist 8750f9cdec re PR fortran/15750 (IOLENGTH form of INQUIRE statement not implemented)
PR fortran/15750
	* io.c (gfc_match_inquire): Bugfix for iolength related stuff.
	(gfc_resolve_inquire): Resolve the iolength tag.  Return
	SUCCESS at end of function if no failure has occured.
	* resolve.c (resolve_code): Resolve if iolength is encountered.
	* trans-io.c: (ioparm_iolength, iocall_iolength,
	iocall_iolength_done): New variables.
	(last_dt): Add IOLENGTH.
	(gfc_build_io_library_fndecls ): Set iolength related variables.
	(gfc_trans_iolength): Implement.
	(gfc_trans_dt_end): Treat iolength as a third form of data transfer.
libgfortran/
	PR fortran/15750
	* inquire.c (st_inquire): Add comment
	* io.h (st_parameter): Add iolength.
	(st_iolength, st_iolength_done): Declare.
	* transfer.c (iolength_transfer, iolength_transfer_init,
	st_iolength, st_iolength_done): New functions.
testsuite/
	* gfortran.fortran-torture/execute/iolength_1.f90: New test.
	* gfortran.fortran-torture/execute/iolength_3.f90: New test.

From-SVN: r83472
2004-06-22 00:43:55 +00:00
Steven G. Kargl 0bf68c6eab etime.c (etime_sub): Remove array rank check; Add check for sufficient space.
* etime.c (etime_sub): Remove array rank check;
	Add check for sufficient space.

From-SVN: r83456
2004-06-21 22:25:12 +00:00