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
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
Steven G. Kargl
f177a08700
flush.c: New file.
...
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
From-SVN: r91611
2004-12-02 04:20:09 +00:00
Steven Bosscher
69d3c9a43e
re PR libfortran/15960 (missing function 'finite' on HP-UX 11.11)
...
PR libfortran/15960
* configure.ac: Check for finite in libm.
* libgfortran.h: Define isfinite macro if not defined.
* intrinsics/c99_functions.c: Use defined(fpclassify) instead of
HAVE_FPCLASSIFY.
* io/write.c (write_float): Use isfinite instead of finite.
* configure, config.h.in: Rebuilt.
From-SVN: r91064
2004-11-23 02:02:38 +00:00
Eric Botcazou
3969c39f61
re PR libfortran/16135 (libfortran doesn't build, use of C99 types)
...
PR target/16135
* acinclude.m4 (LIBGFOR_TARGET_ILP32): New check.
* configure.ac: Include LIBGFOR_TARGET_ILP32.
* configure: Regenerate.
* config.h.in: Likewise.
* libgfortran.h: Provide default definitions for C99 types
on ILP32 targets that don't have them.
PR target/17999
* configure.ac: Check for snprintf.
* configure: Regenerate.
* config.h.in: Likewise.
* intrinsics/date_and_time.c (date_and_time): Do not
use snprinf if it is not available.
* io/write.c (output_float): Likewise.
From-SVN: r90964
2004-11-20 13:15:17 +00:00
Steven G. Kargl
d8fe26b2cd
check.c (gfc_check_getcwd_sub): Fix seg fault.
...
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 01:44:49 +00:00
Aaron W. LaFramboise
8cfe17f951
system.c ("libgfortran.h"): Move after system headers.
...
2004-10-30 Aaron W. LaFramboise <aaronavay62@aaronwl.com>
* intrinsics/system.c ("libgfortran.h"): Move after system headers.
From-SVN: r89891
2004-10-30 15:04:20 +00:00
Canqun Yang
7a003d8e2e
check.c (gfc_check_rand): Allow missing optional argument.
...
2004-10-30 Canqun Yang <canqun@nudt.edu.cn>
* check.c (gfc_check_rand): Allow missing optional argument.
(gfc_check_irand): Ditto.
* intrinsic.c (add_functions): Set arg optional flag for {i,}rand.
libgfortran/
* intrinsics/rand.c (irand): Handle NULL argument.
From-SVN: r89886
2004-10-30 14:18:34 +00:00
Paul Brook
82e7998648
string_intrinsics.c (string_verify): Fix off by one error.
...
* intrinsics/string_intrinsics.c (string_verify): Fix off by one
error.
testsuite/
* gfortran.dg/intrinsic_verify_1.f90: New test.
From-SVN: r88704
2004-10-07 20:19:32 +00:00
Andrew Pinski
1ee3acfb08
mvbits.c: Commit the file.
...
2004-10-04 Andrew Pinski <pinskia@physics.uc.edu>
* intrinsics/mvbits.c: Commit the file.
From-SVN: r88541
2004-10-04 19:31:10 -07:00
Tobias Schlüter
5b1374e965
re PR fortran/17776 (no subroutine system)
...
fortran/
PR fortran/17776
* check.c (gfc_check_system_sub): New function.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SYSTEM.
* intrinsic.c (add_functions): Add 'system'.
(add_subroutines): Add 'system'.
* intrinsic.h (gfc_check_etime_sub, gfc_check_getcwd_sub):
Move prototypes to other suborutines.
(gfc_check_system_sub, gfc_resolve_system, gfc_resolve_system_sub):
Add prototype.
(gfc_resolve_system_clock): Fix formatting of prototype.
* iresolve.c (gfc_resolve_system, gfc_resolve_system_sub): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Deal with
GFC_ISYM_SYSTEM.
libgfortran/
PR fortran/17776
* intrinsics/system.c: New file.
* Makefile.am: Add dependency for the new file.
* Makefile.in: Regenerate.
From-SVN: r88532
2004-10-04 23:30:32 +02:00
Tobias Schlüter
58c5b409e8
re PR fortran/17283 (UNPACK issues)
...
PR fortran/17283
fortran/
* iresolve.c (gfc_resolve_pack): Choose function depending if mask is
scalar.
libgfortran/
* intrinsics/pack_generic.c (__pack): Allocate memory for return array
if not done by caller.
(__pack_s): New function.
* runtime/memory.c (internal_malloc, internal_malloc64): Allow
allocating zero memory.
testsuite/
* gfortran.fortran-torture/execute/intrinsic_pack.f90: Add more tests.
From-SVN: r88526
2004-10-04 21:27:29 +02:00
Aaron W. LaFramboise
830219eec1
abort.c ("libgfortran.h"): Move.
...
2004-10-03 Aaron W. LaFramboise <aaronavay62@aaronwl.com>
* intrinsics/abort.c ("libgfortran.h"): Move.
* intrinsics/date_and_time.c ("libgfortran.h"): Same.
* intrinsics/write.c ("libgfortran.h"): Same.
From-SVN: r88444
2004-10-03 12:04:15 +00:00
Tobias Schlüter
bf4d99cf13
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
...
PR libfortran/16137
* config.h.in (HAVE_POWF): Undefine.
* configure.ac: Check for 'powf' in library.
* configure: Regenerate.
* intrinsics/c99_functions.c (powf): New function.
From-SVN: r88128
2004-09-26 16:52:04 +02:00
Tobias Schlüter
487c67b637
* intrinsics/etime.c (etime_): New function.
...
From-SVN: r88052
2004-09-24 18:49:10 +02:00
Steven G. Kargl
c6847e25b9
libgfortran.h: define gfc_alloca()
...
2004-09-21 Steven G. Kargl <kargls@comcast.net>
* libgfortran.h: define gfc_alloca()
* intrinsics/env.c (getenv, get_environment_variable_i4): Use it.
From-SVN: r87801
2004-09-21 14:38:34 +02:00
Steven G. Kargl
a8c60d7fff
check.c (gfc_check_getcwd_sub): New function.
...
2004-09-15 Steven G. Kargl <kargls@comcast.net>
* check.c (gfc_check_getcwd_sub): New function.
* gfortran.h (GFC_ISYM_GETCWD): New symbol.
* intrinsic.c (add_functions): Add function definition;
Use symbol.
* intrinsic.c (add_subroutines): Add subroutine definitions.
* intrinsic.h: Add prototypes.
* iresolve.c (gfc_resolve_getcwd, gfc_resolve_getcwd_sub):
New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbol.
libgfortran/
* intrinsics/getcwd.c: New file.
* Makefile.am: Add getcwd.c.
* Makefile.in: Regenerated.
From-SVN: r87552
2004-09-15 14:09:17 +00:00
Steven G. Kargl
3869a92c04
env.c (getenv, [...]): Remove trailing white space.
...
2004-09-15 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
* intrinsics/env.c (getenv, get_environmental_variable): Remove
trailing white space. Uase alloca. Honour trim_name.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r87547
2004-09-15 12:59:22 +00:00
Richard Henderson
803a6ff52c
cshift0.c (DEF_COPY_LOOP, [...]): New.
...
* intrinsics/cshift0.c (DEF_COPY_LOOP, copy_loop_int, copy_loop_long,
copy_loop_double, copy_loop_ldouble): New.
(__cshift0): Make shift type ssize_t. Use % operator instead of
div. Use specialized versions of copy loop depending on the shape.
From-SVN: r87045
2004-09-03 12:03:43 -07:00
Tobias Schlüter
d7177ab25e
trans-decl.c, [...]: Replace all occurences of 'gfc_strlen_type_node' by 'gfc_charlen_type_node'.
...
fortran/
* trans-decl.c, trans-expr.c, trans-io.c, trans-types.c: Replace
all occurences of 'gfc_strlen_type_node' by
'gfc_charlen_type_node'.
* trans-types.h: Same. Also update comment accordingly.
libgfortran/
* libgfortran.h: Replace 'gfc_strlen_type' by
'gfc_charlen_type'. Update comment accordingly.
* intrinsics/args.c, intrinsics/env.c, io/io.h, io/transfer.c:
Replace all occurences of 'gfc_strlen_type' by 'gfc_charlen_type'.
From-SVN: r86828
2004-08-31 16:06:48 +02:00
Richard Henderson
625be28635
Makefile.am (gfor_helper_src): Split selected_kind.f90.
...
* Makefile.am (gfor_helper_src): Split selected_kind.f90.
(gfor_built_src): Add selected_int_kind.inc selected_real_kind.inc.
(selected_int_kind.inc selected_real_kind.inc): New rules.
* Makefile.in: Regenerate.
* mk-sik-inc.sh, mk-srk-inc.sh: New files.
* intrinsics/selected_int_kind.f90: Split from selected_kind.f90,
include table of detected kinds.
* intrinsics/selected_real_kind.f90: Similarly.
From-SVN: r86801
2004-08-30 14:34:37 -07:00
Steven G. Kargl
048c989961
bessel.c: New file.
...
2004-08-29 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
* intrinsics/bessel.c: New file.
* intrinsics/erf.c: New file.
* Makefie.am: Add intrinsics/bessel.c and intrinsics/erf.c.
* configure.ac: Test for C99 Bessel and Error functions.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r86728
2004-08-29 16:31:16 +00:00
Steven G. Kargl
4c0c6b9f2c
gfortran.h (enum gfc_generic_isym_id): Add GFC_ISYM_GET?ID.
...
2004-08-29 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
* gfortran.h (enum gfc_generic_isym_id): Add GFC_ISYM_GET?ID.
(gfc_check_f, gfc_simplify_f): Add f0.
* intrinsic.c (do_check): Call f0. Flatten.
(add_sym_0): Fix prototype. Set f0.
(add_functions): Add getgid, getgid and getuid.
(resolve_intrinsic): Remove obsolete comment.
(do_simplify): Call f0.
* intrinsic.h (gfc_resolve_getgid, gfc_resolve_getpid,
gfc_resolve_getuid): Add prototypes.
* iresolve.c (gfc_resolve_getgid, gfc_resolve_getpid,
gfc_resolve_getuid): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Handle
GFC_ISYM_GET?ID.
libgfortran/
* Makefile.am: Add intrinsics/getXid.c.
* configure.ac: Add tests for get{g,p,u}id.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* configure: Regenerate.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r86703
2004-08-28 23:43:41 +00:00
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
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
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
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
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
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
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
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
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
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
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