aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/iresolve.c
AgeCommit message (Collapse)AuthorFilesLines
2008-04-17re PR fortran/35724 (Compile time segmentation fault for CSHIFT with ↵Jerry DeLisle1-1/+2
negative third arg) 2008-04-16 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/35724 * iresolve.c (gfc_resolve_eoshift): Check for NULL symtree in test for optional argument attribute. From-SVN: r134376
2008-03-28re PR fortran/35724 (Compile time segmentation fault for CSHIFT with ↵Jerry DeLisle1-1/+2
negative third arg) 2008-03-27 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/35724 * iresolve.c (gfc_resolve_cshift): Check for NULL symtree in test for optional argument attribute. From-SVN: r133668
2008-03-03re PR fortran/33197 (Fortran 2008: math functions)François-Xavier Coudert1-0/+8
PR fortran/33197 gcc/fortran/ * intrinsic.c (add_functions): Modify intrinsics ACOSH, ASINH, ATANH, ERF, ERFC and GAMMA. Add intrinsics BESSEL_{J,Y}{0,1,N}, ERFC_SCALED, LOG_GAMMA and HYPOT. * intrinsic.h (gfc_check_hypot, gfc_simplify_hypot, gfc_resolve_hypot): New prototypes. * mathbuiltins.def: Add HYPOT builtin. Make complex versions of ACOSH, ASINH and ATANH available. * gfortran.h (GFC_ISYM_ERFC_SCALED, GFC_ISYM_HYPOT): New values. * lang.opt: Add -std=f2008 option. * libgfortran.h: Define GFC_STD_F2008. * lang-specs.h: Add .f08 and .F08 file suffixes. * iresolve.c (gfc_resolve_hypot): New function. * parse.c (parse_contained): Allow empty CONTAINS for Fortran 2008. * check.c (gfc_check_hypot): New function. * trans-intrinsic.c (gfc_intrinsic_map): Define ERFC_SCALE builtin. * options.c (set_default_std_flags): Allow Fortran 2008 by default. (form_from_filename): Add .f08 suffix. (gfc_handle_option): Handle -std=f2008 option. * simplify.c (gfc_simplify_hypot): New function. * gfortran.texi: Document Fortran 2008 status and file extensions. * intrinsic.texi: Document new BESSEL_{J,Y}{0,1,N} intrinsics, as well as HYPOT and ERFC_SCALED. Update documentation of ERF, ERFC, GAMMA, LGAMMA, ASINH, ACOSH and ATANH. * invoke.texi: Document the new -std=f2008 option. libgomp/ * testsuite/libgomp.fortran/fortran.exp: Add .f08 and .F08 file suffixes. gcc/testsuite/ * gfortran.dg/gomp/gomp.exp: Add .f08 and .F08 file suffixes. * gfortran.dg/dg.exp: Likewise. * gfortran.dg/vect/vect.exp: Likewise. * gfortran.fortran-torture/execute/execute.exp: Likewise. * gfortran.fortran-torture/compile/compile.exp: Likewise. * gfortran.dg/gamma_1.f90: Also check log_gamma. * gfortran.dg/invalid_contains_1.f90: Remove warning about empty CONTAINS. * gfortran.dg/gamma_2.f90: Add a few error messages. * gfortran.dg/invalid_contains_2.f90: Remove warning about empty CONTAINS. * gfortran.dg/gamma_3.f90: Adjust error message. * gfortran.dg/gamma_4.f90: Test for log_gamma instead of lgamma. * gfortran.dg/bind_c_usage_9.f03: Adjust error messages. * gfortran.dg/bessel_1.f90: New test. * gfortran.dg/recursive_check_3.f90: Remove warnings. * gfortran.dg/besxy.f90: Also check for new F2008 intrinsics. * gfortran.dg/derived_function_interface_1.f90: Remove warning. * gfortran.dg/contains_empty_1.f03: New test. * gfortran.dg/erfc_scaled_1.f90: New test. * gfortran.dg/hypot_1.f90: New test. * gfortran.dg/contains_empty_2.f03: New test. libgfortran/ * intrinsics/erfc_scaled_inc.c: New file. * intrinsics/erfc_scaled.c: New file. * gfortran.map (GFORTRAN_1.0): Add _gfortran_erfc_scaled_r*. * Makefile.am: Add intrinsics/erfc_scaled.c. * config.h.in: Regenerate. * configure: Regenerate. * Makefile.in: Regenerate. From-SVN: r132846
2008-02-27re PR fortran/33387 (Fortran front-end should translate intrinsics by ↵Francois-Xavier Coudert1-98/+3
calling C99 function instead of libgfortran functions) PR fortran/33387 * trans.h: Remove prototypes for gfor_fndecl_math_exponent4, gfor_fndecl_math_exponent8, gfor_fndecl_math_exponent10 and gfor_fndecl_math_exponent16. * f95-lang.c (build_builtin_fntypes): Add new function types. (gfc_init_builtin_functions): Add new builtins for nextafter, frexp, ldexp, fabs, scalbn and inf. * iresolve.c (gfc_resolve_rrspacing): Don't add hidden arguments. (gfc_resolve_scale): Don't convert type of second argument. (gfc_resolve_set_exponent): Likewise. (gfc_resolve_size): Don't add hidden arguments. * trans-decl.c: Remove gfor_fndecl_math_exponent4, gfor_fndecl_math_exponent8, gfor_fndecl_math_exponent10 and gfor_fndecl_math_exponent16. * trans-intrinsic.c (gfc_intrinsic_map): Remove intrinsics for scalbn, fraction, nearest, rrspacing, set_exponent and spacing. (gfc_conv_intrinsic_exponent): Directly call frexp. (gfc_conv_intrinsic_fraction, gfc_conv_intrinsic_nearest, gfc_conv_intrinsic_spacing, gfc_conv_intrinsic_rrspacing, gfc_conv_intrinsic_scale, gfc_conv_intrinsic_set_exponent): New functions. (gfc_conv_intrinsic_function): Use the new functions above. From-SVN: r132713
2008-02-24arith.c: Update copyright years.Tobias Schlüter1-1/+1
* arith.c: Update copyright years. * arith.h: Likewise. * array.c: Likewise. * bbt.c: Likewise. * check.c: Likewise. * data.c: Likewise. * data.h: Likewise. * decl.c: Likewise. * dependency.c: Likewise. * dependency.h: Likewise. * dump-parse-tree.c: Likewise. * error.c: Likewise. * expr.c: Likewise. * gfc-internals.texi: Likewise. * gfortran.h: Likewise. * gfortran.texi: Likewise. * gfortranspec.c: Likewise. * interface.c: Likewise. * intrinsic.c: Likewise. * intrinsic.h: Likewise. * intrinsic.texi: Likewise. * invoke.texi: Likewise. * io.c: Likewise. * iresolve.c: Likewise. * iso-c-binding.def: Likewise. * iso-fortran-env.def: Likewise. * lang-specs.h: Likewise. * lang.opt: Likewise. * libgfortran.h: Likewise. * match.c: Likewise. * match.h: Likewise. * matchexp.c: Likewise. * misc.c: Likewise. * module.c: Likewise. * openmp.c: Likewise. * options.c: Likewise. * parse.c: Likewise. * parse.h: Likewise. * primary.c: Likewise. * resolve.c: Likewise. * scanner.c: Likewise. * simplify.c: Likewise. * st.c: Likewise. * symbol.c: Likewise. * target-memory.c: Likewise. * target-memory.h: Likewise. * trans-array.h: Likewise. * trans-const.h: Likewise. * trans-stmt.h: Likewise. * trans-types.c: Likewise. * trans-types.h: Likewise. * types.def: Likewise. From-SVN: r132600
2008-02-22re PR fortran/34907 (valgrind error indication from testsuite trans-types.c: ↵Jerry DeLisle1-0/+32
gfc_typenode_for_spec) 2008-02-20 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/34907 * iresolve.c (resolve_mask_arg): Add gfc_clear_ts to initialize structure. (gfc_resolve_aint): Likewise. (gfc_resolve_anint): Likewise. (gfc_resolve_besn): Likewise. (gfc_resolve_cshift): Likewise. (gfc_resolve_ctime): Likewise. (gfc_resolve_eoshift): Likewise. (gfc_resolve_index_func): Likewise. (gfc_resolve_isatty): Likewise. (gfc_resolve_malloc): Likewise. (gfc_resolve_rrspacing): Likewise. (gfc_resolve_scale): Likewise. (gfc_resolve_set_exponent): Likewise. (gfc_resolve_spacing): Likewise. (gfc_resolve_spacing): Likewise. (gfc_resolve_fgetc): Likewise. (gfc_resolve_fputc): Likewise. (gfc_resolve_ftell): Likewise. (gfc_resolve_ttynam): Likewise. (gfc_resolve_alarm_sub): Likewise. (gfc_resolve_mvbits): Likewise. (gfc_resolve_getarg): Likewise. (gfc_resolve_signal_sub): Likewise. (gfc_resolve_exit): Likewise. (gfc_resolve_flush): Likewise. (gfc_resolve_free): Likewise. (gfc_resolve_ctime_sub): Likewise. (gfc_resolve_fgetc_sub): Likewise. (gfc_resolve_fputc_sub): Likewise. (gfc_resolve_fseek_sub): Likewise. (gfc_resolve_ftell_sub): Likewise. (gfc_resolve_ttynam_sub): Likewise. From-SVN: r132541
2008-01-19re PR fortran/34817 (mixed-kind "any" and "all" intrinsics with expressions)Thomas Koenig1-4/+0
2008-01-19 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/34817 PR fortran/34838 * iresolve.c (gfc_resolve_all): Remove conversion of mask argument to kind=1 by removing call to resolve_mask_arg(). (gfc_resolve_any): Likewise. 2008-01-19 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/34817 PR fortran/34838 * gfortran.dg/any_all_1.f90: New test. * gfortran.dg/any_all_2.f90: New test. From-SVN: r131660
2008-01-15re PR libfortran/34671 (any(kind=1) and all(kind=1))Thomas Koenig1-2/+8
2008-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/34671 * gfortran.am: Added _gfortran_all_l1, _gfortran_all_l2, _gfortran_any_l1, _gfortran_any_l2, -28,15 _gfortran_count_1_l, _gfortran_count_16_l, _gfortran_count_2_l, _gfortran_count_4_l and _gfortran_count_8_l Removed _gfortran_count_16_l16, _gfortran_count_16_l4, _gfortran_count_16_l8, _gfortran_count_4_l16, _gfortran_count_4_l4, _gfortran_count_4_l8, _gfortran_count_8_l16, _gfortran_count_8_l4 and _gfortran_count_8_l8. * Makefile.am: Added generated/any_l1.c and generated/any_l2.c to i_any_c. Added generated/all_l1. and generated/all_l2.c to i_all_c. Removed generated/count_4_l4.c, generated/count_8_l4.c, generated/count_16_l4.c, generated/count_4_l8.c, generated/count_8_l8.c, generated/count_16_l8.c, generated/count_4_l16.c, generated/count_8_l16.c, and generated/count_16_l16.c from i_count_c. Added count_1_l.c, count_2_l.c, count_4_l.c, count_8_l.c and count_16_l.c to i_count_c. I_M4_DEPS2 depends on ifunction_logical.m4, for any of the files generated from all.m4, any.m4 and count.m4. * Makefile.in: Regenerated. * m4/ifunction_logical.m4: New file. Use GFC_LOGICAL_1 pointer for access to source arrays. * m4/any.m4: Include ifunction_logical.m4 instead of ifunction.m4. Don't check atype_name. * m4/all.m4: Likewise. * m4/count.m4: Likewise. * generated/any_l1.c: New file. * generated/any_l2.c: New file. * generated/all_l1.c: New file. * generated/count_1_l.c: New file. * generated/count_2_l.c: New file. * generated/count_4_l.c: New file. * generated/count_8_l.c: New file. * generated/count_16_l.c: New file. * generated/any_l4.c: Regenerated. * generated/any_l8.c: Regenerated. * generated/any_l16.c: Regenerated. * generated/all_l4.c: Regenerated. * generated/all_l8.c: Regenerated. * generated/all_l16.c: Regenerated. * generated/count_4_l4.c: Removed. * generated/count_4_l8.c: Removed. * generated/count_4_l16.c: Removed. * generated/count_8_l4.c: Removed. * generated/count_8_l8.c: Removed. * generated/count_8_l16.c: Removed. * generated/count_16_l4.c: Removed. * generated/count_16_l8.c: Removed. * generated/count_16_l16.c: Removed. 2008-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/34671 * iresolve.c (gfc_resolve_all): Call resolve_mask_arg. (gfc_resolve_any): Likewise. (gfc_resolve_count): Likewise. Don't append kind of argument to function name. 2008-01-15 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/34671 * gfortran.dg/anyallcount_1.f90: New test. From-SVN: r131553
2007-12-25re PR fortran/34533 (DTIME returns total process time and not since last ↵Daniel Franke1-1/+9
invocation) gcc/fortran: 2007-12-25 Daniel Franke <franke.daniel@gmail.com> PR fortran/34533 * intrinsic.h (gfc_check_etime): Renamed to ... (gfc_check_dtime_etime): ... this. (gfc_check_etime_sub): Renamed to ... (gfc_check_dtime_etime_sub): ... this. (gfc_resolve_dtime_sub): New prototype. * check.c (gfc_check_etime): Renamed to ... (gfc_check_dtime_etime): ... this. (gfc_check_etime_sub): Renamed to ... (gfc_check_dtime_etime_sub): ... this. * iresolve.c (gfc_resolve_dtime_sub): New implementation. * intrinsic.c (add_functions): Removed alias from ETIME to DTIME, added stand-alone intrinsic DTIME. (add_subroutines): Adjusted check and resolve function names for DTIME and ETIME. * trans-intrinsic.c (gfc_conv_intrinsic_function): Added DTIME to known functions in switch. * intrinsic.texi (DTIME): Added paragraph about thread-safety, fixed return value section. (CPU_TIME): Clarified intent and added implementation notes. libgfortran: 2007-12-25 Daniel Franke <franke.daniel@gmail.com> PR fortran/34533 * intrinsics/cpu_time.c: Moved code commonly usable for CPU_TIME, DTIME and ETIME to ... * intrinsics/time_1.h: ... here. * intrinsics/dtime.c: New file. * intrinsics/etime.c: Newly implemented using the common time-aquisition function from time_1.h. * gfortran.map (_gfortran_dtime, _gfortran_dtime_sub): New. * Makefile.am: Added new file. * Makefile.in: Regenerated. * configure: Regenerated. From-SVN: r131168
2007-12-22re PR libfortran/34540 (cshift, eoshift, kind=1 and kind=2 arguments...)Jerry DeLisle1-2/+2
2007-12-21 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/34540 * iresolve.c (gfc_resolve_cshift): Take optional dim path only if the argument is an optional itself. * iresolve.c (gfc_resolve_eoshift): Same. From-SVN: r131133
2007-11-29re PR fortran/34262 (MVBITS does not work for arrays)Tobias Burnus1-0/+2
2007-11-29 Tobias Burnus <burnus@net-b.de> PR fortran/34262 * intrinsic.c (gfc_get_intrinsic_sub_symbol): Add comment. (gfc_intrinsic_sub_interface): Copy elemental state if needed. * iresolve.c (gfc_resolve_mvbits): Mark procedure as elemental. 2007-11-29 Tobias Burnus <burnus@net-b.de> PR fortran/34262 * gfortran.dg/mvbits_3.f90: New. From-SVN: r130513
2007-11-24re PR libfortran/34209 (run-time lib: NEAREST(0.0_8, -1.0) produces wrong ↵Jerry DeLisle1-21/+50
numbers) 2007-11-23 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/34209 * iresolve.c (gfc_resolve_nearest): If sign variable kind does not match kind of input variable, convert it to match. PR fortran/33317 * trans.h: Modify prototype for gfc_conv_missing_dummy. * trans-expr.c (gfc_conv_missing_dummy): Modify to pass an integer kind parameter in. Set the type of the dummy to the kind given. (gfc_conv_function_call): Pass representation.length to gfc_conv_missing_dummy. * iresolve.c (gfc_resolve_cshift): Determine the correct kind to use and if appropriate set representation.length to this kind value. (gfc_resolve_eoshift): Likewise. * check.c (gfc_check_cshift): Enable dim_check to allow DIM as an optional argument. (gfc_check_eoshift): Likewise. * trans_intrinsic.c (gfc_conv_intrinsic_function_args): Update call to gfc_conv_missing_dummy. From-SVN: r130391
2007-11-20re PR fortran/33317 (CSHIFT/EOSHIFT: Rejects optional dummy for DIM=)Jerry DeLisle1-6/+14
2007-11-19 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/33317 * trans-expr.c (gfc_conv_missing_dummy): Revert. * iresolve.c (gfc_resolve_cshift): Revert. (gfc_resolve_eoshift): Likewise. * check.c (gfc_check_cshift): Revert. (gfc_check_eoshift): Likewise. From-SVN: r130304
2007-11-18trans-expr.c (gfc_conv_missing_dummy): Set the type of the dummy argument to ↵Jerry DeLisle1-14/+7
default integer if flagged to do so. 2007-11-18 Jerry DeLisle <jvdelisle@gcc.gnu.org> * trans-expr.c (gfc_conv_missing_dummy): Set the type of the dummy argument to default integer if flagged to do so. Fix typo in comment. * resolve.c (gfc_resolve_dim_arg): Whitespace cleanup. * iresolve.c (gfc_resolve_cshift): Do not convert type, mark attribute for converting the DIM type appropriately in trans-expr.c. (gfc_resolve_eoshift): Likewise. * check.c (dim_check): Remove pre-existing dead code. (gfc_check_cshift): Enable dim_check to allow DIM as an optional. (gfc_check_eoshift): Likewise. * trans_intrinsic.c (gfc_conv_intrinsic_function_args): Fix whitespace. From-SVN: r130276
2007-11-13re PR fortran/34080 (Transfer was working, now broken)Paul Thomas1-1/+2
2007-11-13 Paul Thomas <pault@gcc.gnu.org> PR fortran/34080 * iresolve.c (gfc_resolve_transfer): Do not try to convert to a constant MOLD expression, if it is an assumed size dummy. 2007-11-13 Paul Thomas <pault@gcc.gnu.org> PR fortran/34080 * gfortran.dg/transfer_assumed_size_1.f90: New test. From-SVN: r130158
2007-10-20re PR fortran/31608 (wrong types in character array/scalar binop)Paul Thomas1-10/+26
2007-10-20 Paul Thomas <pault@gcc.gnu.org> FX Coudert <fxcoudert@gcc.gnu.org> PR fortran/31608 * trans-array.c (gfc_conv_expr_descriptor): For all except indirect references, use gfc_trans_scalar_assign instead of gfc_add_modify_expr. * iresolve.c (check_charlen_present): Separate creation of cl if necessary and add code to treat an EXPR_ARRAY. (gfc_resolve_char_achar): New function. (gfc_resolve_achar, gfc_resolve_char): Call it. (gfc_resolve_transfer): If the MOLD expression does not have a character length expression, get it from a constant length. 2007-10-20 Paul Thomas <pault@gcc.gnu.org> FX Coudert <fxcoudert@gcc.gnu.org> PR fortran/31608 * gfortran.dg/char_cast_1.f90: New test. Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> From-SVN: r129505
2007-09-13iresolve.c (resolve_mask_arg): If a mask is an array expression, convert it ↵Thomas Koenig1-9/+23
to kind=1. 2007-09-13 Thomas Koenig <tkoenig@gcc.gnu.org> * iresolve.c (resolve_mask_arg): If a mask is an array expression, convert it to kind=1. From-SVN: r128477
2007-08-30re PR fortran/31879 (ICE with function having array of character variables ↵Paul Thomas1-0/+28
argument) 2007-08-31 Paul Thomas <pault@gcc.gnu.org> PR fortran/31879 PR fortran/31197 PR fortran/31258 PR fortran/32703 * gfortran.h : Add prototype for gfc_resolve_substring_charlen. * resolve.c (gfc_resolve_substring_charlen): New function. (resolve_ref): Call gfc_resolve_substring_charlen. (gfc_resolve_character_operator): New function. (gfc_resolve_expr): Call the new functions in cases where the character length is missing. * iresolve.c (cshift, eoshift, merge, pack, reshape, spread, transpose, unpack): Call gfc_resolve_substring_charlen for source expressions that are character and have a reference. * trans.h (gfc_trans_init_string_length) Change name to gfc_conv_string_length; modify references in trans-expr.c, trans-array.c and trans-decl.c. * trans-expr.c (gfc_trans_string_length): Handle case of no backend_decl. (gfc_conv_aliased_arg): Remove code for treating substrings and replace with call to gfc_trans_string_length. * trans-array.c (gfc_conv_expr_descriptor): Remove code for treating strings and call gfc_trans_string_length instead. 2007-08-31 Paul Thomas <pault@gcc.gnu.org> PR fortran/31879 * gfortran.dg/char_length_7.f90: New test. * gfortran.dg/char_length_9.f90: New test. * gfortran.dg/char_assign_1.f90: Add extra warning. PR fortran/31197 PR fortran/31258 * gfortran.dg/char_length_8.f90: New test. From-SVN: r127939
2007-08-29re PR libfortran/32989 (GETARG intrinsic)Francois-Xavier Coudert1-3/+12
PR fortran/32989 * iresolve.c (gfc_resolve_getarg): Handle non-default integer kinds. * check.c (gfc_check_getarg): New function * intrinsic.h: Add prototype for gfc_check_getarg. * intrinsic.c (add_subroutines): Add reference to gfc_check_getarg. * intrinsic.texi (GETARG): Adjust documentation. * gfortran.fortran-torture/execute/getarg_1.f90: Add check for non-default integer kind arguments. From-SVN: r127905
2007-08-26re PR fortran/32980 (Vendor extension: Intrinsic functions (D)GAMMA, LGAMMA ↵Tobias Burnus1-0/+18
(ALGAMA/DLGAMA)) 2007-08-26 Tobias Burnus <burnus@net-b.de> PR fortran/32980 * intrinsic.h (gfc_simplify_gamma,gfc_simplify_lgamma, gfc_resolve_gamma,gfc_resolve_lgamma): New function declations. * mathbuiltins.def: Define GAMMA and LGAMMA. * intrinsic.c (add_functions): Add GAMMA, DGAMMA, LGAMMA, ALGAMA and DLGAMA. * simplify.c (gfc_simplify_gamma,gfc_simplify_lgamma): New functions. * iresolve.c (gfc_resolve_gamma,gfc_resolve_lgamma): New functions. * intrinsic.texi: Add documentation for GAMMA and LGAMMA. 2007-08-26 Tobias Burnus <burnus@net-b.de> PR fortran/32980 * gfortran.dg/gamma_1.f90: New. * gfortran.dg/gamma_2.f90: New. * gfortran.dg/gamma_3.f90: New. From-SVN: r127809
2007-08-24re PR libfortran/32972 (performance of pack/unpack)Thomas Koenig1-17/+3
2007-08-24 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/32972 * iresolve.c: Don't convert array masks. 2007-08-24 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/32972 * libgfortran.h: Remove GFOR_POINTER_L8_TO_L4 macro. Add GFOR_POINTER_TO_L1 macro. * m4/iforeach.m4(`m'name`'rtype_qual`_'atype_code): Change argument 'mask' to gfc_array_l1. Adjust prototype. Change mask pointer to GFC_LOGICAL_1. Multiply strides by kind of mask * m4/ifunction.m4: Likewise. * intrinsics/pack_generic.c(pack_internal): Likewise. * intrinsics/unpack_generic.c(unpack_internal): Likewise. * m4/matmull.m4: Switch to GFC_LOGICAL_1. Multiply strides by kind of logical arguments a and b. * generated/matmul_l16.c: Regenerated. * generated/matmul_l4.c: Regenerated. * generated/matmul_l8.c: Regenerated. * generated/maxloc0_16_i1.c: Regenerated. * generated/maxloc0_16_i16.c: Regenerated. * generated/maxloc0_16_i2.c: Regenerated. * generated/maxloc0_16_i4.c: Regenerated. * generated/maxloc0_16_i8.c: Regenerated. * generated/maxloc0_16_r10.c: Regenerated. * generated/maxloc0_16_r16.c: Regenerated. * generated/maxloc0_16_r4.c: Regenerated. * generated/maxloc0_16_r8.c: Regenerated. * generated/maxloc0_4_i1.c: Regenerated. * generated/maxloc0_4_i16.c: Regenerated. * generated/maxloc0_4_i2.c: Regenerated. * generated/maxloc0_4_i4.c: Regenerated. * generated/maxloc0_4_i8.c: Regenerated. * generated/maxloc0_4_r10.c: Regenerated. * generated/maxloc0_4_r16.c: Regenerated. * generated/maxloc0_4_r4.c: Regenerated. * generated/maxloc0_4_r8.c: Regenerated. * generated/maxloc0_8_i1.c: Regenerated. * generated/maxloc0_8_i16.c: Regenerated. * generated/maxloc0_8_i2.c: Regenerated. * generated/maxloc0_8_i4.c: Regenerated. * generated/maxloc0_8_i8.c: Regenerated. * generated/maxloc0_8_r10.c: Regenerated. * generated/maxloc0_8_r16.c: Regenerated. * generated/maxloc0_8_r4.c: Regenerated. * generated/maxloc0_8_r8.c: Regenerated. * generated/maxloc1_16_i1.c: Regenerated. * generated/maxloc1_16_i16.c: Regenerated. * generated/maxloc1_16_i2.c: Regenerated. * generated/maxloc1_16_i4.c: Regenerated. * generated/maxloc1_16_i8.c: Regenerated. * generated/maxloc1_16_r10.c: Regenerated. * generated/maxloc1_16_r16.c: Regenerated. * generated/maxloc1_16_r4.c: Regenerated. * generated/maxloc1_16_r8.c: Regenerated. * generated/maxloc1_4_i1.c: Regenerated. * generated/maxloc1_4_i16.c: Regenerated. * generated/maxloc1_4_i2.c: Regenerated. * generated/maxloc1_4_i4.c: Regenerated. * generated/maxloc1_4_i8.c: Regenerated. * generated/maxloc1_4_r10.c: Regenerated. * generated/maxloc1_4_r16.c: Regenerated. * generated/maxloc1_4_r4.c: Regenerated. * generated/maxloc1_4_r8.c: Regenerated. * generated/maxloc1_8_i1.c: Regenerated. * generated/maxloc1_8_i16.c: Regenerated. * generated/maxloc1_8_i2.c: Regenerated. * generated/maxloc1_8_i4.c: Regenerated. * generated/maxloc1_8_i8.c: Regenerated. * generated/maxloc1_8_r10.c: Regenerated. * generated/maxloc1_8_r16.c: Regenerated. * generated/maxloc1_8_r4.c: Regenerated. * generated/maxloc1_8_r8.c: Regenerated. * generated/maxval_i1.c: Regenerated. * generated/maxval_i16.c: Regenerated. * generated/maxval_i2.c: Regenerated. * generated/maxval_i4.c: Regenerated. * generated/maxval_i8.c: Regenerated. * generated/maxval_r10.c: Regenerated. * generated/maxval_r16.c: Regenerated. * generated/maxval_r4.c: Regenerated. * generated/maxval_r8.c: Regenerated. * generated/minloc0_16_i1.c: Regenerated. * generated/minloc0_16_i16.c: Regenerated. * generated/minloc0_16_i2.c: Regenerated. * generated/minloc0_16_i4.c: Regenerated. * generated/minloc0_16_i8.c: Regenerated. * generated/minloc0_16_r10.c: Regenerated. * generated/minloc0_16_r16.c: Regenerated. * generated/minloc0_16_r4.c: Regenerated. * generated/minloc0_16_r8.c: Regenerated. * generated/minloc0_4_i1.c: Regenerated. * generated/minloc0_4_i16.c: Regenerated. * generated/minloc0_4_i2.c: Regenerated. * generated/minloc0_4_i4.c: Regenerated. * generated/minloc0_4_i8.c: Regenerated. * generated/minloc0_4_r10.c: Regenerated. * generated/minloc0_4_r16.c: Regenerated. * generated/minloc0_4_r4.c: Regenerated. * generated/minloc0_4_r8.c: Regenerated. * generated/minloc0_8_i1.c: Regenerated. * generated/minloc0_8_i16.c: Regenerated. * generated/minloc0_8_i2.c: Regenerated. * generated/minloc0_8_i4.c: Regenerated. * generated/minloc0_8_i8.c: Regenerated. * generated/minloc0_8_r10.c: Regenerated. * generated/minloc0_8_r16.c: Regenerated. * generated/minloc0_8_r4.c: Regenerated. * generated/minloc0_8_r8.c: Regenerated. * generated/minloc1_16_i1.c: Regenerated. * generated/minloc1_16_i16.c: Regenerated. * generated/minloc1_16_i2.c: Regenerated. * generated/minloc1_16_i4.c: Regenerated. * generated/minloc1_16_i8.c: Regenerated. * generated/minloc1_16_r10.c: Regenerated. * generated/minloc1_16_r16.c: Regenerated. * generated/minloc1_16_r4.c: Regenerated. * generated/minloc1_16_r8.c: Regenerated. * generated/minloc1_4_i1.c: Regenerated. * generated/minloc1_4_i16.c: Regenerated. * generated/minloc1_4_i2.c: Regenerated. * generated/minloc1_4_i4.c: Regenerated. * generated/minloc1_4_i8.c: Regenerated. * generated/minloc1_4_r10.c: Regenerated. * generated/minloc1_4_r16.c: Regenerated. * generated/minloc1_4_r4.c: Regenerated. * generated/minloc1_4_r8.c: Regenerated. * generated/minloc1_8_i1.c: Regenerated. * generated/minloc1_8_i16.c: Regenerated. * generated/minloc1_8_i2.c: Regenerated. * generated/minloc1_8_i4.c: Regenerated. * generated/minloc1_8_i8.c: Regenerated. * generated/minloc1_8_r10.c: Regenerated. * generated/minloc1_8_r16.c: Regenerated. * generated/minloc1_8_r4.c: Regenerated. * generated/minloc1_8_r8.c: Regenerated. * generated/minval_i1.c: Regenerated. * generated/minval_i16.c: Regenerated. * generated/minval_i2.c: Regenerated. * generated/minval_i4.c: Regenerated. * generated/minval_i8.c: Regenerated. * generated/minval_r10.c: Regenerated. * generated/minval_r16.c: Regenerated. * generated/minval_r4.c: Regenerated. * generated/minval_r8.c: Regenerated. * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenerated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenerated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. From-SVN: r127774
2007-08-12re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)Francois-Xavier Coudert1-5/+6
PR fortran/29600 * intrinsic.c (add_functions): Add optional KIND argument to ACHAR. * iresolve.c (gfc_resolve_achar): Handle the KIND argument. * check.c (gfc_check_achar): Check for the optional KIND argument. * simplify.c (gfc_simplify_achar): Use KIND argument. * intrinsic.h (gfc_check_achar, gfc_simplify_achar, gfc_resolve_achar): Adjust prototypes. * gfortran.dg/intrinsics_kind_argument_1.f90: Add test for ACHAR intrinsic. From-SVN: r127385
2007-08-12re PR fortran/30964 (optional arguments to random_seed)Francois-Xavier Coudert1-0/+10
PR fortran/30964 PR fortran/33054 * trans-expr.c (gfc_conv_function_call): When no formal argument list is available, we still substitute missing optional arguments. * check.c (gfc_check_random_seed): Correct the check on the number of arguments to RANDOM_SEED. * intrinsic.c (add_subroutines): Add a resolution function to RANDOM_SEED. * iresolve.c (gfc_resolve_random_seed): New function. * intrinsic.h (gfc_resolve_random_seed): New prototype. * intrinsics/random.c (random_seed): Rename into random_seed_i4. (random_seed_i8): New function. * gfortran.map (GFORTRAN_1.0): Remove _gfortran_random_seed, add _gfortran_random_seed_i4 and _gfortran_random_seed_i8. * libgfortran.h (iexport_proto): Replace random_seed by random_seed_i4 and random_seed_i8. * runtime/main.c (init): Call the new random_seed_i4. * gfortran.dg/random_4.f90: New test. * gfortran.dg/random_5.f90: New test. * gfortran.dg/random_6.f90: New test. * gfortran.dg/random_7.f90: New test. From-SVN: r127383
2007-08-12re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)Francois-Xavier Coudert1-18/+70
PR fortran/29600 * intrinsic.c (add_functions): Add KIND arguments to COUNT, IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY. * iresolve.c (gfc_resolve_count): Add kind argument. (gfc_resolve_iachar): New function. (gfc_resolve_ichar): Add kind argument. (gfc_resolve_index_func): Likewise. (gfc_resolve_lbound): Likewise. (gfc_resolve_len): Likewise. (gfc_resolve_len_trim): Likewise. (gfc_resolve_scan): Likewise. (gfc_resolve_size): New function. (gfc_resolve_ubound): Add kind argument. (gfc_resolve_verify): Likewise. * trans-decl.c (gfc_get_extern_function_decl): Allow specific intrinsics to have 4 arguments. * check.c (gfc_check_count): Add kind argument. (gfc_check_ichar_iachar): Likewise. (gfc_check_index): Likewise. (gfc_check_lbound): Likewise. (gfc_check_len_lentrim): New function. (gfc_check_scan): Add kind argument. (gfc_check_size): Likewise. (gfc_check_ubound): Likewise. (gfc_check_verify): Likewise. * intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY. * simplify.c (get_kind): Whitespace fix. (int_expr_with_kind): New function. (gfc_simplify_iachar): Add kind argument. (gfc_simplify_iachar): Likewise. (gfc_simplify_ichar): Likewise. (gfc_simplify_index): Likewise. (simplify_bound_dim): Likewise. (simplify_bound): Likewise. (gfc_simplify_lbound): Likewise. (gfc_simplify_len): Likewise. (gfc_simplify_len_trim): Likewise. (gfc_simplify_scan): Likewise. (gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size. (gfc_simplify_size): Add kind argument. (gfc_simplify_ubound): Likewise. (gfc_simplify_verify): Likewise. * intrinsic.h: Update prototypes and add new ones. * trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into gfc_conv_intrinsic_index_scan_verify. (gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove. (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_index_scan_verify to translate the INDEX, SCAN and VERIFY intrinsics. * gfortran.dg/intrinsics_kind_argument_1.f90: New test. * gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording. From-SVN: r127380
2007-08-06re PR fortran/30947 (intrinsic: ALARM)Francois-Xavier Coudert1-3/+7
PR fortran/30947 * iresolve.c (gfc_resolve_alarm_sub): Suffix the subroutine name with the kind of the STATUS argument. * intrinsics/signal.c: Create specific versions of alarm_sub and alarm_sub_int according to the integer kind of the last argument. * gfortran.map (GFORTRAN_1.0): Remove _gfortran_alarm_sub and _gfortran_alarm_sub_int, add _gfortran_alarm_sub_i4, _gfortran_alarm_sub_i8, _gfortran_alarm_sub_int_i4 and _gfortran_alarm_sub_int_i8. From-SVN: r127259
2007-08-06re PR fortran/30933 (intrinsic: EXIT)Francois-Xavier Coudert1-6/+10
PR fortran/30933 * iresolve.c (gfc_resolve_exit): Convert argument to default integer kind. From-SVN: r127256
2007-08-04re PR fortran/32968 (selected_(int|real)_kind fail with -fdefault-integer-8)Steven G. Kargl1-3/+29
2008-08-04 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/32968 * gfortran.dg/selected_kind_1.f90: New test. 2008-08-04 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/32969 * iresolve.c (gfc_resolve_rrspacing): Convert argument(s) to expected KIND. (gfc_resolve_scale): Ditto. (gfc_resolve_set_exponent): Ditto. (gfc_resolve_spacing): Ditto. PR fortran/32968 * trans-intrinsic.c (gfc_conv_intrinsic_si_kind, gfc_conv_intrinsic_sr_kind): Convert the argument(s) to the expected KIND, and fold the result to the expected KIND. From-SVN: r127205
2007-08-01re PR libfortran/32954 (pack with -fdefault-integer-8)Thomas Koenig1-97/+43
2007-08-01 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/32954 * intrinsic.c (resolve_mask_arg): New function. (gfc_resolve_maxloc): Use resolve_mask_arg for mask resolution. (gfc_resolve_maxval): Likewise. (gfc_resolve_minloc): Likewise. (gfc_resolve_minval): Likewise. (gfc_resolve_pack): Likewise. (gfc_resolve_product): Likewise. (gfc_resolve_sum): Likewise. (gfc_resolve_unpack): Likewise. 2007-08-01 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/32954 * minmaxloc_3.f90: New test case. From-SVN: r127137
2007-08-01arith.c: Change copyright header to refer to version 3 of the GNU General ↵Nick Clifton1-4/+3
Public... * arith.c: Change copyright header to refer to version 3 of the GNU General Public License and to point readers at the COPYING3 file and the FSF's license web page. * openmp.c, interface.c, intrinsic.c, trans-array.c, trans-expr.c, symbol.c, iso-fortran-env.def, intrinsic.h, decl.c, trans-array.h, matchexp.c, dump-parse-tree.c, trans-common.c, array.c, Make-lang.in, trans-openmp.c, gfortran.h, error.c, iso-c-binding.def, lang.opt, data.c, trans-const.c, trans-stmt.c, expr.c, trans-const.h, trans-stmt.h, module.c, trans.c, scanner.c, trans-types.c, trans.h, gfortranspec.c, trans-types.h, lang-specs.h, io.c, bbt.c, resolve.c, f95-lang.c, st.c, iresolve.c, match.c, trans-decl.c, trans-io.c, target-memory.c, match.h, target-memory.h, parse.c, arith.h, check.c, dependency.c, parse.h, types.def, convert.c, dependency.h, primary.c, trans-intrinsic.c, options.c, misc.c, simplify.c: Likewise. From-SVN: r127129
2007-07-14re PR fortran/32357 (MVBITS gives wrong-code on big-endian with ↵Francois-Xavier Coudert1-3/+16
-fdefault-integer-8) PR fortran/32357 * iresolve.c (gfc_resolve_mvbits): Convert FROMPOS, LEN and TOPOS to C int. * intrinsics/mvbits.c: Change prototype so that FROMPOS, LEN and TOPOS arguments are C int. * gfortran.dg/mvbits_2.f90: New test. From-SVN: r126646
2007-07-14re PR libfortran/32731 (pack/unpack with kind=1 or kind=2 mask)Thomas Koenig1-15/+39
2007-07-14 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/32731 * iresolve.c(gfc_resolve_pack): A scalar mask has to be kind=4, an array mask with kind<4 is converted to gfc_default_logical_kind automatically. (gfc_resolve_unpack): Convert mask to gfc_default_lotical_kind if it has a kind<4. 2007-07-14 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/32731 * gfortran.dg/pack_mask_1.f90: New test. * gfortran.dg/unpack_mask_1.f90: New test. From-SVN: r126644
2007-05-04re PR target/22539 (Internal compiler error with maximum sized array)Daniel Franke1-0/+44
gcc/fortran: 2007-05-04 Daniel Franke <franke.daniel@gmail.com> PR fortran/22539 * intrinsic.c (add_subroutines): Added FSEEK. * intrinsic.h (gfc_resolve_fseek_sub, gfc_check_fseek_sub): New. * iresolve.c (gfc_resolve_fseek_sub): New. * check.c (gfc_check_fseek_sub): New. * intrinsic.texi (FSEEK): Updated. gcc/testsuite: 2007-05-01 Daniel Franke <franke.daniel@gmail.com> PR fortran/22539 * gfortran.dg/fseek.f90: New test. libgfortran: 2007-05-04 Daniel Franke <franke.daniel@gmail.com> PR fortran/22539 * io/intrinsics.c (fseek_sub): New. * io/unix.c (fd_fseek): Change logical and physical offsets only if seek succeeds. * gfortran.map (fseek_sub): New. From-SVN: r124437
2007-04-07re PR fortran/31257 (ICE in gfc_conv_expr_descriptor)Paul Thomas1-0/+16
2007-04-07 Paul Thomas <pault@gcc.gnu.org> PR fortran/31257 * intrinsic.c (add_functions): Add ref. to gfc_resolve_achar. * intrinsic.h : Add prototype for gfc_resolve_achar. * iresolve.c (gfc_resolve_achar): New function. 2007-04-07 Paul Thomas <pault@gcc.gnu.org> PR fortran/31257 * gfortran.dg/achar_4.f90: New test. From-SVN: r123646
2007-03-08re PR fortran/30947 (intrinsic: ALARM)Daniel Franke1-2/+0
2007-03-08 Daniel Franke <franke.daniel@gmail.com> PR fortran/30947 * check.c (gfc_check_alarm_sub): Added check for default integer kind of status argument. * iresolve.c (gfc_resolve_alarm_sub): Removed conversion of status argument. * intrinsic.texi (ALARM): Extended documentation. From-SVN: r122715
2007-03-07* iresolve.c (gfc_resolve_ishftc): Correct s_kind value.Brooks Moses1-1/+1
From-SVN: r122674
2007-02-19re PR libfortran/30533 ([4.1 only] minval, maxval missing for kind=1 and kind=2)Thomas Koenig1-26/+0
2007-02-19 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/30533 PR libfortran/30765 * Makefile.am: Add $(srcdir) too all files in generated/. (i_maxloc0_c): Add maxloc0_4_i1.c, maxloc0_8_i1.c, maxloc0_16_i1.c, maxloc0_4_i2.c, maxloc0_8_i2.c and maxloc0_16_i2.c. (i_maxloc1_c): Add maxloc1_4_i1.c, maxloc1_8_i1.c, maxloc1_16_i1.c, maxloc1_4_i2.c, maxloc1_8_i2.c and maxloc1_16_i2.c. (i_maxval_c): Add maxval_i1.c and maxval_i2.c. (i_minloc0_c): Add minloc0_4_i1.c, minloc0_8_i1.c, minloc0_16_i1.c, minloc0_4_i2.c, minloc0_8_i2.c and minloc0_16_i2.c. (i_minloc_1.c): Add minloc1_4_i1.c, minloc1_8_i1.c, minloc1_16_i1.c, minloc1_4_i2.c, minloc1_8_i2.c and minloc1_16_i2.c. (i_minval_c): Add minval_i1.c and minval_i2.c. (i_sum_c): Add sum_i1.c and sum_i2.c. (i_product_c): Add product_i1.c and product_i2.c. (i_matmul_c): Add matmul_i1.c and matmul_i2.c. (gfor_built_specific_src): Remove $(srcdir) from target. (gfor_bulit_specific2_src): Likewise. Makefile.in: Regenerated. libgfortran.h: Add GFC_INTEGER_1_HUGE and GFC_INTEGER_2_HUGE. Add gfc_array_i1 and gfc_array_i2. * generated/matmul_i1.c: New file. * generated/matmul_i2.c: New file. * generated/maxloc0_16_i1.c: New file. * generated/maxloc0_16_i2.c: New file. * generated/maxloc0_4_i1.c: New file. * generated/maxloc0_4_i2.c: New file. * generated/maxloc0_8_i1.c: New file. * generated/maxloc0_8_i2.c: New file. * generated/maxloc1_16_i1.c: New file. * generated/maxloc1_16_i2.c: New file. * generated/maxloc1_4_i1.c: New file. * generated/maxloc1_4_i2.c: New file. * generated/maxloc1_8_i1.c: New file. * generated/maxloc1_8_i2.c: New file. * generated/maxval_i1.c: New file. * generated/maxval_i2.c: New file. * generated/minloc0_16_i1.c: New file. * generated/minloc0_16_i2.c: New file. * generated/minloc0_4_i1.c: New file. * generated/minloc0_4_i2.c: New file. * generated/minloc0_8_i1.c: New file. * generated/minloc0_8_i2.c: New file. * generated/minloc1_16_i1.c: New file. * generated/minloc1_16_i2.c: New file. * generated/minloc1_4_i1.c: New file. * generated/minloc1_4_i2.c: New file. * generated/minloc1_8_i1.c: New file. * generated/minloc1_8_i2.c: New file. * generated/minval_i1.c: New file. * generated/minval_i2.c: New file. * generated/product_i1.c: New file. * generated/product_i2.c: New file. * generated/sum_i1.c: New file. * generated/sum_i2.c: New file. 2007-02-19 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/30533 * fortran/iresolve.c(gfc_resolve_maxloc): Remove coercion of argument to default integer. (gfc_resolve_minloc): Likewise. 2007-02-19 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/30533 * gfortran.dg/intrinsic_intkinds_1.f90: New test. From-SVN: r122137
2007-01-11re PR libfortran/30415 (MINLOC, MAXLOC missing for integer kinds 1 and 2)Thomas Koenig1-0/+26
2007-01-11 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/30415 * iresolve.c (gfc_resolve_maxloc): If the rank of the return array is nonzero and we process an integer array smaller than default kind, coerce the array to default integer. * iresolve.c (gfc_resolve_minloc): Likewise. 2007-01-11 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/30415 * minmaxloc_integer_kinds_1.f90: New test. From-SVN: r120685
2007-01-08interface.c, [...]: Update Copyright years.Steven G. Kargl1-617/+582
2007-01-08 Steven G. Kargl <kargl@gcc.gnu.org> * interface.c, intrinsic.c, gfortranspec.c, io.c, f95-lang.c, iresolve.c, match.c: Update Copyright years. Whitespace. From-SVN: r120587
2006-10-09re PR fortran/15441 (RRSPACING broken for denormals)Steven G. Kargl1-0/+43
2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.h: Define GFC_MPFR_TOO_OLD via mpfr version info. * arith.c (arctangent, gfc_check_real_range): Use it. * simplify.c (gfc_simplify_atan2, gfc_simplify_exponent, gfc_simplify_log, gfc_simplify_nearest): Use it. PR fortran/15441 PR fortran/29312 * iresolve.c (gfc_resolve_rrspacing): Give rrspacing library routine hidden precision argument. (gfc_resolve_spacing): Give spacing library routine hidden precision, emin - 1, and tiny(x) arguments. * simplify.c (gfc_simplify_nearest): Remove explicit subnormalization. (gfc_simplify_rrspacing): Implement formula from Fortran 95 standard. (gfc_simplify_spacing): Implement formula from Fortran 2003 standard. * trans-intrinsic.c (gfc_intrinsic_map_t) Declare rrspacing and spacing via LIBF_FUNCTION (prepare_arg_info, call_builtin_clz, gfc_conv_intrinsic_spacing, gfc_conv_intrinsic_rrspacing): Remove functions. (gfc_conv_intrinsic_function): Remove calls to gfc_conv_intrinsic_spacing and gfc_conv_intrinsic_rrspacing. * f95-lang.c (gfc_init_builtin_functions): Remove __builtin_clz, __builtin_clzl and __builtin_clzll 2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/15441 PR fortran/29312 * configure.ac: Add HAVE_LDEXPF, HAVE_LDEXP, and HAVE_LDEXPL * m4/spacing.m4: New file. Use new HAVE_* defines. * m4/rrspacing.m4: Ditto. * Makefile.am: Handle new files. * configure: Regenerated. * Makefile.in: Ditto. * config.h.in: Ditto. * generated/spacing_r4.c: Generated. * generated/spacing_r8.c: Ditto. * generated/spacing_r10.c: Ditto. * generated/spacing_r16.c: Ditto. * generated/rrspacing_r4.c: Ditto. * generated/rrspacing_r8.c: Ditto. * generated/rrspacing_r10.c: Ditto. * generated/rrspacing_r16.c: Ditto. From-SVN: r117584
2006-10-07re PR fortran/16580 ([4.1 only] gfortran ICE on test ↵François-Xavier Coudert1-1/+25
g77.f-torture/execute/intrinsic77.f) PR fortran/16580 PR fortran/29288 * gcc/fortran/intrinsic.c (add_sym): Define the actual_ok when a gfc_intrinsic_sym structure is filled. (gfc_intrinsic_actual_ok): New function. (add_sym_0s, add_sym_1s, add_sym_2s, add_sym_3s, add_sym_4s, add_sym_5s): Intrinsic subroutines are not allowed as actual arguments, so we remove argument actual_ok. (add_functions): Correct the values for actual_ok of all intrinsics. (add_subroutines): Remove the actual_ok argument, which was never used. * gcc/fortran/intrinsic.h (gfc_intrinsic_actual_ok): New prototype. * gcc/fortran/gfortran.h (gfc_resolve_index_func): New prototype. * gcc/fortran/resolve.c (resolve_actual_arglist): Check whether an intrinsic used as an argument list is allowed there. * gcc/fortran/iresolve.c (gfc_resolve_index_func): New function. (gfc_resolve_len): Change intrinsic function name to agree with libgfortran. * gcc/fortran/trans-decl.c (gfc_get_extern_function_decl): Add new case, because some specific intrinsics take 3 arguments. * gcc/fortran/intrinsic.texi: DIMAG is a GNU extension. * libgfortran/Makefile.am: Add the new files to the build process, and rules to build them. * libgfortran/Makefile.in: Regenerate. * libgfortran/m4/misc_specifics.m4: New file. * libgfortran/m4/specific.m4: Add new special cases for function with complex argument and real result, like abs_c* and aimag_c*. * libgfortran/intrinsics/f2c_specifics.F90: Add specifics for AIMAG, ASINH, ACOSH and ATANH. * libgfortran/generated/_aimag_c4.F90: New file. * libgfortran/generated/_aimag_c8.F90: New file. * libgfortran/generated/_asinh_r10.F90: New file. * libgfortran/generated/_acosh_r16.F90: New file. * libgfortran/generated/_aimag_c10.F90: New file. * libgfortran/generated/_atanh_r16.F90: New file. * libgfortran/generated/_acosh_r4.F90: New file. * libgfortran/generated/_acosh_r8.F90: New file. * libgfortran/generated/_asinh_r4.F90: New file. * libgfortran/generated/_asinh_r8.F90: New file. * libgfortran/generated/_asinh_r16.F90: New file. * libgfortran/generated/_atanh_r4.F90: New file. * libgfortran/generated/_atanh_r8.F90: New file. * libgfortran/generated/_acosh_r10.F90: New file. * libgfortran/generated/misc_specifics.F90: New file. * libgfortran/generated/_aimag_c16.F90: New file. * libgfortran/generated/_atanh_r10.F90: New file. * gcc/testsuite/gfortran.fortran-torture/execute/specifics.f90: Add tests for using all possible intrinsics as actual arguments. * gcc/testsuite/gfortran.dg/specifics_1.f90: Add tests for using all possible intrinsics as actual arguments. * gcc/testsuite/gfortran.dg/specifics_2.f90: New file. * gcc/testsuite/gfortran.dg/specifics_3.f90: New file. From-SVN: r117534
2006-09-18re PR fortran/29060 (spread causes ICE in gfc_trans_array_constructor)Paul Thomas1-0/+17
2006-09-18 Paul Thomas <pault@gcc.gnu.org> PR fortran/29060 * iresolve.c (resolve_spread): Build shape for result if the source shape is available and dim and ncopies are constants. PR fortran/28817 PR fortran/21918 * trans-decl.c (generate_local_decl): Change from 'warning' to 'gfc_warning' to have line numbers correctly reported. 2006-09-18 Paul Thomas <pault@gcc.gnu.org> PR fortran/29060 * gfortran.dg/spread_shape_1.f90: New test. From-SVN: r117014
2006-07-30intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.Francois-Xavier Coudert1-2/+71
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT. (add_subroutines): Add LTIME, GMTIME and CHMOD. * intrinsic.h (gfc_check_access_func, gfc_check_chmod, gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift, gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod, gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub, gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes. * gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS, GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT. * iresolve.c (gfc_resolve_access, gfc_resolve_chmod, gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub, gfc_resolve_gmtime, gfc_resolve_ltime): New functions. * check.c (gfc_check_access_func, gfc_check_chmod, gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions. * trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function. (gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*. * intrinsics/date_and_time.c: Add functions for GMTIME and LTIME. * intrinsics/access.c: New file. * intrinsics/chmod.c: New file. * configure.ac: Add checks for <sys/wait.h>, access, fork,execl and wait. * Makefile.am: Add new files intrinsics/access.c and intrinsics/chmod.c. * configure: Regenerate. * config.h.in: Regenerate. * Makefile.in: Regenerate. * gcc/testsuite/gfortran.dg/chmod_3.f90: New test. * gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test. * gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test. * gcc/testsuite/gfortran.dg/lrshift_1.f90: New test. * gcc/testsuite/gfortran.dg/chmod_1.f90: New test. * gcc/testsuite/gfortran.dg/chmod_2.f90: New test. From-SVN: r115825
2006-07-26intrinsic.c (add_functions): Add INT2, SHORT, INT8, LONG, LSTAT, MCLOCK and ↵François-Xavier Coudert1-0/+74
MCLOCK8 intrinsic functions. * intrinsic.c (add_functions): Add INT2, SHORT, INT8, LONG, LSTAT, MCLOCK and MCLOCK8 intrinsic functions. (add_subroutines): Add LSTAT intrinsic subroutine. * gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_INT2, GFC_ISYM_INT8, GFC_ISYM_LONG, GFC_ISYM_LSTAT, GFC_ISYM_MCLOCK and GFC_ISYM_MCLOCK8. * iresolve.c (gfc_resolve_int2, gfc_resolve_int8, gfc_resolve_long, gfc_resolve_lstat, gfc_resolve_mclock, gfc_resolve_mclock8, gfc_resolve_lstat_sub): New functions. * check.c (gfc_check_intconv): New function. * trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for the added GFC_ISYM_*. * simplify.c (gfc_simplify_intconv, gfc_simplify_int2, gfc_simplify_int8, gfc_simplify_long): New functions. * intrinsic.h (gfc_check_intconv, gfc_simplify_int2, gfc_simplify_int8, gfc_simplify_long, gfc_resolve_int2, gfc_resolve_int8, gfc_resolve_long, gfc_resolve_lstat, gfc_resolve_mclock, gfc_resolve_mclock8, gfc_resolve_lstat_sub): Add prototypes. * gfortran.dg/mclock.f90: New test. * gfortran.dg/int_conv_1.f90: New test. * gfortran.dg/stat_1.f90: New test. * gfortran.dg/stat_2.f90: New test. * configure.ac: Check for function clock. * Makefile.am: Compile new file intrinsics/clock.c. * intrinsics/clock.c: New file. * Makefile.in: Regenerate. * configure: Regenerate. * config.h.in: Regenerate. * intrinsics/stat.c: Rename the old stat_i?_sub functions to helper functions stat_i?_sub_0, and use them for both STAT and LSTAT. From-SVN: r115754
2006-07-04intrinsic.c (add_subroutines): Add ITIME and IDATE.Francois-Xavier Coudert1-0/+20
* intrinsic.c (add_subroutines): Add ITIME and IDATE. * intrinsic.h (gfc_check_itime_idate,gfc_resolve_idate, fc_resolve_itime): New protos. * iresolve.c (gfc_resolve_itime, gfc_resolve_idate): New functions. * check.c (gfc_check_itime_idate): New function. * intrinsic.texi: Document the new intrinsics. * intrinsics/date_and_time.c (itime0,idate0,itime_i4,itime_i8, idate_i4,idate_i8): New functions. * gfortran.dg/itime_idate_1.f: New test. * gfortran.dg/itime_idate_2.f: New test. Co-Authored-By: Daniel Franke <franke.daniel@gmail.com> From-SVN: r115173
2006-07-03iresolve.c (gfc_resolve_cpu_time, [...]): Remove ATTRIBUTE_UNUSED for used ↵Francois-Xavier Coudert1-2/+2
argument. * iresolve.c (gfc_resolve_cpu_time, gfc_resolve_random_number): Remove ATTRIBUTE_UNUSED for used argument. From-SVN: r115152
2006-06-22re PR fortran/26769 (Implement transpose() and reshape() for real instead of ↵Francois-Xavier Coudert1-26/+8
using integer) PR libfortran/26769 * iresolve.c (gfc_resolve_reshape): Call reshape_r4 and reshape_r8 instead of reshape_4 and reshape_8. (gfc_resolve_transpose): Likewise for transpose. * Makefile.am: Add r4 and r8 versions of reshape and transpose. * Makefile.in: Regenerate. * generated/reshape_r4.c: New file. * generated/reshape_r8.c: New file. * generated/transpose_r4.c: New file. * generated/transpose_r8.c: New file. From-SVN: r114880
2006-05-21re PR fortran/25746 (Elemental assignment gives wrong result)Paul Thomas1-2/+60
2006-05-21 Paul Thomas <pault@gcc.gnu.org> PR fortran/25746 * interface.c (gfc_extend_assign): Use new code EXEC_ASSIGN_CALL. * gfortran.h : Put EXEC_ASSIGN_CALL in enum. * trans-stmt.c (gfc_conv_elemental_dependencies): New function. (gfc_trans_call): Call it. Add new boolian argument to flag need for dependency checking. Assert intent OUT and IN for arg1 and arg2. (gfc_trans_forall_1): Use new code EXEC_ASSIGN_CALL. trans-stmt.h : Modify prototype of gfc_trans_call. trans.c (gfc_trans_code): Add call for EXEC_ASSIGN_CALL. st.c (gfc_free_statement): Free actual for EXEC_ASSIGN_CALL. * dependency.c (gfc_check_fncall_dependency): Don't check other against itself. PR fortran/25090 * resolve.c : Remove resolving_index_expr. (entry_parameter): Remove. (gfc_resolve_expr, resolve_charlen, resolve_fl_variable): Remove calls to entry_parameter and references to resolving_index_expr. PR fortran/27584 * check.c (gfc_check_associated): Replace NULL assert with an error message, since it is possible to generate bad code that has us fall through to here.. PR fortran/19015 * iresolve.c (maxloc, minloc): If DIM is not present, pass the rank of ARRAY as the shape of the result. Otherwise, pass the shape of ARRAY, less the dimension DIM. (maxval, minval): The same, when DIM is present, otherwise no change. 2006-05-21 Paul Thomas <pault@gcc.gnu.org> PR fortran/25746 * gfortran.dg/elemental_subroutine_3.f90: New test. PR fortran/25090 * gfortran.dg/entry_dummy_ref_1.f90: Remove. PR fortran/27584 * gfortran.dg/associated_target_1.f90: New test. PR fortran/19015 * gfortran.dg/maxloc_shape_1.f90: New test. From-SVN: r113949
2006-04-22re PR fortran/26769 (Implement transpose() and reshape() for real instead of ↵Jakub Jelinek1-5/+6
using integer) PR fortran/26769 * iresolve.c (gfc_resolve_reshape): Use reshape_r16 for real(16). (gfc_resolve_transpose): Use transpose_r16 for real(16). * Makefile.am (i_transpose_c): Add generated/transpose_r16.c. (i_reshape_c): Add generated/reshape_r16.c. * Makefile.in: Regenerated. * generated/transpose_r16.c: Generated new file. * generated/redhape_r16.c: Generated new file. From-SVN: r113169
2006-04-03re PR testsuite/26981 (g++.old-deja/g++.other/init18.C fails)Paul Thomas1-0/+5
2006-04-03 Paul Thomas <pault@gcc.gnu.org> PR fortran/26981 * trans.h : Prototype for gfc_conv_missing_dummy. * trans-expr (gfc_conv_missing_dummy): New function (gfc_conv_function_call): Call it and tidy up some of the code. * trans-intrinsic (gfc_conv_intrinsic_function_args): The same. PR fortran/26976 * array.c (gfc_array_dimen_size): If available, return shape[dimen]. * resolve.c (resolve_function): If available, use the argument shape for the function expression. * iresolve.c (gfc_resolve_transfer): Set shape[0] = size. 2006-04-03 Paul Thomas <pault@gcc.gnu.org> PR fortran/26981 * gfortran.dg/missing_optional_dummy_1.f90: New test. PR fortran/26976 * gfortran.dg/compliant_elemental_intrinsics_1.f90: New test. * gfortran.dg/initialization_1.f90: Make assignment compliant. * gfortran.dg/transfer_array_intrinsic_1.f90: Simplify. * gfortran.dg/transfer_array_intrinsic_2.f90: Make assignments compliant and detect bigendian-ness. From-SVN: r112634
2006-03-25re PR fortran/26769 (Implement transpose() and reshape() for real instead of ↵Thomas Koenig1-4/+16
using integer) 2006-03-25 Thomas Koenig <Thomas.Koenig@online.de> PR fortran/26769 * iresolve.c (gfc_resolve_reshape): Remove doubling of kind for complex. For real(kind=10), call reshape_r10. (gfc_resolve_transpose): For real(kind=10), call transpose_r10. 2006-03-25 Thomas Koenig <Thomas.Koenig@online.de> PR fortran/26769 * Makefile.am: Add transpose_r10.c and reshape_r10.c. * aclocal.m4: Regenerate using aclocal 1.9.3. * Makefile.in: Regenerate using automake 1.9.3. * m4/iparm.m4 (rtype_ccode): If rtype_letter is `i', evaluate to rtype_kind, otherwise to rtype_code. * generated/transpose_r10.c: Add. * generated/reshape_r10.c: Add. 2006-03-25 Thomas Koenig <Thomas.Koenig@online.de> PR fortran/26769 * gfortran.dg/transpose_reshape_r10.f90: New test case. From-SVN: r112381