Commit Graph

485 Commits

Author SHA1 Message Date
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