aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/intrinsic.c
AgeCommit message (Collapse)AuthorFilesLines
2015-07-09flags.h: Don't include flag-types.h or options.h.Andrew MacLeod1-1/+1
2015-07-09 Andrew MacLeod <amacleod@redhat.com> * flags.h: Don't include flag-types.h or options.h. * opts-common.c: Adjust includes. * opts-global.c: Likewise. * common/config/epiphany/epiphany-common.c: Likewise. c * c-array-notation.c: Adjust includes for flags.h changes. * c-objc-common.c: Likewise. c-family * c-common.h: Adjust includes for flags.h changes. * stub-objc.c: Likewise. fortran * arith.c: Adjust includes for flags.h changes. * array.c: Likewise. * check.c: Likewise. * decl.c: Likewise. * error.c: Likewise. * expr.c: Likewise. * frontend-passes.c: Likewise. * interface.c: Likewise. * intrinsic.c: Likewise. * io.c: Likewise. * match.c: Likewise. * openmp.c: Likewise. * parse.c: Likewise. * primary.c: Likewise. * resolve.c: Likewise. * scanner.c: Likewise. * simplify.c: Likewise. * symbol.c: Likewise. * target-memory.c: Likewise. jit * dummy-frontend.c: Adjust includes for flags.h changes. * jit-common.h: Likewise. * jit-playback.c: Likewise. lto * lto-lang.c: Adjust includes for flags.h changes. From-SVN: r225608
2015-06-06re PR fortran/47359 (Recursive functions of intrinsic names generates ↵Thomas Koenig1-10/+13
invalid assembler) 2015-06-06 Thomas Koenig <tkoenig@netcologne.de> PR fortran/47359 * arith.c (eval_intrinsic_op): Set warn flag for gfc_type_convert_binary if -Wconversion or -Wconversion-extra are set. (wprecision_real_real): New function. (wprecision_int_real): New function. (gfc_int2int): If -fno-range-check and -Wconversion are specified and it is a narrowing conversion, warn. (gfc_int2real): If there is a change in value for the conversion, warn. (gfc_int2complex): Likewise. (gfc_real2int): If there is a fractional part to the real number, warn with -Wconversion, otherwise warn with -Wconversion-extra. (gfc_real2real): Emit warning if the constant was changed by conversion with either -Wconversion or -Wconversion-extra. With -Wconversion-extra, warn if no warning was issued earlier. (gfc_real2complex): Likewise. (gfc_complex2int): For -Wconversion or -Wconversion-extra, if there was an imaginary part, warn; otherwise, warn for change in value. Warn with -Wconversion-extra if no other warning was issued. (gfc_complex2real): For -Wconversion or -Wconversion-extra, if there was an imaginary part, warn; otherwise, warn for change in value. Warn with -Wconversion-extra if no other warning was issued. (gfc_complex2complex): For -Wconversion, warn if the value of either the real or the imaginary part was changed. Warn for -Wconversion-extra if no prior warning was issued. * expr.c (gfc_check_assign): Remove check for change in value. * primary.c (match_real_constant): For -Wconversion-extra, check against a number in which the last non-zero digit has been replaced with a zero. If the number compares equal, warn. * intrinsic.c (gfc_convert_type_warn): Do not warn about constant conversions. 2015-06-06 Thomas Koenig <tkoenig@netcologne.de> PR fortran/47359 * gfortran.dg/array_constructor_type_17.f03: Adjust error message. * gfortran.dg/warn_conversion.f90: Add warning for change in value for assignment. * gfortran.dg/warn_conversion_3.f90: Add warnings. * gfortran.dg/warn_conversion_5.f90: New test. * gfortran.dg/warn_conversion_6.f90: New test. * gfortran.dg/warn_conversion_7.f90: New test. From-SVN: r224190
2015-05-06re PR fortran/37131 (inline matmul for small matrix sizes)Thomas Koenig1-1/+46
2015-05-06 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/37131 * gfortran.h (gfc_isym_id): Add GFC_ISYM_FE_RUNTIME_ERROR. (gfc_intrinsic_sym): Add vararg. * intrinsic.h (gfc_check_fe_runtime_error): Add prototype. (gfc_resolve_re_runtime_error): Likewise. Add prototype for gfc_is_reallocatable_lhs. * trans-array.h (gfc_is_reallocatable_lhs): Remove prototype. * check.c (gfc_check_fe_runtime_error): New function. * intrinsic.c (add_sym_1p): New function. (make_vararg): New function. (add_subroutines): Add fe_runtime_error. (gfc_intrinsic_sub_interface): Skip sorting for variable number of arguments. * iresolve.c (gfc_resolve_fe_runtime_error): New function. * lang.opt (inline-matmul-limit): New option. (gfc_post_options): If no inline matmul limit has been set and BLAS is called externally, use the BLAS limit. * frontend-passes.c: Include intrinsic.h. (var_num): New global counter for naming temporary variablbles. (matrix_case): Enum for differentiating the different matmul cases. (realloc_string_callback): Add "trim" to the variable name. (create_var): Add optional argument vname as part of the name. Use var_num. Set dimension of result correctly. Split off block creation into (insert_block): New function. (cfe_expr_0): Use "fcn" as part of temporary variable name. (optimize_namesapce): Also set gfc_current_ns. Call inline_matmul_assign. (combine_array_constructor): Use "constr" as part of temporary name. (get_array_inq_function): New function. (build_logical_expr): New function. (get_operand): new function. (inline_limit_check): New function. (runtime_error_ne): New function. (matmul_lhs_realloc): New function. (is_functino_or_op): New function. (has_function_or_op): New function. (freeze_expr): New function. (freeze_references): New function. (convert_to_index_kind): New function. (create_do_loop): New function. (get_size_m1): New function. (scalarized_expr): New function. (inline_matmul_assign): New function. * simplify.c (simplify_bound): Simplify the case of the lower bound of an assumed-shape argument. 2015-05-06 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/37131 * gfortran.dg/dependency_26.f90: Add option to suppress inlining matmul. * gfortran.dg/function_optimize_1.f90: Likewise. * gfortran.dg/function_optimize_2.f90: Likewise. * gfortran.dg/function_optimize_5.f90: Likewise. * gfortran.dg/function_optimize_7.f90: Likewise. * gfortran.dg/inline_matmul_1.f90: New test. * gfortran.dg/inline_matmul_2.f90: New test. * gfortran.dg/inline_matmul_3.f90: New test. * gfortran.dg/inline_matmul_4.f90: New test. * gfortran.dg/inline_matmul_5.f90: New test. * gfortran.dg/inline_matmul_6.f90: New test. From-SVN: r222864
2015-02-01Always pass 0 or option number to gfc_warning*.Joseph Myers1-2/+2
Similar to the issue with fatal_error that I fixed in <https://gcc.gnu.org/ml/gcc-patches/2015-01/msg02690.html>, the overloads of gfc_warning and gfc_warning_now (with and without a first argument for an option number) also break gcc.pot regeneration because xgettext expects the translated string argument to be in a fixed position for a given function name. This patch applies the corresponding fix of always passing a first argument (option number or 0), just like the core diagnostic functions warning and warning_at, and removing the problem overloads without it. Bootstrapped with no regressions on x86_64-unknown-linux-gnu. * error.c (gfc_warning (const char *, ...), gfc_warning_now (const char *, ...)): Remove functions. * gfortran.h (gfc_warning (const char *, ...), gfc_warning_now (const char *, ...)): Remove declarations. * arith.c, check.c, data.c, decl.c, frontend-passes.c, interface.c, intrinsic.c, io.c, matchexp.c, module.c, openmp.c, options.c, parse.c, primary.c, resolve.c, scanner.c, symbol.c, trans-common.c, trans-const.c, trans-stmt.c: All callers of gfc_warning and gfc_warning_now changed to pass 0 or option number as first argument. From-SVN: r220313
2015-01-05Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r219188
2014-12-16re PR fortran/54687 (Use gcc option machinery for gfortran)Tobias Burnus1-3/+2
2014-12-16 Tobias Burnus <burnus@net-b.de> PR fortran/54687 * gfortran.h (gfc_option_t): Remove flags which now have a Var(). * lang.opt (flag-aggressive_function_elimination, flag-align_commons, flag-all_intrinsics, flag-allow_leading_underscore, flag-automatic, flag-backslash, flag-backtrace, flag-blas_matmul_limit, flag-cray_pointer, flag-dollar_ok, flag-dump_fortran_original, flag-dump_fortran_optimized, flag-external_blas, flag-f2c, flag-implicit_none, flag-max_array_constructor, flag-module_private, flag-pack_derived, flag-range_check, flag-recursive, flag-repack_arrays, flag-sign_zero, flag-underscoring): Add Var() and, where applicable, Enum(). * options.c (gfc_init_options, gfc_post_options, gfc_handle_option): Update for *.opt changes. * arith.c: Update for flag-variable name changes. * array.c: Ditto. * cpp.c: Ditto. * decl.c: Ditto. * expr.c: Ditto. * f95-lang.c: Ditto. * frontend-passes.c: Ditto. * intrinsic.c: Ditto. * io.c: Ditto. * match.c: Ditto. * module.c: Ditto. * parse.c: Ditto. * primary.c: Ditto. * resolve.c: Ditto. * scanner.c: Ditto. * simplify.c: Ditto. * symbol.c: Ditto. * trans-array.c: Ditto. * trans-common.c: Ditto. * trans-decl.c: Ditto. * trans-expr.c: Ditto. * trans-intrinsic.c: Ditto. * trans-openmp.c: Ditto. * trans-types.c: Ditto. From-SVN: r218792
2014-12-13error.c (gfc_error): Add variant which takes a va_list.Tobias Burnus1-1/+1
2014-12-13 Tobias Burnus <burnus@net-b.de> Manuel López-Ibáñez <manu@gcc.gnu.org> fortran/ * error.c (gfc_error): Add variant which takes a va_list. (gfc_notify_std): Convert to common diagnostic. * array.c: Use %qs, %<...%> in more gfc_error calls and for gfc_notify_std. * check.c: Ditto. * data.c: Ditto. * decl.c: Ditto. * expr.c: Ditto. * interface.c: Ditto. * intrinsic.c: Ditto. * io.c: Ditto. * match.c: Ditto. * matchexp.c: Ditto. * module.c: Ditto. * openmp.c: Ditto. * parse.c: Ditto. * primary.c: Ditto. * resolve.c: Ditto. * simplify.c: Ditto. * symbol.c: Ditto. * trans-common.c: Ditto. * trans-intrinsic.c: Ditto. gcc/testsuite/ * gfortran.dg/realloc_on_assign_21.f90: Update dg-error. * gfortran.dg/warnings_are_errors_1.f: Ditto. * gfortran.dg/warnings_are_errors_1.f90: Ditto. Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org> From-SVN: r218694
2014-12-11re PR fortran/44054 (Handle -Werror, -Werror=, -fdiagnostics-show-option, ↵Manuel López-Ibáñez1-7/+7
!GCC$ diagnostic (pragmas) and color) gcc/ChangeLog: 2014-12-11 Manuel López-Ibáñez <manu@gcc.gnu.org> PR fortran/44054 * diagnostic.c (diagnostic_action_after_output): Make it extern. Take diagnostic_t argument instead of diagnostic_info. Count also DK_WERROR towards max_errors. (diagnostic_report_diagnostic): Update call according to the above. (error_recursion): Likewise. * diagnostic.h (diagnostic_action_after_output): Declare. * pretty-print.c (pp_formatted_text_data): Delete. (pp_append_r): Call output_buffer_append_r. (pp_formatted_text): Call output_buffer_formatted_text. (pp_last_position_in_text): Call output_buffer_last_position_in_text. * pretty-print.h (output_buffer_formatted_text): New. (output_buffer_append_r): New. (output_buffer_last_position_in_text): New. gcc/fortran/ChangeLog: 2014-12-11 Manuel López-Ibáñez <manu@gcc.gnu.org> PR fortran/44054 * error.c (pp_error_buffer): New static variable. (pp_warning_buffer): Make it a pointer. (gfc_output_buffer_empty_p): New. (gfc_error_init_1): Call gfc_buffer_error. (gfc_buffer_error): Do not use pp_warning_buffer.flush_p as the buffered_p flag. (gfc_clear_warning): Likewise. (gfc_warning_check): Call gfc_clear_warning. Only check the new pp_warning_buffer if the old warning_buffer was empty. Call diagnostic_action_after_output. (gfc_error_1): Renamed from gfc_error. (gfc_error): New. (gfc_clear_error): Clear also pp_error_buffer. (gfc_error_flag_test): Check also pp_error_buffer. (gfc_error_check): Likewise. Only check the new pp_error_buffer if the old error_buffer was empty. (gfc_move_output_buffer_from_to): New. (gfc_push_error): Use it here. Take also an output_buffer as argument. (gfc_pop_error): Likewise. (gfc_free_error): Likewise. (gfc_diagnostics_init): Use XNEW and placement-new to init pp_error_buffer and pp_warning_buffer. Set flush_p to false for both pp_warning_buffer and pp_error_buffer. * Update gfc_push_error, gfc_pop_error and gfc_free_error calls according to the above changes. * Use gfc_error_1 for all gfc_error calls that use multiple locations. * Use %qs instead of '%s' for many gfc_error calls. From-SVN: r218627
2014-12-03re PR fortran/44054 (Handle -Werror, -Werror=, -fdiagnostics-show-option, ↵Manuel López-Ibáñez1-3/+5
!GCC$ diagnostic (pragmas) and color) gcc/testsuite/ChangeLog: 2014-12-03 Manuel López-Ibáñez <manu@gcc.gnu.org> PR fortran/44054 * gfortran.dg/warnings_are_errors_1.f90: Update warnings to errors. * gfortran.dg/warnings_are_errors_1.f: Likewise. gcc/fortran/ChangeLog: 2014-12-03 Manuel López-Ibáñez <manu@gcc.gnu.org> PR fortran/44054 * gfortran.h (gfc_warning): Now returns bool. Add overload that accepts opt. (gfc_warning_1): Declare. * error.c (pp_warning_buffer,warningcount_buffered,werrorcount_buffered): New. (gfc_buffer_error): Set pp_warning_buffer.flush_p. (gfc_clear_pp_buffer): New. (gfc_warning_1): Renamed from gfc_warning. (gfc_warning): Add three new overloads. One that takes just a format string and ellipsis, another that takes also a warning option, and another that takes also va_list instead of ellipsis. (gfc_clear_warning): Clear pp_warning_buffer. (gfc_warning_check): Flush pp_warning_buffer and update warning and werror counters. (gfc_diagnostics_init): Init pp_warning_buffer. * Update all gfc_warning calls that do not multiple locations to use %qs and OPT_W*, otherwise use gfc_warning_1. gcc/ChangeLog: 2014-12-03 Manuel López-Ibáñez <manu@gcc.gnu.org> PR fortran/44054 * pretty-print.c (output_buffer::output_buffer): Init flush_p to true. (pp_flush): Flush only if flush_p. (pp_really_flush): New. * pretty-print.h (struct output_buffer): Add flush_p. (pp_really_flush): Declare. From-SVN: r218326
2014-11-30gfortran.h (gfc_option_t): Remove warn_aliasing,Tobias Burnus1-1/+1
2014-11-30 Tobias Burnus <burnus@net-b.de> * gfortran.h (gfc_option_t): Remove warn_aliasing, * warn_ampersand, warn_function_elimination, warn_implicit_interface, warn_implicit_procedure, warn_line_truncation, warn_surprising, warn_underflow, warn_intrinsic_shadow, warn_array_temp, warn_align_commons, warn_real_q_constant, warn_unused_dummy_argument, warn_zerotrip, warn_realloc_lhs, warn_realloc_lhs_all, warn_compare_reals, warn_target_lifetime. * arith.c (check_result, gfc_real2real, gfc_real2complex, gfc_complex2real, gfc_complex2complex): Honor changed variable names. * check.c (gfc_check_transfer): Ditto. * expr.c (gfc_check_assign, gfc_check_pointer_assign): Ditto. * interface.c (compare_parameter, gfc_procedure_use, * gfc_ppc_use, gfc_arglist_matches_symbol): Ditto. * intrinsic.c (gfc_warn_intrinsic_shadow): Ditto. * primary.c (match_real_constant, match_string_constant): Ditto. * resolve.c (gfc_resolve_intrinsic, resolve_operator, gfc_resolve_iterator, resolve_select, resolve_ordinary_assign, resolve_charlen, gfc_resolve_finalizers): Ditto. * scanner.c (gfc_next_char_literal): Ditto. * simplify.c (simplify_achar_char, gfc_simplify_iachar): Ditto. * trans-array.c (gfc_trans_create_temp_array, gfc_trans_dummy_array_bias, gfc_conv_array_parameter): Ditto. * trans-common.c (translate_common): * trans-decl.c (generate_local_decl): Ditto. * trans-expr.c (realloc_lhs_warning): Ditto. * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Ditto. * decl.c (do_warn_intrinsic_shadow): Ditto. Renamed from warn_intrinsic_shadow. * frontend-passes.c (do_warn_function_elimination): Honor changed variable names. Renamed from do_warn_function_elimination. * invoke.texi (Wunderflow): Document that it is enabled by * default. * lang.opt (Waliasing, Walign-commons, Warray-temporaries, Wcompare-reals, Wfunction-elimination, Wimplicit-interface, Wimplicit-procedure, Wline-truncation, Wreal-q-constant, Wrealloc-lhs, Wrealloc-lhs-all, Wtarget-lifetime, Wsurprising, Wunderflow, Wintrinsic-shadow, Wunused-dummy-argument, Wzerotrip): Use Var(), add Init() and LangEnabledBy() were required. (Wmaybe-uninitialized, Wreturn-type, Wuninitialized): Add LangEnabledBy. * options.c (gfc_init_options, gfc_post_options, * gfc_handle_option): Remove options handled in lang.opt; handle renaming. (set_Wall, set_Wextra): Remove. From-SVN: r218188
2014-11-25error.c (gfc_internal_error): Convert to common diagnostics.Tobias Burnus1-3/+3
2014-11-25 Tobias Burnus <burnus@net-b.de> * error.c (gfc_internal_error): Convert to common diagnostics. * interface.c (gfc_find_sym_in_symtree): Use %qs. * intrinsic.c (make_generic, gfc_check_intrinsic_standard, gfc_convert_type_warn): Ditto. * module.c (write_symbol): Ditto. * symbol.c (gfc_get_default_type): Ditto; use fatal instead of internal error. * trans-array.c (gfc_walk_subexpr): Replace internal_error by gfc_internal_error. * trans-decl.c (gfc_get_symbol_decl, (gfc_create_module_variable): Ditto. Use %qs. * trans-intrinsic.c (gfc_conv_intrinsic_lib_function): Ditto. * trans-io.c (transfer_expr): Ditto. * trans-openmp.c (gfc_trans_omp_workshare): Ditto. * trans.c (trans_code): Ditto. From-SVN: r218068
2014-11-25gfortran.h (gfc_option_t): Remove flags moved as Var to .opt.Tobias Burnus1-19/+17
2014-11-25 Tobias Burnus <burnus@net-b.de> gcc/fortran/ * gfortran.h (gfc_option_t): Remove flags moved as Var to .opt. (gfc_error_now_1): Renamed from gfc_error_now. (gfc_error_now): Renamed from gfc_error_now_2. (gfc_warning_now_1): Renamed from gfc_warning_now. (gfc_warning_now): Renamed from gfc_warning_now_2. * error.c (gfc_error_now_1): Renamed from gfc_error_now. (gfc_error_now): Renamed from gfc_error_now_2. (gfc_warning_now_1): Renamed from gfc_warning_now. (gfc_warning_now): Renamed from gfc_warning_now_2. (gfc_get_errors): Include common diagnostic in count. * lang.opt (Wc-binding-type, Wconversion, Wconversion-extra, Wintrinsics-std): Create a Var for those warnings. * check.c (gfc_check_cmplx): Pass warning flag to diagnostic function. * decl.c (get_proc_name, gfc_verify_c_interop_param, build_sym gfc_set_constant_character_len, verify_bind_c_sym): Ditto; use _1 for old diagnostic, remove _2 for new diagnostic. * expr.c (gfc_check_assign, gfc_check_vardef_context): Ditto. * frontend-passes.c (doloop_code, do_function): Ditto. * intrinsic.c (gfc_is_intrinsic, gfc_convert_type_warn): Ditto. * match.c (gfc_match_common): Ditto. * module.c (use_iso_fortran_env_module, gfc_use_module): Ditto. * parse.c (decode_statement, decode_gcc_attribute, next_free, next_fixed, gfc_check_do_variable): Ditto. * resolve.c (resolve_common_vars, resolve_ordinary_assign): Ditto. * scanner.c (add_path_to_list, skip_free_comments, gfc_next_char_literal, gfc_gobble_whitespace, load_line, preprocessor_line, load_file): Ditto. * symbol.c (gfc_set_default_type, verify_bind_c_derived_type): Ditto. * options.c (gfc_post_options): Ditto. (gfc_init_options, set_Wall, gfc_handle_option): Ditto; remove flags which now have a Var. * invoke.texi (Wconversion-extra): Make clear that the flag does not imply -Wconversion. gcc/testsuite/ * gfortran.dg/empty_label.f: Change test to continue testing for -fmax-errors=1. * gfortran.dg/empty_label.f90: Ditto. * gfortran.dg/warnings_are_errors_1.f90: Update dg-*. From-SVN: r218067
2014-09-25check.c (check_co_collective): Renamed fromTobias Burnus1-0/+18
2014-09-25 Tobias Burnus <burnus@net-b.de> gcc/fortran * check.c (check_co_collective): Renamed from * check_co_minmaxsum, handle co_reduce. (gfc_check_co_minmax, gfc_check_co_sum): Update call. (gfc_check_co_broadcast, gfc_check_co_reduce): New. * gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_BROADCAST and GFC_ISYM_CO_REDUCE. * intrinsic.c (add_subroutines): Add co_reduce and co_broadcast. * intrinsic.h (gfc_check_co_broadcast, gfc_check_co_reduce): Add proto types. * intrinsic.texi (CO_BROADCAST): Add. * trans.h (gfor_fndecl_co_broadcast): New. * trans-decl.c (gfor_fndecl_co_broadcast): Ditto. (gfc_build_builtin_function_decls): Add decl for it, * trans-intrinsic.c (conv_co_collective): Renamed from conv_co_minmaxsum. Handle co_reduce. (gfc_conv_intrinsic_subroutine): Handle co_reduce. gcc/testsuite/ * gfortran.dg/coarray/collectives_3.f90: New. * gfortran.dg/coarray_collectives_9.f90: New. * gfortran.dg/coarray_collectives_10.f90: New. * gfortran.dg/coarray_collectives_11.f90: New. * gfortran.dg/coarray_collectives_12.f90: New. libgfortran/ * caf/libcaf.h (_gfortran_caf_co_broadcast): New prototype. * caf/single.c (_gfortran_caf_co_broadcast): New. From-SVN: r215579
2014-07-26check.c (gfc_check_sizeof): Permit for assumed type if and only if it has an ↵Tobias Burnus1-2/+4
array descriptor. 2014-07-26 Tobias Burnus <burnus@net-b.de> * check.c (gfc_check_sizeof): Permit for assumed type if and only if it has an array descriptor. * intrinsic.c (do_ts29113_check): Permit SIZEOF. (add_functions): SIZEOF is an Inquiry function. * intrinsic.texi (SIZEOF): Add note that only contiguous arrays are permitted. * trans-expr.c (gfc_conv_intrinsic_to_class): Handle assumed rank. * trans-intrinsic.c (gfc_conv_intrinsic_sizeof): Handle assumed type + array descriptor, CLASS and assumed rank. (gfc_conv_intrinsic_storage_size): Handle class arrays. 2014-07-26 Tobias Burnus <burnus@net-b.de> * gfortran.dg/sizeof_2.f90: Change dg-error. * gfortran.dg/sizeof_4.f90: New. * gfortran.dg/storage_size_1.f08: Correct expected value. From-SVN: r213079
2014-07-12check.c (gfc_check_atomic): Update for STAT=.Tobias Burnus1-4/+75
gcc/fortran/ 2014-07-12 Tobias Burnus <burnus@net-b.de> * check.c (gfc_check_atomic): Update for STAT=. (gfc_check_atomic_def, gfc_check_atomic_ref): Update call. (gfc_check_atomic_op, gfc_check_atomic_cas, gfc_check_atomic_fetch_op): New. * gfortran.h (gfc_isym_id): GFC_ISYM_ATOMIC_CAS, * GFC_ISYM_ATOMIC_ADD, GFC_ISYM_ATOMIC_AND, GFC_ISYM_ATOMIC_OR, GFC_ISYM_ATOMIC_XOR, GFC_ISYM_ATOMIC_FETCH_ADD, GFC_ISYM_ATOMIC_FETCH_AND, GFC_ISYM_ATOMIC_FETCH_OR and GFC_ISYM_ATOMIC_FETCH_XOR. * intrinsic.c (add_subroutines): Handle them. * intrinsic.texi: Add documentation for them. (ATOMIC_REF, ATOMIC_DEFINE): Add STAT=. (ISO_FORTRAN_ENV): Add STAT_FAILED_IMAGE. * intrinsic.h (gfc_check_atomic_op, gfc_check_atomic_cas, gfc_check_atomic_fetch_op): New prototypes. * libgfortran.h (libgfortran_stat_codes): Add * GFC_STAT_FAILED_IMAGE. * iso-fortran-env.def: Add it. * trans-intrinsic.c (conv_intrinsic_atomic_op): Renamed from conv_intrinsic_atomic_ref; handle more atomics. (conv_intrinsic_atomic_def): Handle STAT=. (conv_intrinsic_atomic_cas): New. (gfc_conv_intrinsic_subroutine): Handle new atomics. gcc/testsuite/ 2014-07-12 Tobias Burnus <burnus@net-b.de> * gfortran.dg/coarray_atomic_1.f90: Update dg-error. * gfortran.dg/coarray_atomic_2.f90: New. * gfortran.dg/coarray_atomic_3.f90: New. * gfortran.dg/coarray_atomic_4.f90: New. * gfortran.dg/coarray/atomic_2.f90: New. From-SVN: r212483
2014-05-25check.c (gfc_check_num_images): New.Tobias Burnus1-5/+8
2014-05-25 Tobias Burnus <burnus@net-b.de> * check.c (gfc_check_num_images): New. (gfc_check_this_image): Handle distance argument. * intrinsic.c (add_functions): Update this_image and num_images for new distance and failed arguments. * intrinsic.texi (THIS_IMAGE, NUM_IMAGES): Document the new arguments. * intrinsic.h (gfc_check_num_images): New. (gfc_check_this_image, gfc_simplify_num_images, gfc_simplify_this_image, gfc_resolve_this_image): Update prototype. * iresolve.c (gfc_resolve_this_image): Handle distance argument. * simplify.c (gfc_simplify_num_images, gfc_simplify_this_image): Handle new arguments. * trans-intrinsic.c (trans_this_image, trans_num_images): Ditto. (gfc_conv_intrinsic_function): Update trans_num_images call. 2014-05-25 Tobias Burnus <burnus@net-b.de> * gfortran.dg/coarray_10.f90: Update dg-warning. * gfortran.dg/coarray_this_image_1.f90: New. * gfortran.dg/coarray_this_image_2.f90: New. From-SVN: r210909
2014-05-08gfortran.h (gfc_isym_id): Add GFC_ISYM_CAF_GET and GFC_ISYM_CAF_SEND.Tobias Burnus1-1/+17
2014-05-08 Tobias Burnus <burnus@net-b.de> * gfortran.h (gfc_isym_id): Add GFC_ISYM_CAF_GET and GFC_ISYM_CAF_SEND. * intrinsic.c (add_functions): Add only internally accessible caf_get and caf_send functions. * resolve.c (add_caf_get_intrinsic, remove_caf_get_intrinsic): New functions. (resolve_variable): Resolve expression rank and prepare for add_caf_get_intrinsic call. (gfc_resolve_expr): For variables, remove rank resolution. (resolve_ordinary_assign): Prepare call to GFC_ISYM_CAF_SEND. (resolve_code): Avoid call to GFC_ISYM_CAF_GET for the LHS of an assignment. From-SVN: r210225
2014-05-08check.c (check_co_minmaxsum, [...]): New.Tobias Burnus1-3/+29
gcc/fortran/ 2014-05-08 Tobias Burnus <burnus@net-b.de> * check.c (check_co_minmaxsum, gfc_check_co_minmax, gfc_check_co_sum): New. * error.c (gfc_notify_std): Update -std=f2008ts. * gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX, GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM. * intrinsic.h (gfc_check_co_minmax, gfc_check_co_sum): Declare. * intrinsic.c (add_subroutines): Add co_min, co_max and co_sum. (gfc_check_intrinsic_standard): Update text for -std=f2008ts. * intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document them. * invoke.texi (-std=f2008ts): Update wording. * trans.h (gfor_fndecl_co_max, gfor_fndecl_co_min, gfor_fndecl_co_sum): Define. * trans-decl.c (gfor_fndecl_co_max, gfor_fndecl_co_min, gfor_fndecl_co_sum): Define. (gfc_build_builtin_function_decls): Assign to it. * trans-intrinsic.c (conv_co_minmaxsum): New. (gfc_conv_intrinsic_subroutine): Call it. libgfortran/ 2014-05-08 Tobias Burnus <burnus@net-b.de> * caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum, _gfortran_caf_co_min, _gfortran_caf_co_max): Declare * caf/single.c gcc/testsuite/ 2014-05-08 Tobias Burnus <burnus@net-b.de> * gfortran.dg/coarray_collectives_1.f90: New. * gfortran.dg/coarray_collectives_2.f90: New. * gfortran.dg/coarray_collectives_3.f90: New. * gfortran.dg/coarray_collectives_4.f90: New. * gfortran.dg/coarray_collectives_5.f90: New. * gfortran.dg/coarray_collectives_6.f90: New. * gfortran.dg/coarray/collectives_1.f90: New. * gfortran.dg/assumed_rank_5.f90: Update dg-error. * gfortran.dg/assumed_type_4.f90: Update dg-error. * gfortran.dg/bind_c_array_params.f03: Update dg-error. * gfortran.dg/bind_c_usage_28.f90: Update dg-error. * gfortran.dg/c_funloc_tests_5.f03: Update dg-error. * gfortran.dg/c_funloc_tests_6.f90: Update dg-error. * gfortran.dg/c_loc_tests_11.f03: Update dg-error. From-SVN: r210223
2014-03-19re PR fortran/60543 (Function with side effect removed by the optimizer.)Tobias Burnus1-1/+4
2014-03-18 Tobias Burnus <burnus@net-b.de> PR fortran/60543 PR fortran/60283 * gfortran.h (gfc_unset_implicit_pure): New prototype. * resolve.c (gfc_unset_implicit_pure): New. (resolve_structure_cons, resolve_function, pure_subroutine): Use it. * decl.c (match_old_style_init, gfc_match_data, match_pointer_init, variable_decl): Ditto. * expr.c (gfc_check_pointer_assign): Ditto. * intrinsic.c (gfc_intrinsic_sub_interface): Ditto. * io.c (match_vtag, gfc_match_open, gfc_match_close, match_filepos, gfc_match_inquire, gfc_match_print, gfc_match_wait): Ditto. * match.c (gfc_match_critical, gfc_match_stopcode, lock_unlock_statement, sync_statement, gfc_match_allocate, gfc_match_deallocate): Ditto. * parse.c (decode_omp_directive): Ditto. * symbol.c (gfc_add_save): Ditto. 2014-03-18 Tobias Burnus <burnus@net-b.de> PR fortran/60543 PR fortran/60283 * gfortran.dg/implicit_pure_4.f90: New. From-SVN: r208687
2014-01-02Update copyright years in gcc/Richard Sandiford1-1/+1
From-SVN: r206289
2013-09-02PR fortran/PR56519Thomas Koenig1-0/+7
2013-09-02 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/PR56519 * gfortran.h: Declare gfc_do_concurrent_flag as extern. * resolve.c: Rename do_concurrent_flag to gfc_do_concurrent_flag and make non-static. (resolve_function): Use gfc_do_concurrent_flag instead of do_concurrent_flag. (pure_subroutine): Likewise. (resolve_code): Likewise. (resolve_types): Likewise. * intrinsic.c (gfc_intrinsic_sub_interface): Raise error for non-pure intrinsic subroutines within DO CONCURRENT. 2013-09-02 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/PR56519 * gfortran.dg/do_concurrent_3.f90: New test case. From-SVN: r202188
2013-05-27expr.c (gfc_build_intrinsic_call): Make symbol asTobias Burnus1-1/+2
2013-05-27 Tobias Burnus <burnus@net-b.de> * expr.c (gfc_build_intrinsic_call): Make symbol as * attr.artificial. * intrinsic.c (gfc_is_intrinsic): Disable std check for those. From-SVN: r199355
2013-05-22re PR fortran/57338 (ICE with assumed rank)Tobias Burnus1-11/+30
2013-05-22 Tobias Burnus <burnus@net-b.de> PR fortran/57338 * intrinsic.c (do_check): Move some checks to ... (do_ts29113_check): ... this new function. (check_specific, gfc_intrinsic_sub_interface): Call it. 2013-05-22 Tobias Burnus <burnus@net-b.de> PR fortran/57338 * gfortran.dg/assumed_type_6.f90: New. From-SVN: r199192
2013-05-21re PR fortran/57035 (TS29113's C535b: Wrongly accept DIMENSION(..) to TRANSFER)Tobias Burnus1-0/+56
2013-05-21 Tobias Burnus <burnus@net-b.de> PR fortran/57035 * intrinsic.c (do_check): Add contraint check for NO_ARG_CHECK, assumed rank and assumed type. * gfortran.texi (NO_ARG_CHECK): Minor wording change, allow PRESENT intrinsic. 2013-05-21 Tobias Burnus <burnus@net-b.de> PR fortran/57035 * gfortran.dg/assumed_type_5.f90: New. * gfortran.dg/assumed_rank_1.f90: Comment invalid statement. * gfortran.dg/assumed_rank_2.f90: Ditto. * gfortran.dg/assumed_type_3.f90: Update dg-error. * gfortran.dg/no_arg_check_3.f90: Ditto. From-SVN: r199158
2013-04-16re PR fortran/56969 (ISO_C_BINDING regression with current trunk)Tobias Burnus1-1/+2
2013-04-16 Tobias Burnus <burnus@net-b.de> PR fortran/56969 * intrinsic.c (gfc_intrinsic_func_interface): Don't set module name to "(intrinsic)" for intrinsics from intrinsic modules. 2013-04-16 Tobias Burnus <burnus@net-b.de> PR fortran/56969 * gfortran.dg/c_assoc_5.f90: New. From-SVN: r198000
2013-04-11Replace enum gfc_try with bool type.Janne Blomqvist1-89/+86
2013-04-11 Janne Blomqvist <jb@gcc.gnu.org> * gfortran.h: Remove enum gfc_try, replace gfc_try with bool type. * arith.c: Replace gfc_try with bool type. * array.c: Likewise. * check.c: Likewise. * class.c: Likewise. * cpp.c: Likewise. * cpp.h: Likewise. * data.c: Likewise. * data.h: Likewise. * decl.c: Likewise. * error.c: Likewise. * expr.c: Likewise. * f95-lang.c: Likewise. * interface.c: Likewise. * intrinsic.c: Likewise. * intrinsic.h: Likewise. * io.c: Likewise. * match.c: Likewise. * match.h: Likewise. * module.c: Likewise. * openmp.c: Likewise. * parse.c: Likewise. * parse.h: Likewise. * primary.c: Likewise. * resolve.c: Likewise. * scanner.c: Likewise. * simplify.c: Likewise. * symbol.c: Likewise. * trans-intrinsic.c: Likewise. * trans-openmp.c: Likewise. * trans-stmt.c: Likewise. * trans-types.c: Likewise. From-SVN: r197682
2013-03-312013-03-31 Tobias Burnus <burnus@net-b.de>Tobias Burnus1-4/+4
* class.c (finalization_scalarizer, * finalizer_insert_packed_call, generate_finalization_wrapper): Avoid segfault with absent SIZE= argment to TRANSFER and use correct result kind for SIZE. * intrinsic.c (gfc_isym_id_by_intmod): Also handle ids of nonmodules. * trans.c (gfc_build_final_call): Handle coarrays. From-SVN: r197281
2013-03-27re PR fortran/56650 (Odd error messages with C_SIZEOF for valid code)Tobias Burnus1-3/+4
2013-03-27 Tobias Burnus <burnus@net-b.de> PR fortran/56650 PR fortran/36437 * check.c (gfc_check_sizeof, gfc_check_c_sizeof, gfc_check_storage_size): Update checks. * intrinsic.texi (SIZEOF): Correct class. * intrinsic.h (gfc_simplify_sizeof, gfc_simplify_storage_size): New prototypes. * intrinsic.c (add_functions): Use them. * simplify.c (gfc_simplify_sizeof, gfc_simplify_storage_size): New functions. 2013-03-27 Tobias Burnus <burnus@net-b.de> PR fortran/56650 PR fortran/36437 * gfortran.dg/sizeof_2.f90: New. * gfortran.dg/sizeof_3.f90: New. * gfortran.dg/sizeof_proc.f90: Update dg-error. From-SVN: r197159
2013-03-25re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going ↵Tobias Burnus1-7/+100
through expr->ref) 2013-03-25 Tobias Burnus <burnus@net-b.de> PR fortran/38536 PR fortran/38813 PR fortran/38894 PR fortran/39288 PR fortran/40963 PR fortran/45824 PR fortran/47023 PR fortran/47034 PR fortran/49023 PR fortran/50269 PR fortran/50612 PR fortran/52426 PR fortran/54263 PR fortran/55343 PR fortran/55444 PR fortran/55574 PR fortran/56079 PR fortran/56378 * check.c (gfc_var_strlen): Properly handle 0-sized string. (gfc_check_c_sizeof): Use is_c_interoperable, add checks. (is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer, gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New functions. * expr.c (check_inquiry): Add c_sizeof, compiler_version and compiler_options. (gfc_check_pointer_assign): Refine function result check. gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED, GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC, GFC_ISYM_C_LOC. (iso_fortran_env_symbol, iso_c_binding_symbol): Handle NAMED_SUBROUTINE. (generate_isocbinding_symbol): Update prototype. (get_iso_c_sym): Remove. (gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes. * intrinsic.c (gfc_intrinsic_subroutine_by_id): New function. (gfc_intrinsic_sub_interface): Use it. (add_functions, add_subroutines): Add missing C-binding intrinsics. (gfc_intrinsic_func_interface): Add special case for c_loc. gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions. (gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them. * intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer, gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc, gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes. * iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New functions. * iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and NAMED_FUNCTION. * iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness. * module.c (create_intrinsic_function): Support subroutines and derived-type results. (use_iso_fortran_env_module): Update calls. (import_iso_c_binding_module): Ditto; update calls to generate_isocbinding_symbol. * resolve.c (find_arglists): Skip for intrinsic symbols. (gfc_resolve_intrinsic): Find intrinsic subs via id. (is_scalar_expr_ptr, gfc_iso_c_func_interface, set_name_and_label, gfc_iso_c_sub_interface): Remove. (resolve_function, resolve_specific_s0): Remove calls to those. (resolve_structure_cons): Fix handling. * symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr generation. (gen_cptr_param, gen_fptr_param, gen_shape_param, build_formal_args, get_iso_c_sym): Remove. (std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE. (generate_isocbinding_symbol): Support hidden symbols and using c_ptr/c_funptr symtrees for nullptr defs. * target-memory.c (gfc_target_encode_expr): Fix handling of c_ptr/c_funptr. * trans-expr.c (conv_isocbinding_procedure): Remove. (gfc_conv_procedure_call): Remove call to it. (gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling of c_ptr/c_funptr. * trans-intrinsic.c (conv_isocbinding_function, conv_isocbinding_subroutine): New. (gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine): Call them. * trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr. * trans-types.c (gfc_typenode_for_spec, gfc_get_derived_type): Ditto. (gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE. 2013-03-25 Tobias Burnus <burnus@net-b.de> PR fortran/38536 PR fortran/38813 PR fortran/38894 PR fortran/39288 PR fortran/40963 PR fortran/45824 PR fortran/47023 PR fortran/47034 PR fortran/49023 PR fortran/50269 PR fortran/50612 PR fortran/52426 PR fortran/54263 PR fortran/55343 PR fortran/55444 PR fortran/55574 PR fortran/56079 PR fortran/56378 * gfortran.dg/c_assoc_2.f03: Update dg-error wording. * gfortran.dg/c_f_pointer_shape_test.f90: Ditto. * gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto. * gfortran.dg/c_f_pointer_tests_5.f90: Ditto. * gfortran.dg/c_funloc_tests_2.f03: Ditto. * gfortran.dg/c_funloc_tests_5.f03: Ditto. * gfortran.dg/c_funloc_tests_6.f90: Ditto. * gfortran.dg/c_loc_tests_10.f03: Add -std=f2008. * gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error. * gfortran.dg/c_loc_tests_16.f90: Ditto. * gfortran.dg/c_loc_tests_4.f03: Ditto. * gfortran.dg/c_loc_tests_15.f90: Update dg-error wording. * gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5. * gfortran.dg/c_loc_tests_8.f03: Ditto. * gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times. * gfortran.dg/c_ptr_tests_15.f90: Ditto. * gfortran.dg/c_sizeof_1.f90: Fix invalid code. * gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording. * gfortran.dg/pr32601_1.f03: Ditto. * gfortran.dg/storage_size_2.f08: Remove dg-error. * gfortran.dg/blockdata_7.f90: New. * gfortran.dg/c_assoc_4.f90: New. * gfortran.dg/c_f_pointer_tests_6.f90: New. * gfortran.dg/c_f_pointer_tests_7.f90: New. * gfortran.dg/c_funloc_tests_8.f90: New. * gfortran.dg/c_loc_test_17.f90: New. * gfortran.dg/c_loc_test_18.f90: New. * gfortran.dg/c_loc_test_19.f90: New. * gfortran.dg/c_loc_test_20.f90: New. * gfortran.dg/c_sizeof_5.f90: New. * gfortran.dg/iso_c_binding_rename_3.f90: New. * gfortran.dg/transfer_resolve_2.f90: New. * gfortran.dg/transfer_resolve_3.f90: New. * gfortran.dg/transfer_resolve_4.f90: New. * gfortran.dg/pr32601.f03: Update dg-error. * gfortran.dg/c_ptr_tests_13.f03: Update dg-error. * gfortran.dg/c_ptr_tests_9.f03: Fix test case. From-SVN: r197053
2013-01-10Update copyright years in gcc/Richard Sandiford1-3/+1
From-SVN: r195098
2013-01-04intrinsic.c (add_functions): New internal intrinsic function GFC_PREFIX ↵Tobias Burnus1-0/+8
("stride"). 2013-01-04 Tobias Burnus <burnus@net-b.de> * intrinsic.c (add_functions): New internal intrinsic function GFC_PREFIX ("stride"). * gfortran.h (gfc_isym_id): Add GFC_ISYM_STRIDE. * intrinsic.h (gfc_resolve_stride): New prototypes. * iresolve.c (gfc_resolve_stride): New function. * trans-intrinsic.c (conv_intrinsic_stride): New static function. (gfc_conv_intrinsic_function): Use it. From-SVN: r194918
2013-01-04Update Copyright years for files modified in 2011 and/or 2012.Jakub Jelinek1-1/+1
From-SVN: r194903
2012-12-20re PR libfortran/36044 (user-requested backtrace)Janus Weil1-0/+2
2012-12-20 Janus Weil <janus@gcc.gnu.org> PR fortran/36044 * gfortran.h (gfc_isym_id): Add GFC_ISYM_BACKTRACE. * intrinsic.c (add_subroutines): Add "backtrace". * intrinsic.texi (BACKTRACE): Document BACKTRACE intrinsic. 2012-12-20 Janus Weil <janus@gcc.gnu.org> PR fortran/36044 * gfortran.map: Add _gfortran_backtrace. * libgfortran.h: Rename 'show_backtrace' and export. * runtime/backtrace.c (show_backtrace): Rename to 'backtrace'. Don't show message. Close file descriptor. Export. * runtime/compile_options.c (backtrace_handler): Renamed 'show_backtrace'. Move message outside. * runtime/error.c (sys_abort): Ditto. From-SVN: r194648
2012-10-28re PR fortran/54958 (Wrongly rejects ac-implied-DO variables which also ↵Tobias Burnus1-2/+2
occur with INTENT(IN)) 2012-10-28 Tobias Burnus <burnus@net-b.de> PR fortran/54958 * gfortran.h (gfc_resolve_iterator_expr, gfc_check_vardef_context): Update prototype. * expr.c (gfc_check_vardef_context): Add own_scope argument and honour it. * resolve.c (gfc_resolve_iterator_expr): Add own_scope argument and honour it. (resolve_deallocate_expr, resolve_allocate_expr, resolve_data_variables, resolve_transfer resolve_lock_unlock, resolve_code): Update calls. * array.c (resolve_array_list): Ditto. * check.c (gfc_check_atomic_def, gfc_check_atomic_ref): Ditto. * interface.c (compare_actual_formal): Ditto. * intrinsic.c (check_arglist): Ditto. * io.c (resolve_tag, gfc_resolve_dt, gfc_resolve_inquire): * Ditto. 2012-10-28 Tobias Burnus <burnus@net-b.de> PR fortran/54958 * gfortran.dg/do_check_6.f90: New. From-SVN: r192896
2012-08-09re PR fortran/54199 (Superfluous diagnostic "is also the name of an ↵Tobias Burnus1-1/+1
intrinsic" for internal procedures) 2012-08-09 Tobias Burnus <burnus@net-b.de> PR fortran/54199 * intrinsic.c (gfc_warn_intrinsic_shadow): Better warning for internal procedures. 2012-08-09 Tobias Burnus <burnus@net-b.de> PR fortran/54199 * gfortran.dg/intrinsic_shadow_4.f90: New. From-SVN: r190251
2012-07-31re PR fortran/42418 (PROCEDURE: Rejects interface which is both specific and ↵Janus Weil1-5/+8
generic procedure) 2012-07-31 Janus Weil <janus@gcc.gnu.org> PR fortran/42418 * decl.c (match_procedure_interface): Move some checks to 'resolve_procedure_interface'. Set flavor if appropriate. * expr.c (gfc_check_pointer_assign): Cleanup of 'gfc_is_intrinsic'. * intrinsic.c (gfc_is_intrinsic): Additional checks for attributes which identify a procedure as being non-intrinsic. * resolve.c (resolve_procedure_interface): Checks moved here from 'match_procedure_interface'. Minor cleanup. (resolve_formal_arglist,resolve_symbol): Cleanup of 'resolve_procedure_interface' (resolve_actual_arglist,is_external_proc): Cleanup of 'gfc_is_intrinsic'. 2012-07-31 Janus Weil <janus@gcc.gnu.org> PR fortran/42418 * gfortran.dg/proc_decl_29.f90: New. From-SVN: r190017
2012-07-17re PR fortran/51081 ([F03] Proc-pointer assignment: Rejects valid internal proc)Janus Weil1-2/+2
2012-07-17 Janus Weil <janus@gcc.gnu.org> PR fortran/51081 * error.c (gfc_notify_std): Automatically print the relevant Fortran standard version. * arith.c (arith_power): Remove explicit standard reference string. * array.c (gfc_match_array_spec, gfc_match_array_constructor): Ditto. * check.c (gfc_check_a_p, gfc_check_besn, gfc_check_count, gfc_check_float, gfc_check_fn_rc2008, gfc_check_iand, gfc_check_ichar_iachar, gfc_check_ieor, gfc_check_index, gfc_check_ior, gfc_check_lbound, gfc_check_len_lentrim, check_rest, gfc_check_min_max, gfc_check_null, gfc_check_scan, gfc_check_selected_real_kind, gfc_check_shape, gfc_check_size, gfc_check_sngl, gfc_check_ubound, gfc_check_verify): Ditto. * data.c (gfc_assign_data_value): Ditto. * decl.c (var_element, char_len_param_value, match_char_length, gfc_verify_c_interop_param, match_pointer_init, variable_decl, gfc_match_decl_type_spec, gfc_match_import, match_attr_spec, gfc_match_prefix, gfc_match_suffix, match_ppc_decl, match_procedure_in_interface, gfc_match_procedure,gfc_match_entry, gfc_match_subroutine, gfc_match_end, gfc_match_codimension, gfc_match_protected, gfc_match_value, gfc_match_volatile, gfc_match_asynchronous, gfc_match_modproc, gfc_get_type_attr_spec, gfc_match_enum, match_procedure_in_type): Ditto. * expr.c (check_elemental, gfc_check_assign, gfc_check_pointer_assign): Ditto. * interface.c (gfc_match_abstract_interface, check_interface0): Ditto. * intrinsic.c (gfc_intrinsic_func_interface): Ditto. * io.c (format_lex, resolve_tag_format, resolve_tag, compare_to_allowed_values, gfc_match_open, gfc_match_rewind, gfc_resolve_dt, gfc_match_wait): Ditto. * match.c (match_arithmetic_if, gfc_match_if, gfc_match_critical, gfc_match_do, match_exit_cycle, gfc_match_pause, gfc_match_stop, gfc_match_lock, sync_statement, gfc_match_assign, gfc_match_goto, gfc_match_allocate, gfc_match_return, gfc_match_st_function): Ditto. * module.c (gfc_match_use, gfc_use_module): Ditto. * parse.c (parse_derived_contains, parse_block_construct, parse_associate, parse_contained): Ditto. * primary.c (match_hollerith_constant, match_boz_constant, match_real_constant, match_sym_complex_part, match_arg_list_function, build_actual_constructor, gfc_convert_to_structure_constructor): Ditto. * resolve.c (resolve_formal_arglist, resolve_entries, resolve_common_blocks, resolve_actual_arglist, gfc_resolve_index_1, gfc_resolve_iterator_expr, resolve_ordinary_assign, resolve_fl_var_and_proc, resolve_fl_variable_derived, resolve_fl_procedure, resolve_fl_derived0, resolve_fl_derived, resolve_fl_namelist, resolve_symbol, resolve_fntype): Ditto. * symbol.c (check_conflict, conflict, gfc_add_is_bind_c, gfc_add_extension, gfc_check_symbol_typed): Ditto. From-SVN: r189589
2012-07-08gfortran.h: Do not include coretypes.h here.Steven Bosscher1-0/+1
* gfortran.h: Do not include coretypes.h here. Make it an error to include this before coretypes.h * openmp.c: Include coretypes.h. * interface.c: Likewise. * intrinsic.c: Likewise. * symbol.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * matchexp.c: Likewise. * dump-parse-tree.c: Likewise. * array.c: Likewise. * constructor.c: Likewise. * error.c: Likewise. * data.c: Likewise. * expr.c: Likewise. * module.c: Likewise. * scanner.c: Likewise. * bbt.c: Likewise. * io.c: Likewise. * frontend-passes.c: Likewise. * resolve.c: Likewise. * st.c: Likewise. * target-memory.c: Likewise. * match.c: Likewise. * arith.c: Likewise. * parse.c: Likewise. * check.c: Likewise. * dependency.c: Likewise. * primary.c: Likewise. * misc.c: Likewise. * simplify.c: Likewise. From-SVN: r189357
2012-06-18intrinsic.h (gfc_resolve_rank): New prototype.Tobias Burnus1-1/+1
2012-06-18 Tobias Burnus <burnus@net-b.de> * intrinsic.h (gfc_resolve_rank): New prototype. * intrinsic.c (add_functions): Use gfc_resolve_rank. * iresolve.c (add_functions): New function. * trans-intrinsic.c (gfc_conv_intrinsic_rank): New function. (gfc_conv_intrinsic_function): Call it. From-SVN: r188751
2011-11-09re PR fortran/38718 (some simplifiers for elemental intrinsics missing; ↵Francois-Xavier Coudert1-2/+2
required for init expressions) PR fortran/38718 * intrinsic.c (add_functions): Add gfc_simplify_dreal. * intrinsic.h (gfc_simplify_dreal): New proto. * simplify.c (gfc_simplify_dreal): New function. * gfortran.dg/initialization_29.f90: Expand test. From-SVN: r181198
2011-10-15gfortran.texi (Fortran 2008 status, [...]): Update implementation status, ↵Tobias Burnus1-4/+4
change references from TR 29113 to TS 29113. 2011-10-15 Tobias Burnus <burnus@net-b.de> * gfortran.texi (Fortran 2008 status, TS 29113 status, Further Interoperability of Fortran with C): Update implementation status, change references from TR 29113 to TS 29113. * intrinsic.texi (RANK): Change TR 29113 to TS 29113. * invoke.text (-std=): Ditto, change -std=f2008tr to * -std=f2008ts. * lang.opt (std=): Ditto. * options.c (gfc_handle_option, set_default_std_flags): Ditto * and change GFC_STD_F2008_TR to GFC_STD_F2008_TS. * libgfortran.h: Ditto. * intrinsic.c (add_functions, gfc_check_intrinsic_standard): * Ditto. * decl.c (verify_c_interop_param): Ditto. 2011-10-15 Tobias Burnus <burnus@net-b.de> * gfortran.dg/bind_c_usage_23.f90: Change TR 29113 to TS 29113 * in the comments. * gfortran.dg/bind_c_usage_24.f90: Ditto. * gfortran.dg/rank_3.f90: Ditto. * gfortran.dg/bind_c_usage_22.f90: Ditto, change -std=f2008tr to -std=f2008ts in dg-options. * gfortran.dg/rank_4.f90: Ditto. From-SVN: r180024
2011-07-10re PR fortran/49690 (ICE in gfc_typenode_for_spec, at ↵Tobias Burnus1-1/+1
fortran/trans-types.c:1019) 2011-07-10 Tobias Burnus <burnus@net-b.de> PR fortran/49690 * intrinsic.c (add_functions): Use BT_VOID for 2nd argument of * SIGNAL. 2011-07-10 Tobias Burnus <burnus@net-b.de> PR fortran/49690 * gfortran.dg/intrinsic_signal.f90: New. From-SVN: r176121
2011-06-20re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-1/+1
2011-06-20 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.h (gfc_check_vardef_context): Update prototype. (iso_fortran_env_symbol): Handle derived types. (symbol_attribute): Add lock_comp. * expr.c (gfc_check_vardef_context): Add LOCK_TYPE check. * interface.c (compare_parameter, gfc_procedure_use): Handle LOCK_TYPE. (compare_actual_formal): Update gfc_check_vardef_context call. * check.c (gfc_check_atomic_def, gfc_check_atomic_ref): Ditto. * intrinsic.c (check_arglist): Ditto. * io.c (resolve_tag, gfc_resolve_dt, gfc_resolve_inquire): * Ditto. * iso-fortran-env.def (ISOFORTRAN_LOCK_TYPE): Add. * intrinsic.texi (ISO_FORTRAN_ENV): Document LOCK_TYPE. * module.c (mio_symbol_attribute): Handle lock_comp. (create_derived_type): New function. (use_iso_fortran_env_module): Call it to handle LOCK_TYPE. * parse.c (parse_derived): Add constraint check for LOCK_TYPE. * resolve.c (resolve_symbol, resolve_lock_unlock): Add * constraint checks for LOCK_TYPE. (gfc_resolve_iterator, resolve_deallocate_expr, resolve_allocate_expr, resolve_code, resolve_transfer): Update gfc_check_vardef_context call. * trans-stmt.h (gfc_trans_lock_unlock): New prototype. * trans-stmt.c (gfc_trans_lock_unlock): New function. * trans.c (trans_code): Handle LOCK and UNLOCK. 2011-06-20 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.dg/coarray_lock_1.f90: Update dg-error. * gfortran.dg/coarray_lock_3.f90: New. * gfortran.dg/coarray/lock_1.f90: New. From-SVN: r175228
2011-05-31re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-1/+13
2011-05-31 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * intrinsic.c (klass): Add CLASS_ATOMIC. (add_subroutines): Add atomic_ref/atomic_define. * intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document. * intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref, gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes. * gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF and GFC_ISYM_ATOMIC_REF. (gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars. * iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref): * New functions. * check.c (gfc_check_atomic, gfc_check_atomic_def, gfc_check_atomic_ref): New functions. * iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND, ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value. * trans-intrinsic.c (conv_intrinsic_atomic_def, conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New functions. (conv_intrinsic_move_alloc) Renamed from gfc_conv_intrinsic_move_alloc - and made static. * trans.h (gfc_conv_intrinsic_move_alloc): Remove. (gfc_conv_intrinsic_subroutine) Add prototype. * trans.c (trans_code): Call gfc_conv_intrinsic_subroutine. From-SVN: r174510
2011-05-27re PR fortran/48820 (TR 29113: Implement parts needed for MPI 3)Tobias Burnus1-0/+9
2011-05-27 Tobias Burnus <burnus@net-b.de> PR fortran/48820 * gfortran.h (gfc_isym_id): Add GFC_ISYM_RANK. * intrinsic.c (add_functions): Add rank intrinsic. (gfc_check_intrinsic_standard): Handle GFC_STD_F2008_TR. * intrinsic.h (gfc_simplify_rank, gfc_check_rank): Add * prototypes. * simplify.c (gfc_simplify_rank): New function. * intrinsic.texi (RANK): Add description for rank intrinsic. * check.c (gfc_check_rank): New function. 2011-05-27 Tobias Burnus <burnus@net-b.de> PR fortran/48820 * gfortran.dg/rank_3.f90: New. * gfortran.dg/rank_4.f90: New. From-SVN: r174348
2011-04-18convert each use of gfc_free (p) to free (p)Jim Meyering1-5/+5
Do that by running this command: perl -pi -e 's/\bgfc_free ?\(/free (/' \ $(git grep -El '\bgfc_free ?\(') which also corrects the few uses that lacked a space between the function name and the open parenthesis. Manually undo the change to the function definition itself and its prototype. They'll be removed next. * array.c (gfc_free_array_spec, gfc_set_array_spec): s/gfc_free/free/ * constructor.c (node_free): Likewise. * cpp.c (dump_queued_macros): Likewise. * data.c (gfc_assign_data_value): Likewise. * decl.c (free_variable, free_value, gfc_free_data): Likewise. (gfc_free_data_all, match_old_style_init): Likewise. (gfc_set_constant_character_len, gfc_free_enum_history, NUM_DECL): Likewise. (gfc_match_modproc): Likewise. * dependency.c (check_section_vs_section): Likewise. * error.c (gfc_pop_error, gfc_free_error): Likewise. * expr.c (free_expr0, gfc_free_expr, gfc_free_actual_arglist): Likewise. (gfc_free_ref_list, gfc_replace_expr, gfc_copy_ref): Likewise. (find_substring_ref, gfc_simplify_expr, gfc_check_assign_symbol): Likewise. * frontend-passes.c (gfc_run_passes, cfe_expr_0): Likewise. (strip_function_call, optimize_comparison): Likewise. * interface.c (gfc_free_interface, arginfo, check_interface0): Likewise. (CHECK_OS_COMPARISON, gfc_extend_assign, gfc_free_formal_arglist): Likewise. * intrinsic.c (gfc_intrinsic_done_1, gfc_convert_type_warn): Likewise. (gfc_convert_chartype): Likewise. * io.c (gfc_free_open, compare_to_allowed_values, gfc_free_close): Likewise. (gfc_free_filepos, gfc_free_dt, gfc_free_inquire): Likewise. * match.c (gfc_free_iterator, gfc_match_associate): Likewise. (gfc_free_alloc_list, gfc_free_namelist, gfc_free_equiv_until): Likewise. (free_case, gfc_free_forall_iterator): Likewise. * misc.c: Likewise. * module.c (free_pi_tree, resolve_fixups, free_rename): Likewise. (free_true_name, peek_atom, mio_allocated_wide_string): Likewise. (mio_pool_string, mio_internal_string, mio_gmp_integer): Likewise. (mio_gmp_real, mio_expr, mio_typebound_proc): Likewise. (mio_full_typebound_tree, skip_list, load_equiv): Likewise. (free_written_common, gfc_use_module, gfc_free_use_stmts): Likewise. * openmp.c (gfc_free_omp_clauses): Likewise. * options.c (gfc_post_options): Likewise. * parse.c (select_type_pop, parse_omp_structured_block): Likewise. * primary.c (gfc_free_structure_ctor_component): Likewise. * resolve.c (resolve_structure_cons, check_host_association): Likewise. (gfc_resolve_forall, resolve_equivalence): Likewise. * scanner.c (gfc_scanner_done_1, gfc_release_include_path): Likewise. (gfc_define_undef_line, preprocessor_line, include_line): Likewise. (load_file, gfc_read_orig_filename): Likewise. * simplify.c (simplify_transformation_to_array): Likewise. (gfc_simplify_ibits, simplify_shift, gfc_simplify_ishftc, STRING): Likewise. (gfc_simplify_compiler_options): Likewise. * st.c (gfc_free_statement, gfc_free_statements): Likewise. (gfc_free_association_list): Likewise. * symbol.c (free_components, gfc_free_st_label, free_st_labels): Likewise. (gfc_delete_symtree, gfc_free_symbol, gfc_undo_symbols): Likewise. (free_old_symbol, gfc_commit_symbols, free_tb_tree): Likewise. (free_common_tree, free_uop_tree, free_sym_tree): Likewise. (gfc_free_dt_list, gfc_free_equiv_infos, gfc_free_equiv_lists): Likewise. (gfc_free_finalizer, gfc_free_charlen, free_entry_list): Likewise. (gfc_free_namespace): Likewise. * trans-array.c (gfc_free_ss, gfc_trans_array_bound_check): Likewise. (gfc_conv_array_ref, gfc_conv_ss_startstride): Likewise. (gfc_trans_dummy_array_bias, gfc_conv_array_parameter): Likewise. * trans-common.c (get_init_field, create_common): Likewise. * trans-const.c (gfc_build_wide_string_const): Likewise. (gfc_conv_string_init): Likewise. * trans-decl.c (gfc_generate_function_code): Likewise. * trans-expr.c (gfc_conv_substring, gfc_free_interface_mapping): Likewise. (SCALAR_POINTER, gfc_conv_statement_function): Likewise. (gfc_trans_subarray_assign): Likewise. * trans-intrinsic.c (conv_generic_with_optional_char_arg): Likewise. * trans-io.c (gfc_trans_io_runtime_check, set_string): Likewise. (transfer_namelist_element, transfer_array_component): Likewise. * trans-openmp.c (gfc_trans_omp_array_reduction): Likewise. * trans-stmt.c (cleanup_forall_symtrees, gfc_trans_forall_1): Likewise. * trans.c (trans_runtime_error_vararg, gfc_restore_backend_locus): Likewise. From-SVN: r172666
2011-03-27re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])Tobias Burnus1-1/+2
2011-03-27 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.h (gfc_isym_id): Rename GFC_ISYM_NUMIMAGES to GFC_ISYM_NUM_IMAGES. (gfc_fcoarray): Add GFC_FCOARRAY_LIB. * intrinsic.c (add_functions): Update due to GFC_ISYM_NUM_IMAGES rename. * invoke.texi (-fcoarray=): Document "lib" argument. * iresolve.c (gfc_resolve_this_image): Fix THIS IMAGE(). * libgfortran.h (libgfortran_stat_codes): Add comments. * options.c (gfc_handle_coarray_option): Add -fcoarray=lib. * simplify.c (gfc_simplify_num_images, gfc_simplify_this_image): Handle GFC_FCOARRAY_LIB. * trans.h (gfc_init_coarray_decl): New prototype. (gfor_fndecl_caf_init, gfor_fndecl_caf_finalize, gfor_fndecl_caf_critical, gfor_fndecl_caf_end_critical, gfor_fndecl_caf_sync_all, gfor_fndecl_caf_sync_images, gfor_fndecl_caf_error_stop, gfor_fndecl_caf_error_stop_str, gfort_gvar_caf_num_images, gfort_gvar_caf_this_image): New global variables. * trans-decl.c: Declare several CAF functions (cf. above). (gfc_build_builtin_function_decls): Initialize those. (gfc_init_coarray_decl): New function. (create_main_function): Call CAF init/finalize functions. * trans-intrinsic.c (trans_this_image, trans_num_images): New. (gfc_conv_intrinsic_function): Call those. * trans-stmt.c (gfc_trans_stop, gfc_trans_sync, * gfc_trans_critical): Add code for GFC_FCOARRAY_LIB. From-SVN: r171568
2011-01-29re PR fortran/47531 (SHAPE misses KIND= support)Tobias Burnus1-2/+3
2011-01-29 Tobias Burnus <burnus@net-b.de> PR fortran/47531 * check.c (gfc_check_shape): Support kind argument in SHAPE. * intrinsic.c (add_functions): Ditto. * resolve.c (gfc_resolve_shape): Ditto. * simplify.c (gfc_simplify_shape): Ditto. * intrinsic.h (gfc_check_shape, gfc_resolve_shape, gfc_simplify_shape): Update prototypes. * intrinisc.text (SHAPE): Document kind argument. 2011-01-29 Tobias Burnus <burnus@net-b.de> PR fortran/47531 * gfortran.dg/shape_6.f90: New. From-SVN: r169392
2011-01-07re PR fortran/41580 ([OOP] SAME_TYPE_AS and EXTENDS_TYPE_OF - add ↵Tobias Burnus1-3/+4
compile-time simplifcation) 2011-01-07 Tobias Burnus <burnus@net-b.de> PR fortran/41580 * class.c (gfc_build_class_symbol): Mark __vtab as attr.vtab. * intrinsic.c (add_functions): Use simplify functions for EXTENDS_TYPE_OF and SAME_TYPE_AS. * intrinsic.h (gfc_simplify_extends_type_of, gfc_simplify_same_type_as): New prototypes. * simplify.c (is_last_ref_vtab, gfc_simplify_extends_type_of, gfc_simplify_same_type_as): New functions. 2011-01-07 Tobias Burnus <burnus@net-b.de> PR fortran/41580 * gfortran.dg/extends_type_of_3.f90: New. From-SVN: r168579
2010-11-10re PR fortran/46411 (MOVE_ALLOC wrongly rejected as impure)Tobias Burnus1-1/+1
2010-11-10 Tobias Burnus <burnus@net-b.de> PR fortran/46411 * intrinsic.c (gfc_intrinsic_sub_interface): Check for attr.pure and not for attr.elemental. * intrinsic.texi (move_alloc): Document as being pure. 2010-11-10 Tobias Burnus <burnus@net-b.de> PR fortran/46411 * gfortran.dg/intrinsic_7.f90: New. From-SVN: r166550