summaryrefslogtreecommitdiff
path: root/libgfortran
Commit message (Collapse)AuthorAgeFilesLines
* cshift0.c (DEF_COPY_LOOP, [...]): New.Richard Henderson2004-09-032-19/+92
| | | | | | | | | * 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
* format.c (parse_format_list): Set repeat count for P descriptors.Paul Brook2004-09-023-3/+19
| | | | | | | | | | * io/format.c (parse_format_list): Set repeat count for P descriptors. * write.c (output_float): Fix condition. Correctly handle nonzero scale factor. testsuite/ * gfortran.dg/edit_real_1.f90: Add new tests. From-SVN: r86952
* mk-sik-inc.sh: Use a temporary string instead of 'echo -n'.Eric Botcazou2004-09-013-6/+13
| | | | | | | * mk-sik-inc.sh: Use a temporary string instead of 'echo -n'. * mk-srk-inc.sh: Likewise. From-SVN: r86919
* error.c (generate_error): Set both iostat and library_return.Paul Brook2004-08-312-6/+12
| | | | | | | | | * runtime/error.c (generate_error): Set both iostat and library_return. testsuite/ * gfortran.dg/eof_2.f90: New test. From-SVN: r86852
* re PR libfortran/16805 (Runtime failure using list directed read from string)Paul Brook2004-08-313-5/+17
| | | | | | | | | | | | PR libfortran/16805 * io/list_read.c (next_char): Don't signal EOF for internal files. * io/unix.c (mem_alloc_r_at): Don't return NULL for incomplete reads. testsuite/ 2004-08-31 Bud Davis <bdavis9659@comcast.net> * gfortran.dg/list_read_2.f90: New test. From-SVN: r86844
* unit.c: Separate copyright years by ','.Tobias Schlüter2004-08-312-11/+9
| | | | | | | | | * io/unit.c: Separate copyright years by ','. (compare, insert_unit, delete_unit, is_internal_unit, close_units): Remove blank line in beginning of function. (get_unit): Simplify code. From-SVN: r86841
* * io/unit.c (get_unit): Remove superfluous if.Paul Brook2004-08-312-3/+5
| | | | From-SVN: r86838
* transfer.c (read_sf): Rename uinty to readlen.Paul Brook2004-08-313-13/+28
| | | | | | | | | | * io/transfer.c (read_sf): Rename uinty to readlen. Detect EOF. (finalize_transfer): Move setjmp after namlist IO. * io/unix.c (mem_alloc_r_at): Calculate remaining length correctly. testsuite/ * gfortran.dg/eof_1.f90: New test. From-SVN: r86831
* list_read.c (eat_separator): Set at_eo when a '/' is seen.Paul Brook2004-08-312-0/+5
| | | | | | | | * list_read.c (eat_separator): Set at_eo when a '/' is seen. testsuite/ * gfortran.dg/list_read_1.f90: New file. From-SVN: r86830
* trans-decl.c, [...]: Replace all occurences of 'gfc_strlen_type_node' by ↵Tobias Schlüter2004-08-316-16/+23
| | | | | | | | | | | | | | | | | | '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
* trans-types.h: Add comments.Paul Brook2004-08-302-0/+8
| | | | | | | | | * trans-types.h: Add comments. (intmax_type_node, string_type_node, const_string_type_node): Remove. libgfortran/ * libgfortran.h: Add comments. From-SVN: r86810
* Makefile.am (gfor_helper_src): Split selected_kind.f90.Richard Henderson2004-08-307-45/+159
| | | | | | | | | | | | | * 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
* bessel.c: New file.Steven G. Kargl2004-08-292-0/+111
| | | | | | | | | | | | | | | 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
* check.c (gfc_check_besn, [...]): New functions.Steven G. Kargl2004-08-296-8/+1243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2004-08-29 Steven G. Kargl <kargls@comcast.net> Paul Brook <paul@codesourcery.com> * check.c (gfc_check_besn, gfc_check_g77_math1): New functions. * f95-lang.c (DO_DEFINE_MATH_BUILTIN): Define. (DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it. (build_builtin_fntypes): New function. (gfc_init_builtin_functions): Use it. * gfortran.h (enum gfc_generic_isym_id): Add GFC_ISYM_{J,Y}{0,1,N} and GFC_ISYM_ERF{,C}. (gfc_c_int_kind): Declare. * intrinsic.c (add_functions): Add [d]bes* and [d]erf*. * intrinsic.h (gfc_check_besn, gfc_check_g77_math1, gfc_resolve_besn, gfc_resolve_g77_math1): Add prototypes. * resolve.c (gfc_resolve_besn, gfc_resolve_g77_math1): New functions. * mathbuiltins.def: Add comment. Change third argument. Use DEFINE_MATH_BUILTIN_C. Add bessel and error functions. * trans-intrinsic.c (BUILT_IN_FUNCTION): Define. (DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it. * trans-types.c (gfc_c_int_kind): Declare. (gfc_init_kinds): Set it. testsuite/ * gfortran.dg/g77/README: Update. * gfortran.dg/g77/erfc.f: Copy from g77.f-torture. * gfortran.dg/g77/intrinsic-unix-bessel.f: Ditto. * gfortran.dg/g77/intrinsic-unix-erf.f: Ditto. libgfortran/ * intrinsics/bessel.c: New file. * intrinsics/erf.c: New file. * Makefie.am: Add intrinsics/bessel.c and intrinsics/erf.c. * configure.ac: Test for C99 Bessel and Error functions. * Makefile.in: Regenerate. * config.h.in: Regenerate. * configure: Regenerate. Co-Authored-By: Paul Brook <paul@codesourcery.com> From-SVN: r86727
* gfortran.h (enum gfc_generic_isym_id): Add GFC_ISYM_GET?ID.Steven G. Kargl2004-08-287-121/+369
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* re PR libfortran/17195 (Infinite loop in output_float in libgfortran/io/write.c)Paul Brook2004-08-284-250/+324
| | | | | | | | | | | | | PR libfortran/17195 * libgfortran.h (rtoa): Remove prototype. * runtime/error.c (rtoa): Remove. * io/write.c (calculate_G_format): Don't add blanks if E format is used. Add correct number of blanks when exponent width is specified. (output_float): Rewrite. testsuite/ * gfortran.dg/edit_real_1.f90: New test. From-SVN: r86701
* Comment typo.Paul Brook2004-08-271-1/+1
| | | | From-SVN: r86660
* rewind.c (st_rewind): Reset unit to read mode.Paul Brook2004-08-272-0/+9
| | | | | | | | * io/rewind.c (st_rewind): Reset unit to read mode. testsuite/ * gfortran.dg/rewind_1.f90: New test. From-SVN: r86659
* re PR libfortran/16597 (gfortran: bug in unformatted I/O on scratch files)Bud Davis2004-08-274-4/+22
| | | | | | | | | | | | | | | 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
* io.h, [...]: Fix formatting issues, update copyright years.Tobias Schlüter2004-08-261-0/+5
| | | | | | | | * 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
* re PR libfortran/17143 (2**63 prints garbage)Bud Davis2004-08-252-4/+12
| | | | | | | | | | | | 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
* re PR libfortran/17164 (index function not working properly)Bud Davis2004-08-252-0/+9
| | | | | | | | | | | 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
* Makefile.am (libgfortran_la_LDFLAGS): Add -lm.David Edelsohn2004-08-243-2/+7
| | | | | | | * Makefile.am (libgfortran_la_LDFLAGS): Add -lm. * Makefile.in: Rebuilt. From-SVN: r86486
* ignore autom4te.cacheR. Kelley Cook2004-08-231-0/+1
| | | | From-SVN: r86446
* io.h, [...]: Fix formatting issues, update copyright years.Tobias Schlüter2004-08-235-349/+346
| | | | | | | * 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
* Fix typo.Paul Brook2004-08-211-1/+1
| | | | From-SVN: r86363
* re PR libfortran/16908 (Segfault in libgfortran/io/transfer.c)Bud Davis2004-08-212-4/+18
| | | | | | | | | | | | 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
* re PR fortran/13278 (derived type namelist I/O support missing, causes ICE)Victor Leikehman2004-08-184-14/+40
| | | | | | | | | | | | | | | | | | | | 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
* Corrected typo in PR number, previous commitBud Davis2004-08-131-1/+1
| | | | From-SVN: r85969
* re PR libfortran/16935 (Segmentation fault of compiler with unsupported ↵Bud Davis2004-08-132-2/+7
| | | | | | | | | | | | 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
* list_read.c (namelist_read): Convert variable names to lower case, so that ↵Victor Leikehman2004-08-102-3/+13
| | | | | | | | | | | | 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
* c99_functions.c (nextafterf): New implementation that works correctly with ↵Roger Sayle2004-08-092-44/+49
| | | | | | | | | denormalized numbers. * intrinsics/c99_functions.c (nextafterf): New implementation that works correctly with denormalized numbers. From-SVN: r85724
* matmul.m4, [...]: Allocate space if return value has NULL in its data field.Victor Leikehman2004-08-0916-21/+387
| | | | | | | | | | | 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
* intrinsic.c (add_subroutines): Add getenv and get_environment_variable.Janne Blomqvist2004-08-064-1/+199
| | | | | | | | | | | | | | | | | | | 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
* Commit for Victor Leikehman <lei@il.ibm.com>Victor Leikehman2004-08-052-0/+7
| | | | | | | PR libgfortran/16704 * io/read.c (read_radix): Understand letters f and F as hex digits. From-SVN: r85596
* * libgfortran.h (array_t, size0) New declarations.Victor Leikehman2004-08-0452-6/+851
| | | | | | | | | | | * 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
* re PR libfortran/16137 (Fortran compiler unable to produce executables as ↵Roger Sayle2004-08-035-73/+1866
| | | | | | | | | | | | | | | | | | 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
* write.c (write_float): Use the slightly more portable isnan in preference to ↵Roger Sayle2004-08-012-1/+6
| | | | | | | | | isinf. * io/write.c (write_float): Use the slightly more portable isnan in preference to isinf. From-SVN: r85407
* configure.ac: Add check for LFS support.Bud Davis2004-07-183-2/+367
| | | | | | | | 2004-07-18 Bud Davis <bdavis9659@comcast.net> * configure.ac: Add check for LFS support. * configure: Regenerate From-SVN: r84890
* re PR fortran/16303 (Complex logarithm function sometimes chooses a ↵Paul Brook2004-07-114-18/+15
| | | | | | | | | | non-principal branch) PR fortran/16303 * m4/cexp.m4 (carg): Return -pi to pi. * generated/exp_c?.c: Regenerate. From-SVN: r84516
* re PR libfortran/16291 (F2003 formatting of Inf /Nan on irix6.5)Andreas Krebbel2004-07-082-5/+11
| | | | | | | | PR fortran/16291 * libgfortran/io/write.c: (write_float): Added length check. Remove pointless memset calls. From-SVN: r84308
* re PR libfortran/15472 (implicit open for unformatted file causes run-time ↵Bud Davis2004-07-053-18/+59
| | | | | | | | | | | | | | | | | | | | | | 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
* re PR libfortran/15280 (Fortran9x commandline not accessable)Janne Blomqvist2004-07-043-4/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* libtool-version: New.Matthias Klose2004-07-046-75/+55
| | | | | | | | | | | | 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
* rand.c (rand): Wrap the irand() call from the previous commit in prefix.Steve Kargl2004-06-302-1/+7
| | | | | | | | | * 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
* Paul Brook <paul@codesourcery.com>Tobias Schlüter2004-06-303-3/+10
| | | | | | | | | | | | | 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
* re PR libfortran/12839 (incorrect IO of Inf)Bud Davis2004-06-282-4/+9
| | | | | | | | | 2004-06-27 Bud Davis <bdavis9659@comcast.net> PR gfortran/12839 * io/write.c (write_float): check signbit for Infinity. From-SVN: r83757
* re PR libfortran/16196 (gfortran fails to create file with ↵Bud Davis2004-06-262-1/+6
| | | | | | | | | | | | 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
* darwin7.h (MATH_LIBRARY): Remove.Andrew Pinski2004-06-243-111/+69
| | | | | | | | | | | | | | | | | | 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
* re PR fortran/15750 (IOLENGTH form of INQUIRE statement not implemented)Janne Blomqvist2004-06-224-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | 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