aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/intrinsic.c
AgeCommit message (Collapse)AuthorFilesLines
2005-02-24Unrevert previously reversed patch, adding this patch:Tobias Schlüter1-14/+16
* module.c (find_true_name): Deal with NULL module. From-SVN: r95506
2005-02-24Revert yesterday's patch:Tobias Schlüter1-16/+14
2005-02-23 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de> * gfortran.h (gfc_component, gfc_actual_arglist, ... ... argument. Copy string instead of pointing to it. From-SVN: r95496
2005-02-23gfortran.h (gfc_component, [...]): Make 'name' a 'const char *'.Tobias Schlüter1-14/+16
* gfortran.h (gfc_component, gfc_actual_arglist, gfc_user_op): Make 'name' a 'const char *'. (gfc_symbol): Likewise, also for 'module'. (gfc_symtree): Make 'name' a 'const char *'. (gfc_intrinsic_sym): Likewise, also for 'lib_name'. (gfc_get_gsymbol, gfc_find_gsymbol): Add 'const' qualifier to 'char *' argument. (gfc_intrinsic_symbol): Use 'gfc_get_string' instead of 'strcpy' to initialize 'SYM->module'. * check.c (gfc_check_minloc_maxloc, check_reduction): Check for NULL pointer instead of empty string. * dump-parse-tree.c (gfc_show_actual_arglist): Likewise. * interface.c (gfc_compare_types): Adapt check to account for possible NULL pointer. (compare_actual_formal): Check for NULL pointer instead of empty string. * intrinsic.c (gfc_current_intrinsic, gfc_current_intrinsic_arg): Add 'const' qualifier. (conv_name): Return a heap allocated string. (find_conv): Add 'const' qualifier to 'target'. (add_sym): Use 'gfc_get_string' instead of 'strcpy'. (make_generic): Check for NULL pointer instead of emptystring. (make_alias): Use 'gfc_get_string' instead of 'strcpy'. (add_conv): No need to strcpy result from 'conv_name'. (sort_actual): Check for NULL pointer instead of emptystring. * intrinsic.h (gfc_current_intrinsic, gfc_current_intrinsic_arg): Adapt prototype. * module.c (compare_true_names): Compare pointers instead of strings for 'module' member. (find_true_name): Initialize string fields with gfc_get_string. (mio_pool_string): New function. (mio_internal_string): Adapt comment. (mio_component_ref, mio_component, mio_actual_arg): Use 'mio_pool_string' instead of 'mio_internal_string'. (mio_symbol_interface): Add 'const' qualifier to string arguments. Add level of indirection. Use 'mio_pool_string' instead of 'mio_internal_string'. (load_needed, read_module): Use 'gfc_get_string' instead of 'strcpy'. (write_common, write_symbol): Use 'mio_pool_string' instead of 'mio_internal_string'. (write_symbol0, write_symbol1): Likewise, also check for NULL pointer instead of empty string. (write_operator, write_generic): Pass correct type variable to 'mio_symbol_interface'. (write_symtree): Use 'mio_pool_string' instead of 'mio_internal_string'. * primary.c (match_keyword_arg): Adapt check to possible case of NULL pointer. Use 'gfc_get_string' instead of 'strcpy'. * symbol.c (gfc_add_component, gfc_new_symtree, delete_symtree, gfc_get_uop, gfc_new_symbol): Use 'gfc_get_string' instead of 'strcpy'. (ambiguous_symbol): Check for NULL pointer instead of empty string. (gfc_find_gsymbol, gfc_get_gsymbol): Add 'const' qualifier on string arguments. * trans-array.c (gfc_trans_auto_array_allocation): Check for NULL pointer instead of empty string. * trans-decl.c (gfc_sym_mangled_identifier, gfc_sym_mangled_function_id, gfc_finish_var_decl, gfc_get_symbol_decl, gfc_get_symbol_decl): Likewise. * trans-io.c (gfc_new_nml_name_expr): Add 'const' qualifier to argument. Copy string instead of pointing to it. From-SVN: r95472
2005-02-23gfortran.h (gfc_get_namespace): Add second argument to prototype.Tobias Schlüter1-1/+1
fortran/ * gfortran.h (gfc_get_namespace): Add second argument to prototype. * intrinsic.c (gfc_intrinsic_init_1): Pass second argument to gfc_get_namespace. * module.c (mio_namespace_ref, load_needed): Likewise. * parse.c (parse_interface, parse_contained): Likewise. Here the correct second argument matters. * symbol.c (gfc_get_namespace): Add parent_types argument, only copy parent's implicit types if this is set. (gfc_symbol_init_2): Pass second argument to gfc_get_namespace. * trans-common.c (build_common_decl): Likewise. testsuite/ * gfortran.dg/implicit_3.f90: New test. From-SVN: r95463
2005-02-19check.c (gfc_check_selected_int_kind): New function.Steven G. Kargl1-1/+1
* check.c (gfc_check_selected_int_kind): New function. * intrinsic.h: Prototype it. * intrinsic.c (add_function): Use it. * simplify (gfc_simplify_ceiling,gfc_simplify_floor): Change BT_REAL to BT_INTEGER and use gfc_default_integer_kind. From-SVN: r95291
2005-02-19check.c (gfc_check_achar): New functionSteven G. Kargl1-1/+1
* check.c (gfc_check_achar): New function * intrinsic.h: Prototype it. * intrinsic.c (add_function): Use it. * gfortran.dg/achar_1.f90: New test. From-SVN: r95288
2005-01-29re PR fortran/18565 (gfortran: CONJG: false error message about standard ↵Paul Brook1-16/+16
violation) 2005-01-29 Paul Brook <paul@codesourcery.com> PR fortran/18565 * check.c (real_or_complex_check): New function. (gfc_check_fn_c, gfc_check_fn_r, gfc_check_fn_rc): New functions. * intrinsic.c (add_functions): Use new check functions. * intrinsic.h (gfc_check_fn_c, gfc_check_fn_r, gfc_check_fn_rc): Add prototypes. testsuite/ * gfortran.dg/double_complex_1.f90: New test. From-SVN: r94412
2005-01-22intrinsic.c (make_alias): Add standard argument.Steven G. Kargl1-10/+15
2005-01-22 Steven G. Kargl <kargls@comcast.net> * intrinsic.c (make_alias): Add standard argument. (add_functions): Update make_alias calls. From-SVN: r94082
2005-01-18arith.c, [...]: Update copyright.Kazu Hirata1-1/+1
* arith.c, array.c, check.c, decl.c, expr.c, f95-lang.c, gfortran.h, interface.c, intrinsic.c, io.c, iresolve.c, match.c, matchexp.c, misc.c, module.c, options.c, parse.c, scanner.c, simplify.c, symbol.c, trans-array.c, trans-expr.c, trans-io.c, trans-stmt.c, trans.c: Update copyright. From-SVN: r93830
2005-01-03arith.c: Add system.h; remove string.hSteven G. Kargl1-5/+0
* arith.c: Add system.h; remove string.h * decl.c: Ditto * matchexp.c: Ditto * parse.c: Ditto * resolve.c: Ditto * st.c: Ditto * check.c: Remove stdlib.h and stdarg.h * error.c: Remove stdlib.h, stdarg.h, stdio.h, string.h * expr.c: Add system.h; remove stdarg.h, stdio.h, and string.h * f95-lang.c: Add system.h; remove stdio.h * interface.c: Add system.h; remove stdlib.h and string.h * intrinsic.c: Remove stdarg.h, stdio.h, and string.h * io.c: Remove string.h * simplify.c: Ditto * match.c: Remove stdarg.h and string.h * misc.c: Update copyright; add system.h; remove stdlib.h, string.h, and sys/stat.h * module.c: Add system.h; remove string.h, stdio.h, errno.h, unistd.h, and time.h * option.c: Remove string.h and stdlib.h * primary.c: Ditto * scanner.c: Update copyright; add system.h; remove stdlib.h, stdio.h, string.h, and strings.h * symbol.c: Add system.h; remove stdlib.h, stdio.h, and string.h * trans-array.c: Remove stdio.h and gmp.h * trans-const.c: Ditto * trans-expr.c: Ditto * trans-io.c: Ditto * trans-stmt.c: Ditto * trans.c: Ditto * trans-intrinsic.c: Remove stdio.h and string.h From-SVN: r92866
2004-12-12re PR fortran/16581 (gfortran F90 bit intrinsics don't work with ↵Steven G. Kargl1-2/+2
integer*{1,2,8}) 2004-12-12 Steven G. Kargl <kargls@comcast.net> PR fortran/16581 * check.c (gfc_check_iand, gfc_check_ibclr, gfc_check_ibits, gfc_check_ibset, gfc_check_ieor, gfc_check_ior): Remove default integer kind check; Issue error for -std=f95 when needed. * intrinsic.c (add_functions): Change ieor from GFC_STD_GNU to GFC_STD_F95. * iresolve.c (gfc_resolve_iand, gfc_resolve_ieor, gfc_resolve_ior): Promote arguments to same kind. From-SVN: r92063
2004-12-08intrinsic.c (gfc_convert_type_warn): Propagate the input shape to the output ↵Richard Henderson1-0/+4
expression. * intrinsic.c (gfc_convert_type_warn): Propagate the input shape to the output expression. * iresolve.c (gfc_resolve_cshift, gfc_resolve_eoshift): Suppress warning conversion. (gfc_resolve_reshape): Force convert SHAPE and ORDER parameters to index kind. From-SVN: r91917
2004-12-02flush.c: New file.Steven G. Kargl1-2/+35
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. Co-Authored-By: Paul Brook <paul@codesourcery.com> From-SVN: r91609
2004-12-02intrinsic.c: Fix and add comments, fix function declarationsSteven G. Kargl1-327/+395
2004-12-02 Steven G. Kargl <kargls@comcast.net> * intrinsic.c: Fix and add comments, fix function declarations (OPTIONAL,REQUIRED): New symbols (add_functions,add_subroutines): Use symbols (gmp.h): Remove unused include From-SVN: r91604
2004-11-20check.c (gfc_check_getcwd_sub): Fix seg fault.Steven G. Kargl1-0/+29
* 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-08arith.c, [...]: Fix comment formatting.Kazu Hirata1-12/+12
* arith.c, array.c, decl.c, expr.c, f95-lang.c, gfortran.h, gfortranspec.c, interface.c, intrinsic.c, iresolve.c, match.c, module.c, parse.c, parse.h, primary.c, resolve.c, scanner.c, trans-array.c, trans-array.h, trans-expr.c, trans-intrinsic.c, trans-io.c, trans-stmt.c, trans.h: Fix comment formatting. From-SVN: r90266
2004-11-02intrinsic.c (check_intrinsic_standard): Include error locus.Paul Brook1-10/+5
* intrinsic.c (check_intrinsic_standard): Include error locus. Remove VLA. (gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Pass locus to check_intrinsic_standard. From-SVN: r89971
2004-10-31re PR fortran/17590 (Standard conformance should take intrinsics into account.)Janne Blomqvist1-373/+425
2004-10-31 Janne Blomqvist <jblomqvi@cc.hut.fi> PR fortran/17590 * gfortran.h: Change GFC_STD_* flags to more appropriate ones. (struct gfc_intrinsic_isym): Add field for standard. (struct gfc_option_t): Add field for warning about use of nonstandard intrinsics. * intrinsic.c (add_sym): Add parameter for standard version, check this against current standard. (add_sym_0): Pass standard parameter to add_sym. (add_sym_1, add_sym_0s, add_sym_1s, add_sym_1m, add_sym_2): Ditto. (add_sym_2s, add_sym_3, add_sym_3ml, add_sym_3red, add_sym_3s): Ditto. (add_sym_4, add_sym_4s, add_sym_5, add_sym_5s): Ditto. (make_generic): Add parameter for standard, check this against currently selected standard. (add_functions, add_subroutines): Add parameter to tell which standard an intrinsic belongs to. (check_intrinsic_standard): New function. (gfc_intrinsic_func_interface): Add call to check_intrinsic_standard. (gfc_intrinsic_sub_interface): Ditto. * lang.opt: Add Wnonstd-intrinsics option. * options.c (gfc_init_options): Change to use new GFC_STD_* flags, init new warning. (set_Wall): Add warning about nonstd intrinsics. (gfc_handle_option): Change to use new GFC_STD_* flags, handle new warning. * invoke.texi: Update manual to include -Wnonstd-intrinsics. From-SVN: r89907
2004-10-30check.c (gfc_check_rand): Allow missing optional argument.Canqun Yang1-2/+2
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-04re PR fortran/17776 (no subroutine system)Tobias Schlüter1-0/+9
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-04re PR libfortran/17631 (libfortran: intrinsic subroutine MVBITS not implemented)Tobias Schlüter1-35/+5
PR fortran/17631 fortran/ * intrinsic.c (add_sym_5): Remove. (add_subroutines): Add resolution function for MVBITS. * intrinsic.h (gfc_resolve_mvbits): Declare resolution function for MVBITS * iresolve.c (gfc_resolve_mvbits): New function. (gfc_resolve_random_number): Remove empty line at end of function. libgfortran/ * Makefile.am (gfor_helper_src): Add intrinsics/mvbits.h. * intrinsics/mvbits.h: New file. testsuite/ * gfortran.fortran-torture/execute/intrinsic_mvbits.f90: New test. From-SVN: r88527
2004-09-16array.c, [...]: Fix comment typos.Kazu Hirata1-1/+1
* array.c, data.c, decl.c, dependency.c, error.c, f95-lang.c, interface.c, intrinsic.c, io.c, misc.c, module.c, parse.h, resolve.c, scanner.c, trans-array.c, trans-array.h, trans-common.c, trans-const.h, trans-decl.c, trans-expr.c, trans-intrinsic.c, trans-stmt.c, trans-types.c, trans.c, trans.h: Fix comment typos. Follow spelling conventions. From-SVN: r87605
2004-09-15check.c (gfc_check_getcwd_sub): New function.Steven G. Kargl1-0/+10
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-08-29check.c (gfc_check_besn, [...]): New functions.Steven G. Kargl1-0/+83
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
2004-08-28gfortran.h (enum gfc_generic_isym_id): Add GFC_ISYM_GET?ID.Steven G. Kargl1-51/+49
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-27gfortran.h (gfc_default_*_kind): Remove prototypes, add extern variable ↵Tobias Schlüter1-10/+10
declaration of same name. * gfortran.h (gfc_default_*_kind): Remove prototypes, add extern variable declaration of same name. * arith.c, check.c, decl.c, dump_parse_tree.c, expr.c, intrinsic.c, io.c, iresolve.c, match.c, options.c, primary.c, resolve.c, simplify.c, symbol.c, trans-const.c, trans-io.c: Replace all calls to gfc_default_*_kind with variable accesses. * trans-types.c: Same as above. (gfc_default_*_kind_1): Rename to gfc_default_*_kind, remove static qualifier. Replace all occurences. (gfc_default_*_kind): Remove functions. From-SVN: r86662
2004-08-26check.c (gfc_check_atan2): New function.Tobias Schlüter1-1/+1
* check.c (gfc_check_atan2): New function. * intrinsic.c (add_functions): Use gfc_check_atan2 for ATAN2 * intrinsic.h (gfc_check_atan2): Add prototype. From-SVN: r86628
2004-08-22check.c (gfc_check_reduction): Rename to ...Tobias Schlüter1-6/+10
* check.c (gfc_check_reduction): Rename to ... (check_reduction): ... this. Make static. Don't check type of first argument. (gfc_check_minval_maxval, gfc_check_prodcut_sum): New functions. * intrinsic.c (add_functions): Change MAXVAL, MINVAL, PRODUCT and SUM to use new check functions. (check_specific): Change logic to call new functions. * intrinsic.h (gfc_check_minval_maxval, gfc_check_product_sum): Add prototypes. (gfc_check_reduction): Remove prototype. From-SVN: r86377
2004-08-19re PR fortran/16946 (sum (array, mask) is not accepted)Erik Schnetter1-21/+52
fortran/ PR fortran/16946 * check.c (gfc_check_reduction): New function. (gfc_check_minval_maxval): Removed. (gfc_check_product): Removed. (gfc_check_sum): Removed. * intrinsic.h: Add/remove declarations for these. * gfortran.h: Add field f3red to union gfc_check_f. * intrinsic.c (add_sym_3red): New function. (add_functions): Register maxval, minval, product, and sum intrinsics through add_sym_3red. (check_specific): Handle f3red union field. * iresolve.c: Whitespace change. testsuite/ PR fortran/16946 * gfortran.dg/reduction.f90: New testcase. From-SVN: r86255
2004-08-11[multiple changes]Paul Brook1-0/+2
2004-08-11 Paul Brook <paul@codeourcery.com> PR fortran/16917 * intrinsic.c (add_functions): Add dfloat as an alias for dble. 2004-08-11 Steven G. Kargl <kargls@comcast.net> * gfortran.dg/dfloat_1.f90: New test. From-SVN: r85805
2004-08-06intrinsic.c (add_subroutines): Add getenv and get_environment_variable.Janne Blomqvist1-4/+51
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-06arith.c: Add #define for model numbers.Steven G. Kargl1-0/+5
2004-08-06 Steven G. Kargl <kargls@comcast.net> * arith.c: Add #define for model numbers. Remove global GMP variables. (natural_logarithm,common_logarithm,exponential,sine, cosine,arctangent,hypercos,hypersine ): Remove. (gfc_mpfr_to_mpz,gfc_set_model_kind,gfc_set_model): New functions. (arctangent2,gfc_arith_init_1,gfc_arith_done_1 gfc_check_real_range, gfc_constant_result, gfc_range_check, gfc_arith_uminus,gfc_arith_plus, gfc_arith_minus, gfc_arith_times, gfc_arith_divide,complex_reciprocal,complex_pow_ui, gfc_arith_power,gfc_compare_expr,compare_complex,gfc_convert_real, gfc_convert_complex,gfc_int2real,gfc_int2complex, gfc_real2int,gfc_real2real,gfc_real2complex, gfc_complex2int,gfc_complex2real,gfc_complex2complex): Convert GMP to MPFR, use new functions. * arith.h: Remove extern global variables. (natural_logarithm,common_logarithm,exponential, sine, cosine, arctangent,hypercos,hypersine): Remove prototypes. (arctangent2): Update prototype from GMP to MPFR. (gfc_mpfr_to_mpz, gfc_set_model_kind,gfc_set_model): Add prototypes. * dump-parse-tree.c (gfc_show_expr): Convert GMP to MPFR. * expr.c (free_expr0,gfc_copy_expr): Convert GMP to MPFR. * gfortran.h (GFC_REAL_BITS): Remove. (arith): Add ARITH_NAN. Include mpfr.h. Define GFC_RND_MODE. Rename GCC_GFORTRAN_H GFC_GFC_H. (gfc_expr): Convert GMP to MPFR. * module.c: Add arith.h, correct type in comment. (mio_gmp_real): Convert GMP to MPFR. (mio_expr): Use gfc_set_model_kind(). * primary.c: Update copyright date with 2004. (match_real_constant,match_const_complex_part): Convert GMP to MPFR. * simplify.c: Remove global GMP variables (gfc_simplify_abs,gfc_simplify_acos,gfc_simplify_aimag, gfc_simplify_aint,gfc_simplify_dint,gfc_simplify_anint, gfc_simplify_dnint,gfc_simplify_asin,gfc_simplify_atan, gfc_simplify_atan2,gfc_simplify_ceiling,simplify_cmplx, gfc_simplify_conjg,gfc_simplify_cos,gfc_simplify_cosh, gfc_simplify_dim,gfc_simplify_dprod,gfc_simplify_epsilon, gfc_simplify_exp,gfc_simplify_exponent,gfc_simplify_floor, gfc_simplify_fraction,gfc_simplify_huge,gfc_simplify_int, gfc_simplify_ifix,gfc_simplify_idint,gfc_simplify_log, gfc_simplify_log10,simplify_min_max,gfc_simplify_mod, gfc_simplify_modulo,gfc_simplify_nearest,simplify_nint, gfc_simplify_rrspacing,gfc_simplify_scale, gfc_simplify_set_exponent,gfc_simplify_sign,gfc_simplify_sin, gfc_simplify_sinh,gfc_simplify_spacing,gfc_simplify_sqrt, gfc_simplify_tan,gfc_simplify_tanh,gfc_simplify_tiny, gfc_simplify_init_1,gfc_simplify_done_1): Convert GMP to MPFR. Use new functions. * trans-const.c (gfc_conv_mpfr_to_tree): Rename from gfc_conv_mpf_to_tree. Convert it to use MPFR (gfc_conv_constant_to_tree): Use it. * trans-const.h: Update prototype for gfc_conv_mpfr_to_tree(). * trans-intrinsic.c: Add arith.h, remove gmp.h (gfc_conv_intrinsic_aint,gfc_conv_intrinsic_mod): Convert GMP to MPFR. From-SVN: r85652
2004-07-08intrinsic.c (add_sym_4s): New function.Paul Brook1-18/+46
* intrinsic.c (add_sym_4s): New function. (add_subroutines): Change gfc_add_sym_? to gfc_add_sym_?s. From-SVN: r84304
2004-07-04re PR libfortran/15280 (Fortran9x commandline not accessable)Janne Blomqvist1-2/+24
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-06-14re PR fortran/14928 (minloc intrinsic does not understand mask)Tobias Schlüter1-15/+49
fortran/ 2004-06-05 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> Andrew Vaught <andyv@firstinter.net> PR fortran/14928 * gfortran.h (gfc_check_f): Add new field f3ml. * check.c (gfc_check_minloc_maxloc): Take argument list instead of individual arguments, reorder if necessary. * intrinsic.h (gfc_check_minloc_maxloc): ... adapt prototype. * intrinsic.c (add_sym_3ml): New function. (add_functions): Change to add_sym_3ml for MINLOC, MAXLOC. (check_specific): Catch special case MINLOC, MAXLOC. testsuite/ PR fortran/14928 * gfortran.fortran-torture/compile/mloc.f90: New test. Co-Authored-By: Andrew Vaught <andyv@firstinter.net> From-SVN: r83111
2004-06-13* intrinsic.c (add_sym_2s): Use correct function types.Paul Brook1-4/+4
From-SVN: r83071
2004-06-12check.c (gfc_check_second_sub, [...]): New functions.Steven G. Kargl1-0/+76
* 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-05intrinsic.c (sort_actual): Keep track of type of missing arguments.Tobias Schlüter1-1/+7
* intrinsic.c (sort_actual): Keep track of type of missing arguments. (Missing from previous commit.) From-SVN: r82645
2004-05-22* intrinsic.c (add_subroutines): Use add_sym_3s for random_seed.Paul Brook1-1/+1
From-SVN: r82139
2004-05-22check.c (gfc_check_system_clock): New function.Steven G. Kargl1-2/+29
* 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-14re PR fortran/15205 (NEAREST intrinsic returns wrong value in DOUBLE PRECISION)Tobias Schlüter1-1/+1
PR fortran/15205 * iresolve.c (gfc_resolve_nearest): Add new function. * intrinsic.h: ... declare it here. * intrinsic.c (add_functions): ... add it as resolving function for NEAREST. From-SVN: r81843
2004-05-14Make-lang.in, [...]: Update copyright years and boilerplate.Tobias Schlüter1-13/+14
* Make-lang.in, arith.c, arith.h, array.c, bbt.c, check.c, decl.c, dependency.c, dependency.h, dump-parse-tree.c, error.c, expr.c, f95-lang.c, gfortran.h, interface.c, intrinsic.c, intrinsic.h, io.c, iresolve.c, lang-specs.h, match.c, match.h, matchexp.c, misc.c, module.c, options.c, parse.c, parse.h, primary.c, resolve.c, scanner.c, simplify.c, st.c, symbol.c, trans-array.c, trans-array.h, trans-common.c, trans-const.c, trans-const.h, trans-decl.c, trans-expr.c, trans-intrinsic.c, trans-io.c, trans-stmt.c, trans-stmt.h, trans-types.c, trans-types.h, trans.c, trans.h: Update copyright years and boilerplate. * data.c: Likewise, also removed two whitespace-only lines. * gfortranspec.c, lang.opt: Update copyright years. From-SVN: r81839
2004-05-13Merge tree-ssa-20020619-branch into mainline.Diego Novillo1-0/+2560
From-SVN: r81764