Commit Graph

48 Commits

Author SHA1 Message Date
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
Andreas Jaeger 96b8a6154e re PR libfortran/11800 ([gfortan] libgfortran should be multi-libed)
PR gfortran/11800
	* Makefile.am (AM_CPPFLAGS): Renamed from INCLUDES.
	(lib_LTLIBRARIES): Rename to ...
	(toolexeclib_LTLIBRARIES): this for multilib support.
	* configure.in: Rename to ...
	* configure.ac: this.  Update to modern autoconf style, enable
	multilibs, support --enable-version-specific-runtime-libs.
	* Makefile.in: Regenerated.
	* configure: Regenerated.
	* aclocal.m4: Regenerated.

From-SVN: r82466
2004-05-30 23:58:10 +02:00
Steven G. Kargl 5f251c2603 iresolve.c (gfc_resolve_random_number): Clean up conditional.
* iresolve.c (gfc_resolve_random_number): Clean up conditional.
libgfortran/
	* libgfortran.h (random_seed): Update prototype.
	* intrinsics/random.c: Disable old implementation and add new one.
testsuite/
	* gfortran.fortran-torture/execute/random_1.f90: New test.

From-SVN: r82443
2004-05-30 10:49:50 +00:00
Andreas Jaeger ebeb17c7bb random.c: Include unistd.h for close and read prototypes...
* intrinsics/random.c: Include unistd.h for close and read
	prototypes, remove unneeded inclusion of assert.h.

	* intrinsics/abort.c: Include stdlib.h for abort prototype, remove
	unneeded inclusion of assert.h.

From-SVN: r82442
2004-05-30 11:53:10 +02:00
Tobias Schlüter 08fb03fdf3 re PR libfortran/15234 (libgfortran doesn't compile on Tru64 UNIX V4.0F)
PR fortran/15234
* intrinsics/associated.c: Remove enum.
(associated): Replace TRUE/FALSE by 1/0.

From-SVN: r82322
2004-05-27 15:05:23 +02:00
Steven G. Kargl 322c24252e * random.c (random_seed): Use correct variable.
From-SVN: r82167
2004-05-23 16:18:22 +00:00
Steven G. Kargl 21fdfcc12c check.c (gfc_check_system_clock): New function.
* check.c (gfc_check_system_clock): New function.
	* intrinsic.c (add_sym_3s): New function.
	(add_subroutines): Use it.
	* intrinsic.h (gfc_check_system_clock, gfc_resolve_system_clock):
	Add prototypes.
	* iresolve.c (gfc_resolve_system_clock): New function.
libgfortran/
	* intrinsics/system_clock: New file.
	* Makefile.am: Add intrinsics/system_clock.c.
	* Makefile.in: Regenerate.

From-SVN: r82131
2004-05-22 12:47:42 +00:00
Roger Sayle 11670eebf3 io.c (check_format): As a GNU extension...
* io.c (check_format): As a GNU extension, allow the comma after a
	string literal to be optional in a format.  Use gfc_notify_std to
	issue an error/warning as appropriate.

	* io/format.c (parse_format_list): Allow the comma after a string
	literal to be optional.

From-SVN: r82109
2004-05-21 21:37:25 +00:00
Feng Wang 59fa6e39c6 Credit Feng Wang <fengwang@nudt.edu.cn> in ChangeLog.
From-SVN: r82023
2004-05-19 10:41:38 +00:00
Feng Wang 5b200ac2c7 f95-lang.c (gfc_init_builtin_functions): Use vold_list_node.
* f95-lang.c (gfc_init_builtin_functions): Use vold_list_node.
	Create decls for __builtin_pow{,f}.
	* gfortran.h (PREFIX_LEN): Define.
	* trans-decl.c (gfor_fndecl_math_powi): Add.
	(gfor_fndecl_math_powf, gfor_fndecl_math_pow): Remove.
	(gfc_build_intrinsic_function_decls): Create decls for powi.
	* trans-expr.c (powi_table): Add.
	(gfc_conv_integer_power): Remove.
	(gfc_conv_powi): New function.
	(gfc_conv_cst_int_power): New function.
	(gfc_conv_power_op): Use new powi routines.
	* trans.h (struct gfc_powdecl_list): Add.
	(gfor_fndecl_math_powi): Add.
	(gfor_fndecl_math_powf, gfor_fndecl_math_pow): Remove.
testsuite/
	* gfortran.fortran-torture/execute/power.f90: Test constant integers.
libgfortran/
	* Makefile.am (i_pow_c): Set it. Add build rule.
	(gfor_built_src): Use it.
	(m4_files): add m4/pow.m4.
	* Makefile.in: Regenerate.
	* m4/pow.m4: New file.
	* generated/pow_*.c: Regenerate.

From-SVN: r82014
2004-05-19 00:34:59 +00:00
Paul Brook c9e66eda1a Makefile.am: Remove references to types.m4.
* Makefile.am: Remove references to types.m4.
	* m4/iparm.m4: Merge with types.m4.
	* m4/types.m4: Remove.
	* 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/in_pack.m4, m4/in_unpack.m4, m4/iparm.m4, m4/matmul.m4,
	m4/matmull.m4, m4/maxloc0.m4, m4/maxloc1.m4, m4/maxval.m4,
	m4/minloc0.m4, m4/minloc1.m4, m4/minval.m4, m4/reshape.m4,
	m4/shape.m4, m4/specific.m4, m4/specific2.m4, m4/transpose.m4):
	Update to use new iparm.m4.
	* generated/*.c: Regenerate.

From-SVN: r82003
2004-05-18 19:03:26 +00:00
Tobias Schlüter 81f4be3ce1 re PR libfortran/15235 (libgfortran doesn't build on Solaris 10)
PR fortran/15235
* gfortran.h (offset_t): Rename to ...
(gfc_offset): ... this.
* io/backspace.c (formatted_backspace, unformatted_backspace),
io/io.h (stream, gfc_unit, global_t, file_length, file_position),
transfer.c (us_read, us_write, next_record_r, next_record_w),
io/unit.c (init_units), unix.c (unix_stream, fd_alloc,
fd_alloc_r_at, fd_alloc_w_at, fd_seek, mmap_alloc,
mmap_alloc_r_at, mmap_alloc_w_at, mmap_seek, mem_alloc_r_at,
mem_alloc_w_at, mem_seek, file_length, file_position): Replace all
occurences of offset_t by gfc_offset.

From-SVN: r81994
2004-05-18 18:06:09 +02:00
Kaz Kojima c779c42fc3 re PR bootstrap/15120 ([3.3 only] [libtool bug] hidden symbol `__sdivsi3_i4' is referenced by DSO)
PR bootstrap/15120
	* libtool.m4 (lt_cv_deplibs_check_method): Use pass_all on sh*.
	* */configure: Rebuilt.

From-SVN: r81980
2004-05-18 10:11:38 +00:00
Paul Brook 6d3e9d8454 * io/format.c (write_real): Don't include padding in format.
From-SVN: r81922
2004-05-16 20:17:04 +00:00
Paul Brook 28963c8f26 * io/format.c (format_lex): Make c an int.
From-SVN: r81920
2004-05-16 18:21:42 +00:00
Janne Blomqvist d464f8e99e write.c (write_logical): Don't print extra blank.
* io/write.c (write_logical): Don't print extra blank.
	(write_integer): Base field width on kind.
	(list_formatted_write): Output initial blank.

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

From-SVN: r81914
2004-05-16 14:07:58 +00:00
Janne Blomqvist 000aa32a49 io.h (flush): Add prototype.
* io/io.h (flush): Add prototype.
	* io/transfer.c (finalize_transfer): Flush partial records.
	* io/unix.c (flush): New function.

From-SVN: r81913
2004-05-16 13:27:48 +00:00
Tobias Schlüter 909087e0cf re PR libfortran/15234 (libgfortran doesn't compile on Tru64 UNIX V4.0F)
PR fortran/15234
* io/io.h (unit_t): Rename to ...
(gfc_unit) ... this.
(unit_root, current_unit, find_file, find_unit, get_unit): Now
of type gfc_unit.
(delete_file, insert_unit, close_unit): Argument now of type
gfc_unit.
* backspace.c (st_backspace), close.c (st_close), endfile.c
(st_endfile), inquire.c (inquire_via_unit, st_inquire), open.c
(test_endfile, edit_modes, new_unit, already_open, st_open),
rewind.c (st_rewind), transfer.c (current_unit), unit.c
(internal_unit, unit_cache, rotate_left, rotate_right, insert,
insert_unit, delete_root, delete_treap, delete_unit, find_unit,
get_unit, init_units, close_unit), unix.c (find_file0,
find_file, delete_file): Replace all occurences of unit_t by
gfc_unit.

From-SVN: r81903
2004-05-15 22:44:38 +02:00
Bud Davis 94161cec95 re PR libfortran/15311 (Incorrect handling of A edit descriptor)
PR fortran/15311
	* io/write.c (write_a): right justify A edit output.
libgfortran/
	* gfortran.fortran-torture/execute/write_a_1.f90: New test.

From-SVN: r81895
2004-05-15 18:35:39 +00:00
Bud Davis abdef81151 re PR libfortran/15149 (problem computing Pi)
PR fortran/15149
        * gfortran.fortran-torture/execute/random_init.f90: New test.
        * libgfortan.h,intrinsics/random.c: Made random_seed visible.
        * runtime/main.c(init): Call random_seed as part of MAIN init.

From-SVN: r81836
2004-05-14 12:21:22 +00:00
Tobias Schlüter 187f073476 format.c: (parse_format_list): No comma is required after P descriptor.
* io/format.c: (parse_format_list): No comma is required after
	P descriptor.

From-SVN: r81819
2004-05-13 23:36:16 +00:00
Andrew Pinski 0e7b565cbf Fix format in (and bug number):
2004-05-13  Bud Davis  <bdavis9659@comcast.net>

        PR fortran/15204
        * io/intrinsic/string_intrinsics.c (adjustr): rework logic.

From-SVN: r81810
2004-05-13 15:41:37 -07:00
Bud Davis 92fbb7592b re PR libfortran/15204 (ADJUSTR intrinsic accesses corrupted pointer)
PR fortran/15294
        * gfortran.fortran-torture/execute/adjustr.f90: New file.
        * io/intrinsic/string_intrinsics.c(adjustr): rework logic.

From-SVN: r81771
2004-05-13 10:11:02 +00:00
Diego Novillo 6de9cd9a88 Merge tree-ssa-20020619-branch into mainline.
From-SVN: r81764
2004-05-13 02:41:07 -04:00