Commit Graph

73 Commits

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

From-SVN: r83456
2004-06-21 22:25:12 +00:00
Bud Davis bb9db7b136 re PR libfortran/16080 (segmentation fault when reading empty string)
2004-06-19  Bud Davis  <bdavis9659@comcast.net>

        PR gfortran/16080
        * io/list_read.c(set_value): fixed spelling.

From-SVN: r83389
2004-06-19 17:03:16 +00:00
Bud Davis 04b0faec08 re PR libfortran/16080 (segmentation fault when reading empty string)
2004-06-19  Bud Davis  <bdavis9659@comcast.net>

      PR gfortran/16080
      * gfortran.fortran-torture/execute/read_null_string.f90: New file.
      * io/list_read.c(set_value): don't copy if the string is null.

From-SVN: r83388
2004-06-19 16:42:05 +00:00
Bud Davis bc20e36d16 re PR libfortran/15292 (libgfortran depends on c99 functionality round and roundf)
2004-06-14  Bud Davis  <bdavis9659@comcast.net>

        PR gfortran/15292
        * intrinsics/c99_functions.c: Use fpclassify if it exists.

From-SVN: r83116
2004-06-14 17:27:20 +00:00
Paul Brook a9e7b9d395 Makefile.am (gfor_helper_src): Add runtime/normalize.f90.
* Makefile.am (gfor_helper_src): Add runtime/normalize.f90.
	* configure.ac: Add checks for nextafter and nextafterf.
	* Makefile.in, config.h.in, configure: Regenerate.
	* libgfortran.h (normalize_r4_i4, normalize_r8_i8): Declare.
	* intrinsics/rand.c (rand): Use normalize_r4_i4.
	* intrinsics/random.c (random_r4): Use normalize_r4_i4.
	(random_r8): Use normalize_r8_i8.
	* runtime/normalize.c: New file.
testsuite/
	* gfortran.fortran-torture/execute/random_2.f90: New test.

From-SVN: r83070
2004-06-13 22:58:30 +00:00
Steven G. Kargl cdaa9fc44c random.c: Fix several spelling and formatting mistakes in comments.
* random.c: Fix several spelling and formatting mistakes in
comments.
(random_r8): Fix loop to make random numbers range in [0,1(.

Co-Authored-By: Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>

From-SVN: r83063
2004-06-13 20:25:53 +02:00
Tobias Schlüter 9d409075cb random.c (random_r4): Burn a random number.
2004-06-13  Steven G. Kargl  <kargls@comcast.net>

* random.c (random_r4): Burn a random number.
(random_r8): fix infinite loop.

From-SVN: r83062
2004-06-13 19:48:23 +02:00
Bud Davis a2a2059fd7 re PR libfortran/15292 (libgfortran depends on c99 functionality round and roundf)
PR gfortran/15292
	* intrinsics/c99_functions.c: New file.
	* Makefile.am: Add new file.
	* configure.ac: Added test for round/roundf.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
        * configure.h.in: Regenerate.

From-SVN: r83036
2004-06-12 17:59:30 +00:00
Steven G. Kargl 2bd7494908 check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
	gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
	* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
	GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
	* trans-intrinsic.c:  Use symbols.
	* intrinsic.c (add_sym_2s): New function.
	* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
	* intrinsic.h: Function prototypes.
	* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
	gfc_resolve_srand):  New functions.
libgfortran
	* Makefile.am: Add rand.c and etime.c
	* Makefile.in: Regenerated.
	* aclocal.in: Regenerated.
	* cpu_time.c (second_sub, second): New functions.
	* rand.c (irand, rand, srand): New file.
	* etime.c (etime_sub, etime): New file.

From-SVN: r83034
2004-06-12 17:34:47 +00:00
Tobias Schlüter f814193b9d re PR libfortran/14923 (gfortran misses the DATE_AND_TIME intrinsic)
PR fortran/14923
	* intrinsics/date_and_time.c: New file.
	* Makefile.am (gfor_helper_src): Add intrinsics/date_and_time.c.
	* Makefile.in, aclocal.m4: Regenerate.
	* libgfortran.h: Prototype date_and_time().
testsuite/
	* gfortran.fortran-torture/execute/date_time_1.f90: New test.

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

From-SVN: r83032
2004-06-12 15:15:41 +00:00
Tobias Schlüter a13c75880a PR fortran/15665 Fixup ChangeLog from my previous commit
From-SVN: r83030
2004-06-12 16:50:49 +02:00
Tobias Schlüter c5dc831c5e PR fortran/15655Fixup ChangeLog entries from previous commit by Paul Brook
From-SVN: r83029
2004-06-12 16:09:43 +02:00
Bud Davis 4aef80f8e0 args.c: Implement GETARG and IARGC.
* intrinsics/args.c: Implement GETARG and IARGC.
	* Makefile.am: Add it.
	* Makefile.in: Regenerate.
testsuite/
	* gfortran.fortran-torture/execute/getarg_1.f90: New test.

From-SVN: r83027
2004-06-12 13:42:46 +00:00
Bud Davis 8204210bd6 re PR libfortran/12839 (incorrect IO of Inf)
2004-06-12  Bud Davis  <bdavis9659@comcast.net>

        PR gfortran/12839
        * gfortran.fortran-torture/execute/nan_inf_fmt.f90: New test.
        * io/write.c(write_float): format inf and nan IAW F2003.

From-SVN: r83024
2004-06-12 12:50:54 +00:00
Bud Davis 898c05b8bd re PR libfortran/14897 ('T' edit descriptor output incorrect)
2004-06-09  Bud Davis  <bdavis9659@comcast.net>

	PR gfortran/14897
	* gfortran.fortran-torture/execute/t_edit.f90

 	* io/transfer.c (formatted_transfer): position is unique
         for T and TL edit descriptors.
 	(data_transfer_init): set record length to size of internal
         file.

From-SVN: r82808
2004-06-09 01:03:02 +00:00
Bud Davis 31b6f11ab0 re PR libfortran/15755 (gfortran: backspace call causes bus error)
2004-06-08  Bud Davis  <bdavis9659@comcast.net>

	PR gfortran/15755
	* gfortran.fortran-torture/execute/backspace.c : New test.

	* io/backspace.c(st_backspace): call correct routine for
	formatted and un-formatted units.

From-SVN: r82806
2004-06-09 00:55:04 +00:00