gcc/gcc/fortran/ChangeLog

2252 lines
84 KiB
Plaintext
Raw Normal View History

2008-07-12 Daniel Kraft <d@domob.eu>
* resolve.c (resolve_fl_derived): Allow pointer components to empty
derived types fixing a missing part of PR fortran/33221.
2008-07-10 Daniel Kraft <d@domob.eu>
* gfc-internals.texi (section gfc_expr): Created documentation about
the gfc_expr internal data structure.
2008-07-07 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/36670
* iresolve.c (gfc_resolve_product): Set shape of return
value from array.
(gfc_resolve_sum): Likewise.
2008-07-07 Jakub Jelinek <jakub@redhat.com>
PR middle-end/36726
* f95-lang.c (poplevel): Don't ever add subblocks to
global_binding_level.
re PR fortran/32580 (iso_c_binding c_f_procpointer / procedure pointers) 2008-07-02 Janus Weil <janus@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> Paul Thomas <pault@gcc.gnu.org> PR fortran/32580 * gfortran.h (struct gfc_symbol): New member "proc_pointer". * check.c (gfc_check_associated,gfc_check_null): Implement procedure pointers. * decl.c (match_procedure_decl): Ditto. * expr.c (gfc_check_pointer_assign,gfc_check_assign_symbol): Ditto. * interface.c (compare_actual_formal): Ditto. * match.h: Ditto. * match.c (gfc_match_pointer_assignment): Ditto. * parse.c (parse_interface): Ditto. * primary.c (gfc_match_rvalue,match_variable): Ditto. * resolve.c (resolve_fl_procedure): Ditto. * symbol.c (check_conflict,gfc_add_external,gfc_add_pointer, gfc_copy_attr,gen_fptr_param,build_formal_args): Ditto. * trans-decl.c (get_proc_pointer_decl,gfc_get_extern_function_decl, create_function_arglist): Ditto. * trans-expr.c (gfc_conv_variable,gfc_conv_function_val, gfc_conv_function_call,gfc_trans_pointer_assignment): Ditto. 2008-07-02 Janus Weil <janus@gcc.gnu.org> Tobias Burnus <burnus@net-b.de> PR fortran/32580 * gfortran.dg/c_f_pointer_tests_3.f90: Updated. * gfortran.dg/proc_decl_1.f90: Updated. * gfortran.dg/proc_ptr_1.f90: New. * gfortran.dg/proc_ptr_2.f90: New. * gfortran.dg/proc_ptr_3.f90: New. * gfortran.dg/proc_ptr_4.f90: New. * gfortran.dg/proc_ptr_5.f90: New. * gfortran.dg/proc_ptr_6.f90: New. * gfortran.dg/proc_ptr_7.f90: New. * gfortran.dg/proc_ptr_8.f90: New. Co-Authored-By: Paul Thomas <pault@gcc.gnu.org> Co-Authored-By: Tobias Burnus <burnus@net-b.de> From-SVN: r137386
2008-07-02 21:53:37 +02:00
2008-07-02 Janus Weil <janus@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/32580
* gfortran.h (struct gfc_symbol): New member "proc_pointer".
* check.c (gfc_check_associated,gfc_check_null): Implement
procedure pointers.
* decl.c (match_procedure_decl): Ditto.
* expr.c (gfc_check_pointer_assign,gfc_check_assign_symbol): Ditto.
* interface.c (compare_actual_formal): Ditto.
* match.h: Ditto.
* match.c (gfc_match_pointer_assignment): Ditto.
* parse.c (parse_interface): Ditto.
* primary.c (gfc_match_rvalue,match_variable): Ditto.
* resolve.c (resolve_fl_procedure): Ditto.
* symbol.c (check_conflict,gfc_add_external,gfc_add_pointer,
gfc_copy_attr,gen_fptr_param,build_formal_args): Ditto.
* trans-decl.c (get_proc_pointer_decl,gfc_get_extern_function_decl,
create_function_arglist): Ditto.
* trans-expr.c (gfc_conv_variable,gfc_conv_function_val,
gfc_conv_function_call,gfc_trans_pointer_assignment): Ditto.
2008-07-02 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/36590
PR fortran/36681
* iresolve.c (resolve_mask_arg): Don't convert mask to
kind=1 logical if it is of that type already.
2008-06-29 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/36341
* iresolve.c (gfc_resolve_matmul): Copy shapes
from arguments.
2008-06-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
* invoke.texi: Add documentation for runtime behavior of
-fno-range-check.
2008-06-28 Daniel Kraft <d@domob.eu>
* gfc-internals.texi (section gfc_code): Extended documentation about
gfc_code in the internal datastructures chapter including details about
how IF, DO and SELECT blocks look like and an example for how the
block-chaining works.
2008-06-25 Paul Thomas <pault@gcc.gnu.org>
PR fortran/36526
* interface.c (check_intents): Correct error where the actual
arg was checked for a pointer argument, rather than the formal.
2008-06-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34371
* expr.c (gfc_check_assign): Change message and locus for
error when conform == 0.
2008-06-23 Jakub Jelinek <jakub@redhat.com>
PR fortran/36597
* cpp.c (cpp_define_builtins): Change _OPENMP value to 200805.
2008-06-20 Laurynas Biveinis <laurynas.biveinis@gmail.com>
Tobias Burnus <burnus@net-b.de>
PR fortran/34908
PR fortran/36276
* scanner.c (preprocessor_line): do not call gfc_free for
current_file->filename if it differs from filename.
arith.c (hollerith2representation): Fix for -Wc++-compat. * arith.c (hollerith2representation): Fix for -Wc++-compat. * array.c (gfc_get_constructor): Likewise. * decl.c (gfc_get_data_variable, gfc_get_data_value, gfc_get_data, create_enum_history, gfc_match_final_decl): Likewise. * error.c (error_char): Likewise. * expr.c (gfc_get_expr, gfc_copy_expr): Likewise. * gfortran.h (gfc_get_charlen, gfc_get_array_spec, gfc_get_component, gfc_get_formal_arglist, gfc_get_actual_arglist, gfc_get_namelist, gfc_get_omp_clauses, gfc_get_interface, gfc_get_common_head, gfc_get_dt_list, gfc_get_array_ref, gfc_get_ref, gfc_get_equiv, gfc_get_case, gfc_get_iterator, gfc_get_alloc, gfc_get_wide_string): Likewise. * interface.c (count_types_test): Likewise. * intrinsic.c (add_char_conversions, gfc_intrinsic_init_1): Likewise. * io.c (gfc_match_open, gfc_match_close, match_filepos, match_io, gfc_match_inquire, gfc_match_wait): Likewise. * match.c (gfc_match, match_forall_iterator): Likewise. * module.c (gfc_get_pointer_info, gfc_get_use_rename, add_fixup, add_true_name, parse_string, write_atom, quote_string, mio_symtree_ref, mio_gmp_real, write_common_0): Likewise. * options.c (gfc_post_options): Likewise. * primary.c (match_integer_constant, match_hollerith_constant, match_boz_constant, match_real_constant, gfc_get_structure_ctor_component, gfc_match_structure_constructor): Likewise. * scanner.c (gfc_widechar_to_char, add_path_to_list, add_file_change, load_line, get_file, preprocessor_line, load_file, unescape_filename, gfc_read_orig_filename): Likewise. * simplify.c (gfc_simplify_ibits, gfc_simplify_ishft, gfc_simplify_ishftc): Likewise. * symbol.c (gfc_get_st_label, gfc_get_namespace, gfc_new_symtree, gfc_get_uop, gfc_new_symbol, save_symbol_data, gfc_get_gsymbol): Likewise. * target-memory.c (gfc_target_interpret_expr): Likewise. * trans-const.c (gfc_build_wide_string_const): Likewise. * trans-expr.c (gfc_add_interface_mapping): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_conversion, gfc_conv_intrinsic_int, gfc_conv_intrinsic_lib_function, gfc_conv_intrinsic_cmplx, gfc_conv_intrinsic_ctime, gfc_conv_intrinsic_fdate, gfc_conv_intrinsic_ttynam, gfc_conv_intrinsic_minmax, gfc_conv_intrinsic_minmax_char, gfc_conv_intrinsic_ishftc, gfc_conv_intrinsic_index_scan_verify, gfc_conv_intrinsic_merge, gfc_conv_intrinsic_trim): Likewise. * trans.c (gfc_get_backend_locus): Likewise. * trans.h (gfc_get_ss): Likewise. From-SVN: r136982
2008-06-20 08:03:16 +02:00
2008-06-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* arith.c (hollerith2representation): Fix for -Wc++-compat.
* array.c (gfc_get_constructor): Likewise.
* decl.c (gfc_get_data_variable, gfc_get_data_value, gfc_get_data,
create_enum_history, gfc_match_final_decl): Likewise.
* error.c (error_char): Likewise.
* expr.c (gfc_get_expr, gfc_copy_expr): Likewise.
* gfortran.h (gfc_get_charlen, gfc_get_array_spec,
gfc_get_component, gfc_get_formal_arglist, gfc_get_actual_arglist,
gfc_get_namelist, gfc_get_omp_clauses, gfc_get_interface,
gfc_get_common_head, gfc_get_dt_list, gfc_get_array_ref,
gfc_get_ref, gfc_get_equiv, gfc_get_case, gfc_get_iterator,
gfc_get_alloc, gfc_get_wide_string): Likewise.
* interface.c (count_types_test): Likewise.
* intrinsic.c (add_char_conversions, gfc_intrinsic_init_1):
Likewise.
* io.c (gfc_match_open, gfc_match_close, match_filepos, match_io,
gfc_match_inquire, gfc_match_wait): Likewise.
* match.c (gfc_match, match_forall_iterator): Likewise.
* module.c (gfc_get_pointer_info, gfc_get_use_rename, add_fixup,
add_true_name, parse_string, write_atom, quote_string,
mio_symtree_ref, mio_gmp_real, write_common_0): Likewise.
* options.c (gfc_post_options): Likewise.
* primary.c (match_integer_constant, match_hollerith_constant,
match_boz_constant, match_real_constant,
gfc_get_structure_ctor_component, gfc_match_structure_constructor): Likewise.
* scanner.c (gfc_widechar_to_char, add_path_to_list,
add_file_change, load_line, get_file, preprocessor_line,
load_file, unescape_filename, gfc_read_orig_filename): Likewise.
* simplify.c (gfc_simplify_ibits, gfc_simplify_ishft,
gfc_simplify_ishftc): Likewise.
* symbol.c (gfc_get_st_label, gfc_get_namespace, gfc_new_symtree,
gfc_get_uop, gfc_new_symbol, save_symbol_data, gfc_get_gsymbol):
Likewise.
* target-memory.c (gfc_target_interpret_expr): Likewise.
* trans-const.c (gfc_build_wide_string_const): Likewise.
* trans-expr.c (gfc_add_interface_mapping): Likewise.
* trans-intrinsic.c (gfc_conv_intrinsic_conversion,
gfc_conv_intrinsic_int, gfc_conv_intrinsic_lib_function,
gfc_conv_intrinsic_cmplx, gfc_conv_intrinsic_ctime,
gfc_conv_intrinsic_fdate, gfc_conv_intrinsic_ttynam,
gfc_conv_intrinsic_minmax, gfc_conv_intrinsic_minmax_char,
gfc_conv_intrinsic_ishftc, gfc_conv_intrinsic_index_scan_verify,
gfc_conv_intrinsic_merge, gfc_conv_intrinsic_trim): Likewise.
* trans.c (gfc_get_backend_locus): Likewise.
* trans.h (gfc_get_ss): Likewise.
2008-06-18 Daniel Kraft <d@domob.eu>
PR fortran/36517, fortran/36492
* array.c (gfc_resolve_character_array_constructor): Call
gfc_set_constant_character_len with changed length-chec argument.
* decl.c (gfc_set_constant_character_len): Changed array argument to
be a generic length-checking argument that can be used for correct
checking with typespec and in special cases where the should-be length
is different from the target length.
(build_struct): Call gfc_set_constant_character_len with changed length
checking argument and introduced additional checks for exceptional
conditions on invalid code.
(add_init_expr_to_sym), (do_parm): Call gfc_set_constant_character_len
with changed argument.
* match.h (gfc_set_constant_character_len): Changed third argument to
int for the should-be length rather than bool.
re PR fortran/36112 (Bounds-checking on character length not working for array-constructors) 2008-06-17 Daniel Kraft <d@domob.eu> PR fortran/36112 * array.c (gfc_resolve_character_array_constructor): Check that all elements with constant character length have the same one rather than fixing it if no typespec is given, emit an error if they don't. Changed return type to "try" and return FAILURE for the case above. (gfc_resolve_array_constructor): Removed unneeded call to gfc_resolve_character_array_constructor in this function. * gfortran.h (gfc_resolve_character_array_constructor): Returns try. * trans-array.c (get_array_ctor_strlen): Return length of first element rather than last element. * resolve.c (gfc_resolve_expr): Handle FAILURE return from gfc_resolve_character_array_constructor. 2008-06-17 Daniel Kraft <d@domob.eu> PR fortran/36112 * gfortran.dg/bounds_check_array_ctor_1.f90: New test. * gfortran.dg/bounds_check_array_ctor_2.f90: New test. * gfortran.dg/bounds_check_array_ctor_3.f90: New test. * gfortran.dg/bounds_check_array_ctor_4.f90: New test. * gfortran.dg/bounds_check_array_ctor_5.f90: New test. * gfortran.dg/bounds_check_array_ctor_6.f90: New test. * gfortran.dg/bounds_check_array_ctor_7.f90: New test. * gfortran.dg/bounds_check_array_ctor_8.f90: New test. * gfortran.dg/arrayio_0.f90: Fixed invalid array constructor. * gfortran.dg/char_cons_len.f90: Ditto. * gfortran.dg/char_initializer_actual.f90: Ditto. * gfortran.dg/pr15959.f90: Ditto. * gfortran.dg/transfer_simplify_2.f90: Ditto. * gfortran.dg/char_length_1.f90: Changed expected error messages. From-SVN: r136872
2008-06-17 22:24:20 +02:00
2008-06-17 Daniel Kraft <d@domob.eu>
PR fortran/36112
* array.c (gfc_resolve_character_array_constructor): Check that all
elements with constant character length have the same one rather than
fixing it if no typespec is given, emit an error if they don't. Changed
return type to "try" and return FAILURE for the case above.
(gfc_resolve_array_constructor): Removed unneeded call to
gfc_resolve_character_array_constructor in this function.
* gfortran.h (gfc_resolve_character_array_constructor): Returns try.
* trans-array.c (get_array_ctor_strlen): Return length of first element
rather than last element.
* resolve.c (gfc_resolve_expr): Handle FAILURE return from
gfc_resolve_character_array_constructor.
2008-06-17 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34396
* resolve.c (add_dt_to_dt_list): New function.
(resolve_fl_derived): Call new function for pointer components
and when derived type resolved.
2008-06-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/36515
* trans-decl.c (gfc_generate_function_code): Add range_check to options
array.
2008-06-15 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* gfc-internals.texi: Expand TABs, drop indentation outside examples.
* gfortran.texi: Likewise.
* intrinsic.texi: Likewise.
* invoke.texi: Likewise.
2008-06-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/35863
* trans-io.c (gfc_build_io_library_fndecls): Build declaration for
transfer_character_wide which includes passing in the character kind to
support wide character IO. (transfer_expr): If the kind == 4, create the
argument and build the call.
* gfortran.texi: Fix typo.
2008-06-13 Tobias Burnus <burnus@net-b.de>
PR fortran/36476
* decl.c (do_parm): Handle init expression for len=*.
2008-06-12 Tobias Burnus <burnus@net-b.de>
PR fortran/36462
* trans-intrinsic.c (gfc_conv_intrinsic_index_scan_verify):
Fix passing of the BACK= argument.
2008-06-10 Jerry DeLisle <jvdelisle@gcc.gnu.org>
* cpp.c: Add copyright notice.
* cpp.h: Add copyright notice.
2008-06-08 Janus Weil <janus@gcc.gnu.org>
PR fortran/36459
* decl.c (match_procedure_decl): Correctly recognize if the interface
is an intrinsic procedure.
2008-06-08 Tobias Burnus <burnus@net-b.de>
PR fortran/35830
* resolve.c (resolve_symbol): Copy more attributes for
PROCEDUREs with interfaces.
2008-06-07 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2008-06-08 02:01:19 +02:00
PR fortran/36420
PR fortran/36422
* io.c (check_format): Add new error message for zero width.
Use new error message for FMT_A and with READ, FMT_G. Allow
FMT_G with WRITE except when -std=F95 and -std=F2003.
2008-06-07 Tobias Burnus <burnus@net-b.de>
PR fortran/36437
* intrinsic.c (add_functions): Implement c_sizeof.
* trans-intrinsic.c (gfc_conv_intrinsic_sizeof): Do not
create unneeded variable in the scalar case.
* intrinsic.texi: Add C_SIZEOF documentation.
2008-06-06 Tobias Burnus <burnus@net-b.de>
* intrinsic.texi (BESSEL_J1): Fix BES(S)EL_J1 typo.
c-cppbuiltin.c (c_cpp_builtins): Change _OPENMP value to 200805. * c-cppbuiltin.c (c_cpp_builtins): Change _OPENMP value to 200805. * langhooks.h (struct lang_hooks_for_decls): Add omp_finish_clause. Add omp_private_outer_ref hook, add another argument to omp_clause_default_ctor hook. * langhooks-def.h (LANG_HOOKS_OMP_FINISH_CLAUSE): Define. (LANG_HOOKS_OMP_PRIVATE_OUTER_REF): Define. (LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR): Change to hook_tree_tree_tree_tree_null. (LANG_HOOKS_DECLS): Add LANG_HOOKS_OMP_FINISH_CLAUSE and LANG_HOOKS_OMP_PRIVATE_OUTER_REF. * hooks.c (hook_tree_tree_tree_tree_null): New function. * hooks.h (hook_tree_tree_tree_tree_null): New prototype. * tree.def (OMP_TASK): New tree code. * tree.h (OMP_TASK_COPYFN, OMP_TASK_ARG_SIZE, OMP_TASK_ARG_ALIGN, OMP_CLAUSE_PRIVATE_OUTER_REF, OMP_CLAUSE_LASTPRIVATE_STMT, OMP_CLAUSE_COLLAPSE_ITERVAR, OMP_CLAUSE_COLLAPSE_COUNT, OMP_TASKREG_CHECK, OMP_TASKREG_BODY, OMP_TASKREG_CLAUSES, OMP_TASKREG_FN, OMP_TASKREG_DATA_ARG, OMP_TASK_BODY, OMP_TASK_CLAUSES, OMP_TASK_FN, OMP_TASK_DATA_ARG, OMP_CLAUSE_COLLAPSE_EXPR): Define. (enum omp_clause_default_kind): Add OMP_CLAUSE_DEFAULT_FIRSTPRIVATE. (OMP_DIRECTIVE_P): Add OMP_TASK. (OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_UNTIED): New clause codes. (OMP_CLAUSE_SCHEDULE_AUTO): New schedule kind. * tree.c (omp_clause_code_name): Add OMP_CLAUSE_COLLAPSE and OMP_CLAUSE_UNTIED entries. (omp_clause_num_ops): Likewise. Increase OMP_CLAUSE_LASTPRIVATE num_ops to 2. (walk_tree_1): Handle OMP_CLAUSE_COLLAPSE and OMP_CLAUSE_UNTIED. Walk OMP_CLAUSE_LASTPRIVATE_STMT. * tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_SCHEDULE_AUTO, OMP_CLAUSE_UNTIED, OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_DEFAULT_FIRSTPRIVATE. (dump_generic_node): Handle OMP_TASK and collapsed OMP_FOR loops. * c-omp.c (c_finish_omp_for): Allow pointer iterators. Remove warning about unsigned iterators. Change decl/init/cond/incr arguments to TREE_VECs, check arguments for all collapsed loops. (c_finish_omp_taskwait): New function. (c_split_parallel_clauses): Put OMP_CLAUSE_COLLAPSE clause to ws_clauses. * c-parser.c (c_parser_omp_for_loop): Parse collapsed loops. Call default_function_array_conversion on init. Add par_clauses argument. If decl is present in parallel's lastprivate clause, change it to shared and add lastprivate clause for decl to OMP_FOR_CLAUSES. Add clauses argument, on success set OMP_FOR_CLAUSES to it. Look up collapse count in clauses. (c_parser_omp_for, c_parser_omp_parallel): Adjust c_parser_omp_for_loop callers. (OMP_FOR_CLAUSE_MASK): Add 1 << PRAGMA_OMP_CLAUSE_COLLAPSE. (c_parser_pragma): Handle PRAGMA_OMP_TASKWAIT. (c_parser_omp_clause_name): Handle collapse and untied clauses. (c_parser_omp_clause_collapse, c_parser_omp_clause_untied): New functions. (c_parser_omp_clause_schedule): Handle schedule(auto). Include correct location in the error message. (c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_COLLAPSE and PRAGMA_OMP_CLAUSE_UNTIED. (OMP_TASK_CLAUSE_MASK): Define. (c_parser_omp_task, c_parser_omp_taskwait): New functions. (c_parser_omp_construct): Handle PRAGMA_OMP_TASK. * tree-nested.c (convert_nonlocal_omp_clauses, convert_local_omp_clauses): Handle OMP_CLAUSE_LASTPRIVATE_STMT, OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_MERGE, OMP_CLAUSE_COLLAPSE and OMP_CLAUSE_UNTIED. Don't handle TREE_STATIC or DECL_EXTERNAL VAR_DECLs in OMP_CLAUSE_DECL. (conver_nonlocal_reference, convert_local_reference, convert_call_expr): Handle OMP_TASK the same as OMP_PARALLEL. Use OMP_TASKREG_* macros rather than OMP_PARALLEL_*. (walk_omp_for): Adjust for OMP_FOR_{INIT,COND,INCR} changes. * tree-gimple.c (is_gimple_stmt): Handle OMP_TASK. * c-tree.h (c_begin_omp_task, c_finish_omp_task): New prototypes. * c-pragma.h (PRAGMA_OMP_TASK, PRAGMA_OMP_TASKWAIT): New. (PRAGMA_OMP_CLAUSE_COLLAPSE, PRAGMA_OMP_CLAUSE_UNTIED): New. * c-typeck.c (c_begin_omp_task, c_finish_omp_task): New functions. (c_finish_omp_clauses): Handle OMP_CLAUSE_COLLAPSE and OMP_CLAUSE_UNTIED. * c-pragma.c (init_pragma): Init omp task and omp taskwait pragmas. * c-common.h (c_finish_omp_taskwait): New prototype. * gimple-low.c (lower_stmt): Handle OMP_TASK. * tree-parloops.c (create_parallel_loop): Create 1 entry vectors for OMP_FOR_{INIT,COND,INCR}. * tree-cfg.c (remove_useless_stmts_1): Handle OMP_* containers. (make_edges): Handle OMP_TASK. * tree-ssa-operands.c (get_expr_operands): Handle collapsed OMP_FOR loops, adjust for OMP_FOR_{INIT,COND,INCR} changes. * tree-inline.c (estimate_num_insns_1): Handle OMP_TASK. * builtin-types.def (BT_PTR_ULONGLONG, BT_PTR_FN_VOID_PTR_PTR, BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR, BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR, BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR, BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT): New. * omp-builtins.def (BUILT_IN_GOMP_TASK, BUILT_IN_GOMP_TASKWAIT, BUILT_IN_GOMP_LOOP_ULL_STATIC_START, BUILT_IN_GOMP_LOOP_ULL_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ULL_GUIDED_START, BUILT_IN_GOMP_LOOP_ULL_RUNTIME_START, BUILT_IN_GOMP_LOOP_ULL_ORDERED_STATIC_START, BUILT_IN_GOMP_LOOP_ULL_ORDERED_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ULL_ORDERED_GUIDED_START, BUILT_IN_GOMP_LOOP_ULL_ORDERED_RUNTIME_START, BUILT_IN_GOMP_LOOP_ULL_STATIC_NEXT, BUILT_IN_GOMP_LOOP_ULL_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ULL_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ULL_RUNTIME_NEXT, BUILT_IN_GOMP_LOOP_ULL_ORDERED_STATIC_NEXT, BUILT_IN_GOMP_LOOP_ULL_ORDERED_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ULL_ORDERED_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ULL_ORDERED_RUNTIME_NEXT): New builtins. * gimplify.c (gimplify_omp_for): Allow pointer type for decl, handle POINTER_PLUS_EXPR. If loop counter has been replaced and original iterator is present in lastprivate clause or if collapse > 1, set OMP_CLAUSE_LASTPRIVATE_STMT. Handle collapsed OMP_FOR loops, adjust for OMP_FOR_{INIT,COND,INCR} changes. (gimplify_expr): Handle OMP_SECTIONS_SWITCH and OMP_TASK. (enum gimplify_omp_var_data): Add GOVD_PRIVATE_OUTER_REF. (omp_notice_variable): Set GOVD_PRIVATE_OUTER_REF if needed, if it is set, lookup var in outer contexts too. Handle OMP_CLAUSE_DEFAULT_FIRSTPRIVATE. Handle vars that are supposed to be implicitly determined firstprivate for task regions. (gimplify_scan_omp_clauses): Set GOVD_PRIVATE_OUTER_REF if needed, if it is set, lookup var in outer contexts too. Set OMP_CLAUSE_PRIVATE_OUTER_REF if GOVD_PRIVATE_OUTER_REF is set. Handle OMP_CLAUSE_LASTPRIVATE_STMT, OMP_CLAUSE_COLLAPSE and OMP_CLAUSE_UNTIED. Take region_type as last argument instead of in_parallel and in_combined_parallel. (gimplify_omp_parallel, gimplify_omp_for, gimplify_omp_workshare): Adjust callers. (gimplify_adjust_omp_clauses_1): Set OMP_CLAUSE_PRIVATE_OUTER_REF if GOVD_PRIVATE_OUTER_REF is set. Call omp_finish_clause langhook. (new_omp_context): Set default_kind to OMP_CLAUSE_DEFAULT_UNSPECIFIED for OMP_TASK regions. (omp_region_type): New enum. (struct gimplify_omp_ctx): Remove is_parallel and is_combined_parallel fields, add region_type. (new_omp_context): Take region_type as argument instead of is_parallel and is_combined_parallel. (gimple_add_tmp_var, omp_firstprivatize_variable, omp_notice_variable, omp_is_private, omp_check_private): Adjust ctx->is_parallel and ctx->is_combined_parallel checks. (gimplify_omp_task): New function. (gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_COLLAPSE and OMP_CLAUSE_UNTIED. * omp-low.c (extract_omp_for_data): Use schedule(static) for schedule(auto). Handle pointer and unsigned iterators. Compute fd->iter_type. Handle POINTER_PLUS_EXPR increments. Add loops argument. Extract data for collapsed OMP_FOR loops. (expand_parallel_call): Assert sched_kind isn't auto, map runtime schedule to index 3. (struct omp_for_data_loop): New type. (struct omp_for_data): Remove v, n1, n2, step, cond_code fields. Add loop, loops, collapse and iter_type fields. (workshare_safe_to_combine_p): Disallow combined for if iter_type is unsigned long long. Don't combine collapse > 1 loops unless all bounds and steps are constant. Adjust extract_omp_for_data caller. (expand_omp_for_generic): Handle pointer, unsigned and long long iterators. Handle collapsed OMP_FOR loops. Adjust for struct omp_for_data changes. If libgomp function doesn't return boolean_type_node, add comparison of the return value with 0. (expand_omp_for_static_nochunk, expand_omp_for_static_chunk): Handle pointer, unsigned and long long iterators. Adjust for struct omp_for_data changes. (expand_omp_for): Assert sched_kind isn't auto, map runtime schedule to index 3. Use GOMP_loop_ull*{start,next} if iter_type is unsigned long long. Allocate loops array, pass it to extract_omp_for_data. For collapse > 1 loops use always expand_omp_for_generic. (omp_context): Add sfield_map and srecord_type fields. (is_task_ctx, lookup_sfield): New functions. (use_pointer_for_field): Use is_task_ctx helper. Change first argument's type from const_tree to tree. Clarify comment. In OMP_TASK disallow copy-in/out sharing. (build_sender_ref): Call lookup_sfield instead of lookup_field. (install_var_field): Add mask argument. Populate both record_type and srecord_type if needed. (delete_omp_context): Destroy sfield_map, clear DECL_ABSTRACT_ORIGIN in srecord_type. (fixup_child_record_type): Also remap FIELD_DECL's DECL_SIZE{,_UNIT} and DECL_FIELD_OFFSET. (scan_sharing_clauses): Adjust install_var_field callers. For firstprivate clauses on explicit tasks allocate the var by value in record_type unconditionally, rather than by reference. Handle OMP_CLAUSE_PRIVATE_OUTER_REF. Scan OMP_CLAUSE_LASTPRIVATE_STMT. Use is_taskreg_ctx instead of is_parallel_ctx. Handle OMP_CLAUSE_COLLAPSE and OMP_CLAUSE_UNTIED. (create_omp_child_function_name): Add task_copy argument, use *_omp_cpyfn* names if it is true. (create_omp_child_function): Add task_copy argument, if true create *_omp_cpyfn* helper function. (scan_omp_parallel): Adjust create_omp_child_function callers. Rename parallel_nesting_level to taskreg_nesting_level. (scan_omp_task): New function. (lower_rec_input_clauses): Don't run constructors for firstprivate explicit task vars which are initialized by *_omp_cpyfn*. Pass outer var ref to omp_clause_default_ctor hook if OMP_CLAUSE_PRIVATE_OUTER_REF or OMP_CLAUSE_LASTPRIVATE. Replace OMP_CLAUSE_REDUCTION_PLACEHOLDER decls in OMP_CLAUSE_REDUCTION_INIT. (lower_send_clauses): Clear DECL_ABSTRACT_ORIGIN if in task to avoid duplicate setting of fields. Handle OMP_CLAUSE_PRIVATE_OUTER_REF. (lower_send_shared_vars): Use srecord_type if non-NULL. Don't copy-out if TREE_READONLY, only copy-in. (expand_task_copyfn): New function. (expand_task_call): New function. (struct omp_taskcopy_context): New type. (task_copyfn_copy_decl, task_copyfn_remap_type, create_task_copyfn): New functions. (lower_omp_parallel): Rename to... (lower_omp_taskreg): ... this. Use OMP_TASKREG_* macros where needed. Call create_task_copyfn if srecord_type is needed. Adjust sender_decl type. (task_shared_vars): New variable. (check_omp_nesting_restrictions): Warn if work-sharing, barrier, master or ordered region is closely nested inside OMP_TASK. Add warnings for barrier if closely nested inside of work-sharing, ordered, or master region. (scan_omp_1): Call check_omp_nesting_restrictions even for GOMP_barrier calls. Rename parallel_nesting_level to taskreg_nesting_level. Handle OMP_TASK. (lower_lastprivate_clauses): Even if some lastprivate is found on a work-sharing construct, continue looking for them on parent parallel construct. (lower_omp_for_lastprivate): Add lastprivate clauses to the beginning of dlist rather than end. Adjust for struct omp_for_data changes. (lower_omp_for): Add rec input clauses before OMP_FOR_PRE_BODY, not after it. Handle collapsed OMP_FOR loops, adjust for OMP_FOR_{INIT,COND,INCR} changes, adjust extract_omp_for_data caller. (get_ws_args_for): Adjust extract_omp_for_data caller. (scan_omp_for): Handle collapsed OMP_FOR loops, adjust for OMP_FOR_{INIT,COND,INCR} changes. (lower_omp_single_simple): If libgomp function doesn't return boolean_type_node, add comparison of the return value with 0. (diagnose_sb_1, diagnose_sb_2): Handle collapsed OMP_FOR loops, adjust for OMP_FOR_{INIT,COND,INCR} changes. Handle OMP_TASK. (parallel_nesting_level): Rename to... (taskreg_nesting_level): ... this. (is_taskreg_ctx): New function. (build_outer_var_ref, omp_copy_decl): Use is_taskreg_ctx instead of is_parallel_ctx. (execute_lower_omp): Rename parallel_nesting_level to taskreg_nesting_level. (expand_omp_parallel): Rename to... (expand_omp_taskreg): ... this. Use OMP_TASKREG_* macros where needed. Call omp_task_call for OMP_TASK regions. (expand_omp): Adjust caller, handle OMP_TASK. (lower_omp_1): Adjust lower_omp_taskreg caller, handle OMP_TASK. * bitmap.c (bitmap_default_obstack_depth): New variable. (bitmap_obstack_initialize, bitmap_obstack_release): Do nothing if argument is NULL and bitmap_default_obstack is already initialized. * ipa-struct-reorg.c (do_reorg_1): Call bitmap_obstack_release at the end. * matrix-reorg.c (matrix_reorg): Likewise. cp/ * cp-tree.h (cxx_omp_finish_clause, cxx_omp_create_clause_info, dependent_omp_for_p, begin_omp_task, finish_omp_task, finish_omp_taskwait): New prototypes. (cxx_omp_clause_default_ctor): Add outer argument. (finish_omp_for): Add new clauses argument. * cp-gimplify.c (cxx_omp_finish_clause): New function. (cxx_omp_predetermined_sharing): Moved from semantics.c, rewritten. (cxx_omp_clause_default_ctor): Add outer argument. (cp_genericize_r): Walk OMP_CLAUSE_LASTPRIVATE_STMT. * cp-objcp-common.h (LANG_HOOKS_OMP_FINISH_CLAUSE): Define. * parser.c (cp_parser_omp_for_loop): Parse collapsed for loops. Add par_clauses argument. If decl is present in parallel's lastprivate clause, change that clause to shared and add a lastprivate clause for decl to OMP_FOR_CLAUSES. Fix wording of error messages. Adjust finish_omp_for caller. Add clauses argument. Parse loops with random access iterators. (cp_parser_omp_clause_collapse, cp_parser_omp_clause_untied): New functions. (cp_parser_omp_for, cp_parser_omp_parallel): Adjust cp_parser_omp_for_loop callers. (cp_parser_omp_for_cond, cp_parser_omp_for_incr): New helper functions. (cp_parser_omp_clause_name): Handle collapse and untied clauses. (cp_parser_omp_clause_schedule): Handle auto schedule. (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_COLLAPSE and PRAGMA_OMP_CLAUSE_UNTIED. (OMP_FOR_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_COLLAPSE. (OMP_TASK_CLAUSE_MASK): Define. (cp_parser_omp_task, cp_parser_omp_taskwait): New functions. (cp_parser_omp_construct): Handle PRAGMA_OMP_TASK. (cp_parser_pragma): Handle PRAGMA_OMP_TASK and PRAGMA_OMP_TASKWAIT. * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_COLLAPSE and OMP_CLAUSE_UNTIED. Handle OMP_CLAUSE_LASTPRIVATE_STMT. (tsubst_omp_for_iterator): New function. (dependent_omp_for_p): New function. (tsubst_expr) <case OMP_FOR>: Use it. Handle collapsed OMP_FOR loops. Adjust finish_omp_for caller. Handle loops with random access iterators. Adjust for OMP_FOR_{INIT,COND,INCR} changes. (tsubst_expr): Handle OMP_TASK. * semantics.c (cxx_omp_create_clause_info): New function. (finish_omp_clauses): Call it. Handle OMP_CLAUSE_UNTIED and OMP_CLAUSE_COLLAPSE. (cxx_omp_predetermined_sharing): Removed. * semantics.c (finish_omp_for): Allow pointer iterators. Use handle_omp_for_class_iterator and dependent_omp_for_p. Handle collapsed for loops. Adjust c_finish_omp_for caller. Add new clauses argument. Fix check for type dependent cond or incr. Set OMP_FOR_CLAUSES to clauses. Use cp_convert instead of fold_convert to convert incr amount to difference_type. Only fold if not in template. If decl is mentioned in lastprivate clause, set OMP_CLAUSE_LASTPRIVATE_STMT. Handle loops with random access iterators. Adjust for OMP_FOR_{INIT,COND,INCR} changes. (finish_omp_threadprivate): Allow static class members of the current class. (handle_omp_for_class_iterator, begin_omp_task, finish_omp_task, finish_omp_taskwait): New functions. * parser.c (cp_parser_binary_expression): Add prec argument. (cp_parser_assignment_expression): Adjust caller. * cp-tree.h (outer_curly_brace_block): New prototype. * decl.c (outer_curly_brace_block): No longer static. fortran/ * scanner.c (skip_free_comments, skip_fixed_comments): Handle tabs. * parse.c (next_free): Allow tab after !$omp. (decode_omp_directive): Handle !$omp task, !$omp taskwait and !$omp end task. (case_executable): Add ST_OMP_TASKWAIT. (case_exec_markers): Add ST_OMP_TASK. (gfc_ascii_statement): Handle ST_OMP_TASK, ST_OMP_END_TASK and ST_OMP_TASKWAIT. (parse_omp_structured_block, parse_executable): Handle ST_OMP_TASK. * gfortran.h (gfc_find_sym_in_expr): New prototype. (gfc_statement): Add ST_OMP_TASK, ST_OMP_END_TASK and ST_OMP_TASKWAIT. (gfc_omp_clauses): Add OMP_SCHED_AUTO to sched_kind, OMP_DEFAULT_FIRSTPRIVATE to default_sharing. Add collapse and untied fields. (gfc_exec_op): Add EXEC_OMP_TASK and EXEC_OMP_TASKWAIT. * f95-lang.c (LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR, LANG_HOOKS_OMP_PRIVATE_OUTER_REF): Define. * trans.h (gfc_omp_clause_default_ctor): Add another argument. (gfc_omp_clause_copy_ctor, gfc_omp_clause_assign_op, gfc_omp_clause_dtor, gfc_omp_private_outer_ref): New prototypes. * types.def (BT_ULONGLONG, BT_PTR_ULONGLONG, BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR, BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR, BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR, BT_FN_VOID_PTR_PTR, BT_PTR_FN_VOID_PTR_PTR, BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT): New. (BT_BOOL): Use integer type with BOOL_TYPE_SIZE rather than boolean_type_node. * dump-parse-tree.c (gfc_show_omp_node): Handle EXEC_OMP_TASK, EXEC_OMP_TASKWAIT, OMP_SCHED_AUTO, OMP_DEFAULT_FIRSTPRIVATE, untied and collapse clauses. (gfc_show_code_node): Handle EXEC_OMP_TASK and EXEC_OMP_TASKWAIT. * trans.c (gfc_trans_code): Handle EXEC_OMP_TASK and EXEC_OMP_TASKWAIT. * st.c (gfc_free_statement): Likewise. * resolve.c (gfc_resolve_blocks, resolve_code): Likewise. (find_sym_in_expr): Rename to... (gfc_find_sym_in_expr): ... this. No longer static. (resolve_allocate_expr, resolve_ordinary_assign): Adjust caller. * match.h (gfc_match_omp_task, gfc_match_omp_taskwait): New prototypes. * openmp.c (resolve_omp_clauses): Allow allocatable arrays in firstprivate, lastprivate, reduction, copyprivate and copyin clauses. (omp_current_do_code): Made static. (omp_current_do_collapse): New variable. (gfc_resolve_omp_do_blocks): Compute omp_current_do_collapse, clear omp_current_do_code and omp_current_do_collapse on return. (gfc_resolve_do_iterator): Handle collapsed do loops. (resolve_omp_do): Likewise, diagnose errorneous collapsed do loops. (OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_UNTIED): Define. (gfc_match_omp_clauses): Handle default (firstprivate), schedule (auto), untied and collapse (n) clauses. (OMP_DO_CLAUSES): Add OMP_CLAUSE_COLLAPSE. (OMP_TASK_CLAUSES): Define. (gfc_match_omp_task, gfc_match_omp_taskwait): New functions. * trans-openmp.c (gfc_omp_private_outer_ref): New function. (gfc_omp_clause_default_ctor): Add outer argument. For allocatable arrays allocate them with the bounds of the outer var if outer var is allocated. (gfc_omp_clause_copy_ctor, gfc_omp_clause_assign_op, gfc_omp_clause_dtor): New functions. (gfc_trans_omp_array_reduction): If decl is allocatable array, allocate it with outer var's bounds in OMP_CLAUSE_REDUCTION_INIT and deallocate it in OMP_CLAUSE_REDUCTION_MERGE. (gfc_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for assumed-size arrays. (gfc_trans_omp_do): Add par_clauses argument. If dovar is present in lastprivate clause and do loop isn't simple, set OMP_CLAUSE_LASTPRIVATE_STMT. If dovar is present in parallel's lastprivate clause, change it to shared and add lastprivate clause to OMP_FOR_CLAUSES. Handle collapsed do loops. (gfc_trans_omp_directive): Adjust gfc_trans_omp_do callers. (gfc_trans_omp_parallel_do): Likewise. Move collapse clause to OMP_FOR from OMP_PARALLEL. (gfc_trans_omp_clauses): Handle OMP_SCHED_AUTO, OMP_DEFAULT_FIRSTPRIVATE, untied and collapse clauses. (gfc_trans_omp_task, gfc_trans_omp_taskwait): New functions. (gfc_trans_omp_directive): Handle EXEC_OMP_TASK and EXEC_OMP_TASKWAIT. gcc/testsuite/ * gcc.dg/gomp/collapse-1.c: New test. * gcc.dg/gomp/nesting-1.c: New test. * g++.dg/gomp/task-1.C: New test. * g++.dg/gomp/predetermined-1.C: New test. * g++.dg/gomp/tls-4.C: New test. * gfortran.dg/gomp/collapse1.f90: New test. * gfortran.dg/gomp/sharing-3.f90: New test. * gcc.dg/gomp/pr27499.c (foo): Remove is unsigned dg-warning. * g++.dg/gomp/pr27499.C (foo): Likewise. * g++.dg/gomp/for-16.C (foo): Likewise. * g++.dg/gomp/tls-3.C: Remove dg-error, add S::s definition. * g++.dg/gomp/pr34607.C: Adjust dg-error location. * g++.dg/gomp/for-16.C (foo): Add a new dg-error. * gcc.dg/gomp/appendix-a/a.35.4.c: Add dg-warning. * gcc.dg/gomp/appendix-a/a.35.6.c: Likewise. * gfortran.dg/gomp/appendix-a/a.35.4.f90: Likewise. * gfortran.dg/gomp/appendix-a/a.35.6.f90: Likewise. * gfortran.dg/gomp/omp_parse1.f90: Remove !$omp tab test. * gfortran.dg/gomp/appendix-a/a.33.4.f90: Remove dg-error about allocatable array. * gfortran.dg/gomp/reduction1.f90: Likewise. libgomp/ * configure.ac (LIBGOMP_GNU_SYMBOL_VERSIONING): New AC_DEFINE. Substitute also OMP_*LOCK_25*. * configure: Regenerated. * config.h.in: Regenerated. * Makefile.am (libgomp_la_SOURCES): Add loop_ull.c, iter_ull.c, ptrlock.c and task.c. * Makefile.in: Regenerated. * testsuite/Makefile.in: Regenerated. * task.c: New file. * loop_ull.c: New file. * iter_ull.c: New file. * libgomp.h: Include ptrlock.h. (enum gomp_task_kind): New type. (struct gomp_team): Add task_lock, task_queue, task_count, task_running_count, single_count fields. Add work_share_list_free_lock ifndef HAVE_SYNC_BUILTINS. Remove work_share_lock, generation_mask, oldest_live_gen, num_live_gen and init_work_shares fields, add work work_share_list_alloc, work_share_list_free and work_share_chunk fields. Change work_shares from pointer to pointers into an array. Change ordered_release field into gomp_sem_t ** from flexible array member. Add implicit_task and initial_work_shares fields. Move close to the end of the struct. (struct gomp_team_state): Add single_count, last_work_share, active_level and level fields, remove work_share_generation. (gomp_barrier_handle_tasks): New prototype. (gomp_finish_task): New inline function. (struct gomp_work_share): Move chunk_size, end, incr into transparent union/struct, add chunk_size_ull, end_ll, incr_ll and next_ll fields. Reshuffle fields. Add next_alloc, next_ws, next_free and inline_ordered_team_ids fields, change ordered_team_ids into pointer from flexible array member. Add mode field. Put lock and next into a different cache line from most of the write-once fields. (gomp_iter_ull_static_next, gomp_iter_ull_dynamic_next_locked, gomp_iter_ull_guided_next_locked, gomp_iter_ull_dynamic_next, gomp_iter_ull_guided_next): New prototypes. (gomp_new_icv): New prototype. (struct gomp_thread): Add thread_pool and task fields. (struct gomp_thread_pool): New type. (gomp_new_team): New prototype. (gomp_team_start): Change type of last argument. (gomp_new_work_share): Removed. (gomp_init_work_share, gomp_fini_work_share): New prototypes. (gomp_work_share_init_done): New static inline. (gomp_throttled_spin_count_var, gomp_available_cpus, gomp_managed_threads): New extern decls. (gomp_init_task): New prototype. (gomp_spin_count_var): New extern var decl. (LIBGOMP_GNU_SYMBOL_VERSIONING): Undef if no visibility or no alias support, or if not PIC. (gomp_init_lock_30, gomp_destroy_lock_30, gomp_set_lock_30, gomp_unset_lock_30, gomp_test_lock_30, gomp_init_nest_lock_30, gomp_destroy_nest_lock_30, gomp_set_nest_lock_30, gomp_unset_nest_lock_30, gomp_test_nest_lock_30, gomp_init_lock_25, gomp_destroy_lock_25, gomp_set_lock_25, gomp_unset_lock_25, gomp_test_lock_25, gomp_init_nest_lock_25, gomp_destroy_nest_lock_25, gomp_set_nest_lock_25, gomp_unset_nest_lock_25, gomp_test_nest_lock_25): New prototypes. (omp_lock_symver, strong_alias): Define. (gomp_remaining_threads_count, gomp_remaining_threads_lock): New decls. (gomp_end_task): New. (struct gomp_task_icv, gomp_global_icv): New. (gomp_thread_limit_var, gomp_max_active_levels_var): New. (struct gomp_task): New. (gomp_nthreads_var, gomp_dyn_var, gomp_nest_var, gomp_run_sched_var, gomp_run_sched_chunk): Remove. (gomp_icv): New. (gomp_schedule_type): Reorder enum to match omp_sched_t. * team.c (struct gomp_thread_start_data): Add thread_pool and task fields. (gomp_thread_start): Add gomp_team_barrier_wait call. For non-nested case remove clearing of docked thread thr fields. Use pool fields instead of global gomp_* variables. Use gomp_barrier_wait_last when needed. Initialize ts.active_level. Create tasks for each member thread. (free_team): Only destroy team barrier, task_lock here and free it. (gomp_free_thread): Free last_team if non-NULL. (gomp_team_end): Call gomp_team_barrier_wait instead of gomp_barrier_wait. For nested case call one extra gomp_barrier_wait. Move here some destruction from free_team. Call free_team on pool->last_team if any, rather than freeing current team. Destroy work_share_list_free_lock ifndef HAVE_SYNC_BUILTINS. (gomp_new_icv): New function. (gomp_threads, gomp_threads_size, gomp_threads_used, gomp_threads_dock): Removed. (gomp_thread_destructor): New variable. (gomp_new_thread_pool, gomp_free_pool_helper, gomp_free_thread): New functions. (gomp_team_start): Create new pool if current thread doesn't have one. Use pool fields instead of global gomp_* variables. Initialize thread_pool field for new threads. Clear single_count. Change last argument from ws to team, don't create new team, set ts.work_share to &team->work_shares[0] and clear ts.last_work_share. Don't clear ts.work_share_generation. If number of threads changed, adjust atomically gomp_managed_threads. Use gomp_init_task instead of gomp_new_task, set thr->task to the corresponding implicit_task array entry. Create tasks for each member thread. Initialize ts.level. (initialize_team): Call pthread_key_create on gomp_thread_destructor. (team_destructor): New function. (new_team): Removed. (gomp_new_team): New function. (free_team): Free gomp_work_share blocks chained through next_alloc, instead of freeing work_shares and destroying work_share_lock. (gomp_team_end): Call gomp_fini_work_share. If number of threads changed, adjust atomically gomp_managed_threads. Use gomp_end_task. * barrier.c (GOMP_barrier): Call gomp_team_barrier_wait instead of gomp_barrier_wait. * single.c (GOMP_single_copy_start): Call gomp_team_barrier_wait instead of gomp_barrier_wait. Call gomp_work_share_init_done if gomp_work_share_start returned true. Don't unlock ws->lock. (GOMP_single_copy_end): Call gomp_team_barrier_wait instead of gomp_barrier_wait. (GOMP_single_start): Rewritten if HAVE_SYNC_BUILTINS. Call gomp_work_share_init_done if gomp_work_share_start returned true. Don't unlock ws->lock. * work.c: Include stddef.h. (free_work_share): Use work_share_list_free_lock instead of atomic chaining ifndef HAVE_SYNC_BUILTINS. Add team argument. Call gomp_fini_work_share and then either free ws if orphaned, or put it into work_share_list_free list of the current team. (alloc_work_share, gomp_init_work_share, gomp_fini_work_share): New functions. (gomp_work_share_start, gomp_work_share_end, gomp_work_share_end_nowait): Rewritten. * omp_lib.f90.in Change some tabs to spaces to prevent warnings. (openmp_version): Set to 200805. (omp_sched_kind, omp_sched_static, omp_sched_dynamic, omp_sched_guided, omp_sched_auto): New parameters. (omp_set_schedule, omp_get_schedule, omp_get_thread_limit, omp_set_max_active_levels, omp_get_max_active_levels, omp_get_level, omp_get_ancestor_thread_num, omp_get_team_size, omp_get_active_level): New interfaces. * omp_lib.h.in (openmp_version): Set to 200805. (omp_sched_kind, omp_sched_static, omp_sched_dynamic, omp_sched_guided, omp_sched_auto): New parameters. (omp_set_schedule, omp_get_schedule, omp_get_thread_limit, omp_set_max_active_levels, omp_get_max_active_levels, omp_get_level, omp_get_ancestor_thread_num, omp_get_team_size, omp_get_active_level): New externals. * loop.c: Include limits.h. (GOMP_loop_runtime_next, GOMP_loop_ordered_runtime_next): Handle GFS_AUTO. (GOMP_loop_runtime_start, GOMP_loop_ordered_runtime_start): Likewise. Use gomp_icv. (gomp_loop_static_start, gomp_loop_dynamic_start): Clear ts.static_trip here. (gomp_loop_static_start, gomp_loop_ordered_static_start): Call gomp_work_share_init_done after gomp_loop_init. Don't unlock ws->lock. (gomp_loop_dynamic_start, gomp_loop_guided_start): Call gomp_work_share_init_done after gomp_loop_init. If HAVE_SYNC_BUILTINS, don't unlock ws->lock, otherwise lock it. (gomp_loop_ordered_dynamic_start, gomp_loop_ordered_guided_start): Call gomp_work_share_init_done after gomp_loop_init. Lock ws->lock. (gomp_parallel_loop_start): Call gomp_new_team instead of gomp_new_work_share. Call gomp_loop_init on &team->work_shares[0]. Adjust gomp_team_start caller. Pass 0 as second argument to gomp_resolve_num_threads. (gomp_loop_init): For GFS_DYNAMIC, multiply ws->chunk_size by incr. If adding ws->chunk_size nthreads + 1 times after end won't overflow, set ws->mode to 1. * libgomp_g.h (GOMP_loop_ull_static_start, GOMP_loop_ull_dynamic_start, GOMP_loop_ull_guided_start, GOMP_loop_ull_runtime_start, GOMP_loop_ull_ordered_static_start, GOMP_loop_ull_ordered_dynamic_start, GOMP_loop_ull_ordered_guided_start, GOMP_loop_ull_ordered_runtime_start, GOMP_loop_ull_static_next, GOMP_loop_ull_dynamic_next, GOMP_loop_ull_guided_next, GOMP_loop_ull_runtime_next, GOMP_loop_ull_ordered_static_next, GOMP_loop_ull_ordered_dynamic_next, GOMP_loop_ull_ordered_guided_next, GOMP_loop_ull_ordered_runtime_next, GOMP_task, GOMP_taskwait): New prototypes. * libgomp.map: Export lock routines also @@OMP_2.0. (GOMP_loop_ordered_dynamic_first, GOMP_loop_ordered_guided_first, GOMP_loop_ordered_runtime_first, GOMP_loop_ordered_static_first): Remove. (GOMP_loop_ull_dynamic_next, GOMP_loop_ull_dynamic_start, GOMP_loop_ull_guided_next, GOMP_loop_ull_guided_start, GOMP_loop_ull_ordered_dynamic_next, GOMP_loop_ull_ordered_dynamic_start, GOMP_loop_ull_ordered_guided_next, GOMP_loop_ull_ordered_guided_start, GOMP_loop_ull_ordered_runtime_next, GOMP_loop_ull_ordered_runtime_start, GOMP_loop_ull_ordered_static_next, GOMP_loop_ull_ordered_static_start, GOMP_loop_ull_runtime_next, GOMP_loop_ull_runtime_start, GOMP_loop_ull_static_next, GOMP_loop_ull_static_start, GOMP_task, GOMP_taskwait): Export @@GOMP_2.0. (omp_set_schedule, omp_get_schedule, omp_get_thread_limit, omp_set_max_active_levels, omp_get_max_active_levels, omp_get_level, omp_get_ancestor_thread_num, omp_get_team_size, omp_get_active_level, omp_set_schedule_, omp_set_schedule_8_, omp_get_schedule_, omp_get_schedule_8_, omp_get_thread_limit_, omp_set_max_active_levels_, omp_set_max_active_levels_8_, omp_get_max_active_levels_, omp_get_level_, omp_get_ancestor_thread_num_, omp_get_ancestor_thread_num_8_, omp_get_team_size_, omp_get_team_size_8_, omp_get_active_level_): New exports @@OMP_3.0. * omp.h.in (omp_sched_t): New type. (omp_set_schedule, omp_get_schedule, omp_get_thread_limit, omp_set_max_active_levels, omp_get_max_active_levels, omp_get_level, omp_get_ancestor_thread_num, omp_get_team_size, omp_get_active_level): New prototypes. * env.c (gomp_spin_count_var, gomp_throttled_spin_count_var, gomp_available_cpus, gomp_managed_threads, gomp_max_active_levels_var, gomp_thread_limit_var, gomp_remaining_threads_count, gomp_remaining_threads_lock): New variables. (parse_spincount): New function. (initialize_env): Call gomp_init_num_threads unconditionally. Initialize gomp_available_cpus. Call parse_spincount, initialize gomp_{,throttled_}spin_count_var depending on presence and value of OMP_WAIT_POLICY and GOMP_SPINCOUNT env vars. Handle GOMP_BLOCKTIME env var. Handle OMP_WAIT_POLICY, OMP_MAX_ACTIVE_LEVELS, OMP_THREAD_LIMIT, OMP_STACKSIZE env vars. Handle unit specification for GOMP_STACKSIZE. Initialize gomp_remaining_threads_count and gomp_remaining_threads_lock if needed. Use gomp_global_icv. (gomp_nthreads_var, gomp_dyn_var, gomp_nest_var, gomp_run_sched_var, gomp_run_sched_chunk): Remove. (gomp_global_icv): New. (parse_schedule): Use it. Parse "auto". (omp_set_num_threads): Use gomp_icv. (omp_set_dynamic, omp_get_dynamic, omp_set_nested, omp_get_nested): Likewise. (omp_get_max_threads): Move from parallel.c. (omp_set_schedule, omp_get_schedule, omp_get_thread_limit, omp_set_max_active_levels, omp_get_max_active_levels): New functions, add ialias. (parse_stacksize, parse_wait_policy): New functions. * fortran.c: Rewrite lock wrappers, if symbol versioning provide both wrappers for compatibility and new locks. (omp_set_schedule, omp_get_schedule, omp_get_thread_limit, omp_set_max_active_levels, omp_get_max_active_levels, omp_get_level, omp_get_ancestor_thread_num, omp_get_team_size, omp_get_active_level): New ialias_redirect. (omp_set_schedule_, omp_set_schedule_8_, omp_get_schedule_, omp_get_schedule_8_, omp_get_thread_limit_, omp_set_max_active_levels_, omp_set_max_active_levels_8_, omp_get_max_active_levels_, omp_get_level_, omp_get_ancestor_thread_num_, omp_get_ancestor_thread_num_8_, omp_get_team_size_, omp_get_team_size_8_, omp_get_active_level_): New functions. * parallel.c: Include limits.h. (gomp_resolve_num_threads): Add count argument. Rewritten. (GOMP_parallel_start): Call gomp_new_team and pass that as last argument to gomp_team_start. Pass 0 as second argument to gomp_resolve_num_threads. (GOMP_parallel_end): Decrease gomp_remaining_threads_count if gomp_thread_limit_var != ULONG_MAX. (omp_in_parallel): Implement using ts.active_level. (omp_get_max_threads): Move to env.c. (omp_get_level, omp_get_ancestor_thread_num, omp_get_team_size, omp_get_active_level): New functions, add ialias. * sections.c (GOMP_sections_start): Call gomp_work_share_init_done after gomp_sections_init. If HAVE_SYNC_BUILTINS, call gomp_iter_dynamic_next instead of the _locked variant and don't take lock around it, otherwise acquire it before calling gomp_iter_dynamic_next_locked. (GOMP_sections_next): If HAVE_SYNC_BUILTINS, call gomp_iter_dynamic_next instead of the _locked variant and don't take lock around it. (GOMP_parallel_sections_start): Call gomp_new_team instead of gomp_new_work_share. Call gomp_sections_init on &team->work_shares[0]. Adjust gomp_team_start caller. Pass count as second argument to gomp_resolve_num_threads, don't adjust num_threads after the call. Use gomp_icv. * iter.c (gomp_iter_dynamic_next_locked): Don't multiply ws->chunk_size by incr. (gomp_iter_dynamic_next): Likewise. If ws->mode, use more efficient code. * libgomp_f.h.in (omp_lock_25_arg_t, omp_nest_lock_25_arg_t): New types. (omp_lock_25_arg, omp_nest_lock_25_arg): New macros. (omp_check_defines): Check even the compat defines. * config/linux/ptrlock.c: New file. * config/linux/ptrlock.h: New file. * config/linux/wait.h: New file. * config/posix/ptrlock.c: New file. * config/posix/ptrlock.h: New file. * config/linux/bar.h (gomp_team_barrier_wait, gomp_team_barrier_wait_end, gomp_team_barrier_wake): New prototypes. (gomp_team_barrier_set_task_pending, gomp_team_barrier_clear_task_pending, gomp_team_barrier_set_waiting_for_tasks, gomp_team_barrier_waiting_for_tasks, gomp_team_barrier_done): New inlines. (gomp_barrier_t): Rewritten. (gomp_barrier_state_t): New typedef. (gomp_barrier_init, gomp_barrier_reinit, gomp_barrier_destroy, gomp_barrier_wait_start): Rewritten. (gomp_barrier_wait_end): Change second argument to gomp_barrier_state_t. (gomp_barrier_last_thread, gomp_barrier_wait_last): New static inlines. * config/linux/bar.c: Include wait.h instead of libgomp.h and futex.h. (gomp_barrier_wait_end): Rewritten. (gomp_team_barrier_wait, gomp_team_barrier_wait_end, gomp_team_barrier_wake, gomp_barrier_wait_last): New functions. * config/posix/bar.h (gomp_barrier_t): Add generation field. (gomp_barrier_state_t): New typedef. (gomp_team_barrier_wait, gomp_team_barrier_wait_end, gomp_team_barrier_wake): New prototypes. (gomp_barrier_wait_start): Or all but low 2 bits from generation into the return value. Return gomp_barrier_state_t. (gomp_team_barrier_set_task_pending, gomp_team_barrier_clear_task_pending, gomp_team_barrier_set_waiting_for_tasks, gomp_team_barrier_waiting_for_tasks, gomp_team_barrier_done): New inlines. (gomp_barrier_wait_end): Change second argument to gomp_barrier_state_t. (gomp_barrier_last_thread, gomp_barrier_wait_last): New static inlines. * config/posix/bar.c (gomp_barrier_init): Clear generation field. (gomp_barrier_wait_end): Change second argument to gomp_barrier_state_t. (gomp_team_barrier_wait, gomp_team_barrier_wait_end, gomp_team_barrier_wake): New functions. * config/linux/mutex.c: Include wait.h instead of libgomp.h and futex.h. (gomp_futex_wake, gomp_futex_wait): New variables. (gomp_mutex_lock_slow): Call do_wait instead of futex_wait. * config/linux/lock.c: Rewrite to make locks task owned, for backwards compatibility provide the old entrypoints if symbol versioning. Include wait.h instead of libgomp.h and futex.h. (gomp_set_nest_lock_25): Call do_wait instead of futex_wait. * config/posix95/lock.c: Rewrite to make locks task owned, for backwards compatibility provide the old entrypoints if symbol versioning. * config/posix/lock.c: Rewrite to make locks task owned, for backwards compatibility provide the old entrypoints if symbol versioning. * config/linux/proc.c (gomp_init_num_threads): Use gomp_global_icv. (get_num_procs, gomp_dynamic_max_threads): Use gomp_icv. * config/posix/proc.c, config/mingw32/proc.c: Similarly. * config/linux/powerpc/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove. (sys_futex0): Return error code. (futex_wake, futex_wait): If ENOSYS was returned, clear FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry. (cpu_relax, atomic_write_barrier): New static inlines. * config/linux/alpha/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove. (futex_wake, futex_wait): If ENOSYS was returned, clear FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry. (cpu_relax, atomic_write_barrier): New static inlines. * config/linux/x86/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove. (sys_futex0): Return error code. (futex_wake, futex_wait): If ENOSYS was returned, clear FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry. (cpu_relax, atomic_write_barrier): New static inlines. * config/linux/s390/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove. (sys_futex0): Return error code. (futex_wake, futex_wait): If ENOSYS was returned, clear FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry. (cpu_relax, atomic_write_barrier): New static inlines. * config/linux/ia64/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove. (sys_futex0): Return error code. (futex_wake, futex_wait): If ENOSYS was returned, clear FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry. (cpu_relax, atomic_write_barrier): New static inlines. * config/linux/sparc/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove. (sys_futex0): Return error code. (futex_wake, futex_wait): If ENOSYS was returned, clear FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry. (cpu_relax, atomic_write_barrier): New static inlines. * config/linux/sem.c: Include wait.h instead of libgomp.h and futex.h. (gomp_sem_wait_slow): Call do_wait instead of futex_wait. * config/linux/affinity.c: Assume HAVE_SYNC_BUILTINS. * config/linux/omp-lock.h (omp_lock_25_t, omp_nest_lock_25_t): New types. (omp_nest_lock_t): Change owner into void *, add lock field. * config/posix95/omp-lock.h: Include semaphore.h. (omp_lock_25_t, omp_nest_lock_25_t): New types. (omp_lock_t): Use sem_t instead of mutex if semaphores aren't broken. (omp_nest_lock_t): Likewise. Change owner to void *. * config/posix/omp-lock.h: Include semaphore.h. (omp_lock_25_t, omp_nest_lock_25_t): New types. (omp_lock_t): Use sem_t instead of mutex if semaphores aren't broken. (omp_nest_lock_t): Likewise. Add owner field. * testsuite/libgomp.c/collapse-1.c: New test. * testsuite/libgomp.c/collapse-2.c: New test. * testsuite/libgomp.c/collapse-3.c: New test. * testsuite/libgomp.c/icv-1.c: New test. * testsuite/libgomp.c/icv-2.c: New test. * testsuite/libgomp.c/lib-2.c: New test. * testsuite/libgomp.c/lock-1.c: New test. * testsuite/libgomp.c/lock-2.c: New test. * testsuite/libgomp.c/lock-3.c: New test. * testsuite/libgomp.c/loop-4.c: New test. * testsuite/libgomp.c/loop-5.c: New test. * testsuite/libgomp.c/loop-6.c: New test. * testsuite/libgomp.c/loop-7.c: New test. * testsuite/libgomp.c/loop-8.c: New test. * testsuite/libgomp.c/loop-9.c: New test. * testsuite/libgomp.c/nested-3.c: New test. * testsuite/libgomp.c/nestedfn-6.c: New test. * testsuite/libgomp.c/sort-1.c: New test. * testsuite/libgomp.c/task-1.c: New test. * testsuite/libgomp.c/task-2.c: New test. * testsuite/libgomp.c/task-3.c: New test. * testsuite/libgomp.c/task-4.c: New test. * testsuite/libgomp.c++/c++.exp: Add libstdc++-v3 build includes to C++ testsuite default compiler options. * testsuite/libgomp.c++/collapse-1.C: New test. * testsuite/libgomp.c++/collapse-2.C: New test. * testsuite/libgomp.c++/ctor-10.C: New test. * testsuite/libgomp.c++/for-1.C: New test. * testsuite/libgomp.c++/for-2.C: New test. * testsuite/libgomp.c++/for-3.C: New test. * testsuite/libgomp.c++/for-4.C: New test. * testsuite/libgomp.c++/for-5.C: New test. * testsuite/libgomp.c++/loop-8.C: New test. * testsuite/libgomp.c++/loop-9.C: New test. * testsuite/libgomp.c++/loop-10.C: New test. * testsuite/libgomp.c++/task-1.C: New test. * testsuite/libgomp.c++/task-2.C: New test. * testsuite/libgomp.c++/task-3.C: New test. * testsuite/libgomp.c++/task-4.C: New test. * testsuite/libgomp.c++/task-5.C: New test. * testsuite/libgomp.c++/task-6.C: New test. * testsuite/libgomp.fortran/allocatable1.f90: New test. * testsuite/libgomp.fortran/allocatable2.f90: New test. * testsuite/libgomp.fortran/allocatable3.f90: New test. * testsuite/libgomp.fortran/allocatable4.f90: New test. * testsuite/libgomp.fortran/collapse1.f90: New test. * testsuite/libgomp.fortran/collapse2.f90: New test. * testsuite/libgomp.fortran/collapse3.f90: New test. * testsuite/libgomp.fortran/collapse4.f90: New test. * testsuite/libgomp.fortran/lastprivate1.f90: New test. * testsuite/libgomp.fortran/lastprivate2.f90: New test. * testsuite/libgomp.fortran/lib4.f90: New test. * testsuite/libgomp.fortran/lock-1.f90: New test. * testsuite/libgomp.fortran/lock-2.f90: New test. * testsuite/libgomp.fortran/nested1.f90: New test. * testsuite/libgomp.fortran/nestedfn4.f90: New test. * testsuite/libgomp.fortran/strassen.f90: New test. * testsuite/libgomp.fortran/tabs1.f90: New test. * testsuite/libgomp.fortran/tabs2.f: New test. * testsuite/libgomp.fortran/task1.f90: New test. * testsuite/libgomp.fortran/task2.f90: New test. * testsuite/libgomp.fortran/vla4.f90: Add dg-warning. * testsuite/libgomp.fortran/vla5.f90: Likewise. * testsuite/libgomp.c/pr26943-2.c: Likewise. * testsuite/libgomp.c/pr26943-3.c: Likewise. * testsuite/libgomp.c/pr26943-4.c: Likewise. Co-Authored-By: Jakob Blomer <jakob.blomer@ira.uka.de> Co-Authored-By: Richard Henderson <rth@redhat.com> Co-Authored-By: Ulrich Drepper <drepper@redhat.com> From-SVN: r136433
2008-06-06 15:01:54 +02:00
2008-06-06 Jakub Jelinek <jakub@redhat.com>
* scanner.c (skip_free_comments, skip_fixed_comments): Handle tabs.
* parse.c (next_free): Allow tab after !$omp.
(decode_omp_directive): Handle !$omp task, !$omp taskwait
and !$omp end task.
(case_executable): Add ST_OMP_TASKWAIT.
(case_exec_markers): Add ST_OMP_TASK.
(gfc_ascii_statement): Handle ST_OMP_TASK, ST_OMP_END_TASK and
ST_OMP_TASKWAIT.
(parse_omp_structured_block, parse_executable): Handle ST_OMP_TASK.
* gfortran.h (gfc_find_sym_in_expr): New prototype.
(gfc_statement): Add ST_OMP_TASK, ST_OMP_END_TASK and ST_OMP_TASKWAIT.
(gfc_omp_clauses): Add OMP_SCHED_AUTO to sched_kind,
OMP_DEFAULT_FIRSTPRIVATE to default_sharing. Add collapse and
untied fields.
(gfc_exec_op): Add EXEC_OMP_TASK and EXEC_OMP_TASKWAIT.
* f95-lang.c (LANG_HOOKS_OMP_CLAUSE_COPY_CTOR,
LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR,
LANG_HOOKS_OMP_PRIVATE_OUTER_REF): Define.
* trans.h (gfc_omp_clause_default_ctor): Add another argument.
(gfc_omp_clause_copy_ctor, gfc_omp_clause_assign_op,
gfc_omp_clause_dtor, gfc_omp_private_outer_ref): New prototypes.
* types.def (BT_ULONGLONG, BT_PTR_ULONGLONG,
BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR,
BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR,
BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR,
BT_FN_VOID_PTR_PTR, BT_PTR_FN_VOID_PTR_PTR,
BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT): New.
(BT_BOOL): Use integer type with BOOL_TYPE_SIZE rather
than boolean_type_node.
* dump-parse-tree.c (gfc_show_omp_node): Handle EXEC_OMP_TASK,
EXEC_OMP_TASKWAIT, OMP_SCHED_AUTO, OMP_DEFAULT_FIRSTPRIVATE,
untied and collapse clauses.
(gfc_show_code_node): Handle EXEC_OMP_TASK and EXEC_OMP_TASKWAIT.
* trans.c (gfc_trans_code): Handle EXEC_OMP_TASK and
EXEC_OMP_TASKWAIT.
* st.c (gfc_free_statement): Likewise.
* resolve.c (gfc_resolve_blocks, resolve_code): Likewise.
(find_sym_in_expr): Rename to...
(gfc_find_sym_in_expr): ... this. No longer static.
(resolve_allocate_expr, resolve_ordinary_assign): Adjust caller.
* match.h (gfc_match_omp_task, gfc_match_omp_taskwait): New
prototypes.
* openmp.c (resolve_omp_clauses): Allow allocatable arrays in
firstprivate, lastprivate, reduction, copyprivate and copyin
clauses.
(omp_current_do_code): Made static.
(omp_current_do_collapse): New variable.
(gfc_resolve_omp_do_blocks): Compute omp_current_do_collapse,
clear omp_current_do_code and omp_current_do_collapse on return.
(gfc_resolve_do_iterator): Handle collapsed do loops.
(resolve_omp_do): Likewise, diagnose errorneous collapsed do loops.
(OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_UNTIED): Define.
(gfc_match_omp_clauses): Handle default (firstprivate),
schedule (auto), untied and collapse (n) clauses.
(OMP_DO_CLAUSES): Add OMP_CLAUSE_COLLAPSE.
(OMP_TASK_CLAUSES): Define.
(gfc_match_omp_task, gfc_match_omp_taskwait): New functions.
* trans-openmp.c (gfc_omp_private_outer_ref): New function.
(gfc_omp_clause_default_ctor): Add outer argument. For allocatable
arrays allocate them with the bounds of the outer var if outer
var is allocated.
(gfc_omp_clause_copy_ctor, gfc_omp_clause_assign_op,
gfc_omp_clause_dtor): New functions.
(gfc_trans_omp_array_reduction): If decl is allocatable array,
allocate it with outer var's bounds in OMP_CLAUSE_REDUCTION_INIT
and deallocate it in OMP_CLAUSE_REDUCTION_MERGE.
(gfc_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED
for assumed-size arrays.
(gfc_trans_omp_do): Add par_clauses argument. If dovar is
present in lastprivate clause and do loop isn't simple,
set OMP_CLAUSE_LASTPRIVATE_STMT. If dovar is present in
parallel's lastprivate clause, change it to shared and add
lastprivate clause to OMP_FOR_CLAUSES. Handle collapsed do loops.
(gfc_trans_omp_directive): Adjust gfc_trans_omp_do callers.
(gfc_trans_omp_parallel_do): Likewise. Move collapse clause to
OMP_FOR from OMP_PARALLEL.
(gfc_trans_omp_clauses): Handle OMP_SCHED_AUTO,
OMP_DEFAULT_FIRSTPRIVATE, untied and collapse clauses.
(gfc_trans_omp_task, gfc_trans_omp_taskwait): New functions.
(gfc_trans_omp_directive): Handle EXEC_OMP_TASK and
EXEC_OMP_TASKWAIT.
2008-06-04 Janus Weil <janus@gcc.gnu.org>
PR fortran/36322
PR fortran/36275
* resolve.c (resolve_symbol): Correctly copy the interface for a
PROCEDURE declaration.
2008-06-02 Janus Weil <janus@gcc.gnu.org>
PR fortran/36361
* symbol.c (gfc_add_allocatable,gfc_add_dimension,
gfc_add_explicit_interface): Added checks.
* decl.c (attr_decl1): Added missing "var_locus".
* parse.c (parse_interface): Checking for errors.
gfortran.h: New statement-type ST_FINAL for FINAL declarations. 2008-06-02 Daniel Kraft <d@domob.eu> * gfortran.h: New statement-type ST_FINAL for FINAL declarations. (struct gfc_symbol): New member f2k_derived. (struct gfc_namespace): New member finalizers, for use in the above mentioned f2k_derived namespace. (struct gfc_finalizer): New type defined for finalizers linked list. * match.h (gfc_match_final_decl): New function header. * decl.c (gfc_match_derived_decl): Create f2k_derived namespace on constructed symbol node. (gfc_match_final_decl): New function to match a FINAL declaration line. * parse.c (decode_statement): match-call for keyword FINAL. (parse_derived): Parse CONTAINS section and accept FINAL statements. * resolve.c (gfc_resolve_finalizers): New function to resolve (that is in this case, check) a list of finalizer procedures. (resolve_fl_derived): Call gfc_resolve_finalizers here. * symbol.c (gfc_get_namespace): Initialize new finalizers to NULL. (gfc_free_namespace): Free finalizers list. (gfc_new_symbol): Initialize new f2k_derived to NULL. (gfc_free_symbol): Free f2k_derived namespace. (gfc_free_finalizer): New function to free a single gfc_finalizer node. (gfc_free_finalizer_list): New function to free a linked list of gfc_finalizer nodes. 2008-06-02 Daniel Kraft <d@domob.eu> * finalize_1.f08: New test. * finalize_2.f03: New test. * finalize_3.f03: New test. * finalize_4.f03: New test. * finalize_5.f03: New test. * finalize_6.f90: New test. * finalize_7.f03: New test. * finalize_8.f03: New test. From-SVN: r136293
2008-06-02 22:03:03 +02:00
2008-06-02 Daniel Kraft <d@domob.eu>
* gfortran.h: New statement-type ST_FINAL for FINAL declarations.
(struct gfc_symbol): New member f2k_derived.
(struct gfc_namespace): New member finalizers, for use in the above
mentioned f2k_derived namespace.
(struct gfc_finalizer): New type defined for finalizers linked list.
* match.h (gfc_match_final_decl): New function header.
* decl.c (gfc_match_derived_decl): Create f2k_derived namespace on
constructed symbol node.
(gfc_match_final_decl): New function to match a FINAL declaration line.
* parse.c (decode_statement): match-call for keyword FINAL.
(parse_derived): Parse CONTAINS section and accept FINAL statements.
* resolve.c (gfc_resolve_finalizers): New function to resolve (that is
in this case, check) a list of finalizer procedures.
(resolve_fl_derived): Call gfc_resolve_finalizers here.
* symbol.c (gfc_get_namespace): Initialize new finalizers to NULL.
(gfc_free_namespace): Free finalizers list.
(gfc_new_symbol): Initialize new f2k_derived to NULL.
(gfc_free_symbol): Free f2k_derived namespace.
(gfc_free_finalizer): New function to free a single gfc_finalizer node.
(gfc_free_finalizer_list): New function to free a linked list of
gfc_finalizer nodes.
2008-06-02 Daniel Franke <franke.daniel@gmail.com>
PR fortran/36375
PR fortran/36377
* cpp.c (gfc_cpp_init): Do not initialize builtins if
processing already preprocessed input.
(gfc_cpp_preprocess): Finalize output with newline.
2008-05-31 Jerry DeLisle <jvdelisle@gcc.gnu.org>
* intrinsic.texi: Revert wrong commit.
arith.c (gfc_arith_init_1): Remove now unused r and c variables. 2008-05-31 Steven G. Kargl <kargls@comcast.net> * arith.c (gfc_arith_init_1): Remove now unused r and c variables. Cleanup numerical inquiry function initialization. (gfc_arith_done_1): Replace multiple mpfr_clear() invocations with a single mpfr_clears(). (gfc_check_real_range): Re-arrange logic to eliminate multiple unnecessary branching and assignments. (gfc_arith_times): Use mpfr_clears() in preference to multiple mpfr_clear(). (gfc_arith_divide): Ditto. (complex_reciprocal): Eliminate now unused variables a, re, im. Cleanup the mpfr abuse. Use mpfr_clears() in preference to multiple mpfr_clear(). (complex_pow): Fix comment whitespace. Use mpfr_clears() in preference to multiple mpfr_clear(). * simplify.c (gfc_simplify_and): Remove blank line. (gfc_simplify_atan2): Move error checking earlier to eliminate a now unnecessay gfc_free_expr(). (gfc_simplify_bessel_j0): Remove unnecessary gfc_set_model_kind(). (gfc_simplify_bessel_j1): Ditto. (gfc_simplify_bessel_jn): Ditto. (gfc_simplify_bessel_y0): Ditto. (gfc_simplify_bessel_y1): Ditto. (gfc_simplify_bessel_yn): Ditto. (only_convert_cmplx_boz): Eliminate unnecessary duplicate code, and combine nested if statement rational expressions. (gfc_simplify_cos): Use mpfr_clears() in preference to multiple mpfr_clear(). (gfc_simplify_exp): Ditto. (gfc_simplify_fraction): Move gfc_set_model_kind() to after the special case of 0. Use mpfr_clears() in preference to multiple mpfr_clear(). (gfc_simplify_gamma): Eliminate unnecessary gfc_set_model_kind(). (gfc_simplify_lgamma): Ditto. (gfc_simplify_log10): Ditto. (gfc_simplify_log): Move gfc_set_model_kind () inside switch statement. Use mpfr_clears() in preference to multiple mpfr_clear(). (gfc_simplify_mod): Eliminate now unused variables quot, iquot, and term. Simplify the mpfr magic. (gfc_simplify_modulo): Ditto. (gfc_simplify_nearest): Eliminate unnecessary gfc_set_model_kind(). (gfc_simplify_scale): Use mpfr_clears() in preference to multiple mpfr_clear(). (gfc_simplify_sin): Ditto (gfc_simplify_sqrt): Ditto (gfc_simplify_set_exponent): Move gfc_set_model_kind() to after the special case of 0. Use mpfr_clears() in preference to multiple mpfr_clear(). From-SVN: r136239
2008-05-31 21:19:48 +02:00
2008-05-31 Steven G. Kargl <kargls@comcast.net>
* arith.c (gfc_arith_init_1): Remove now unused r and c variables.
Cleanup numerical inquiry function initialization.
(gfc_arith_done_1): Replace multiple mpfr_clear() invocations with
a single mpfr_clears().
(gfc_check_real_range): Re-arrange logic to eliminate multiple
unnecessary branching and assignments.
(gfc_arith_times): Use mpfr_clears() in preference to multiple
mpfr_clear().
(gfc_arith_divide): Ditto.
(complex_reciprocal): Eliminate now unused variables a, re, im.
Cleanup the mpfr abuse. Use mpfr_clears() in preference to
multiple mpfr_clear().
(complex_pow): Fix comment whitespace. Use mpfr_clears() in
preference to multiple mpfr_clear().
* simplify.c (gfc_simplify_and): Remove blank line.
(gfc_simplify_atan2): Move error checking earlier to eliminate
a now unnecessay gfc_free_expr().
(gfc_simplify_bessel_j0): Remove unnecessary gfc_set_model_kind().
(gfc_simplify_bessel_j1): Ditto.
(gfc_simplify_bessel_jn): Ditto.
(gfc_simplify_bessel_y0): Ditto.
(gfc_simplify_bessel_y1): Ditto.
(gfc_simplify_bessel_yn): Ditto.
(only_convert_cmplx_boz): Eliminate unnecessary duplicate code, and
combine nested if statement rational expressions.
(gfc_simplify_cos): Use mpfr_clears() in preference to multiple
mpfr_clear().
(gfc_simplify_exp): Ditto.
(gfc_simplify_fraction): Move gfc_set_model_kind() to after the
special case of 0. Use mpfr_clears() in preference to multiple
mpfr_clear().
(gfc_simplify_gamma): Eliminate unnecessary gfc_set_model_kind().
(gfc_simplify_lgamma): Ditto.
(gfc_simplify_log10): Ditto.
(gfc_simplify_log): Move gfc_set_model_kind () inside switch
statement. Use mpfr_clears() in preference to multiple mpfr_clear().
(gfc_simplify_mod): Eliminate now unused variables quot, iquot,
and term. Simplify the mpfr magic.
(gfc_simplify_modulo): Ditto.
(gfc_simplify_nearest): Eliminate unnecessary gfc_set_model_kind().
(gfc_simplify_scale): Use mpfr_clears() in preference to multiple
mpfr_clear().
(gfc_simplify_sin): Ditto
(gfc_simplify_sqrt): Ditto
(gfc_simplify_set_exponent): Move gfc_set_model_kind() to after the
special case of 0. Use mpfr_clears() in preference to multiple
mpfr_clear().
2008-05-29 Daniel Franke <franke.daniel@gmail.com>
PR target/36348
* Make-lang.in (F95_OBJS): Added dependency on FORTRAN_TARGET_OBJS.
2008-05-29 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* scanner.c (load_line): Add first_char argument. Don't call ungetc.
(gfc_read_orig_filename): Adjust call to load_line. Don't call
ungetc.
(load_file): Adjust call to load_line.
2008-05-28 Janus Weil <janus@gcc.gnu.org>
PR fortran/36325
PR fortran/35830
* interface.c (gfc_procedure_use): Enable argument checking for
external procedures with explicit interface.
* symbol.c (check_conflict): Fix conflict checking for externals.
(copy_formal_args): Fix handling of arrays.
* resolve.c (resolve_specific_f0, resolve_specific_s0): Fix handling
of intrinsics.
* parse.c (parse_interface): Non-abstract INTERFACE statement implies
EXTERNAL attribute.
re PR fortran/36319 (Segfault with wide characters in DATA) PR fortran/36319 * intrinsic.c (gfc_convert_chartype): Don't mark conversion function as pure. * trans-array.c (gfc_trans_array_ctor_element): Divide element size by the size of one character to obtain length. * iresolve.c (gfc_resolve_cshift): Call the _char4 variant when appropriate. (gfc_resolve_eoshift): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Minor beautification. (gfc_conv_intrinsic_fdate): Minor beautification. (gfc_conv_intrinsic_ttynam): Minor beautification. (gfc_conv_intrinsic_minmax_char): Allow all character kinds. (size_of_string_in_bytes): New function. (gfc_conv_intrinsic_size): Call size_of_string_in_bytes for character expressions. (gfc_conv_intrinsic_sizeof): Likewise. (gfc_conv_intrinsic_array_transfer): Likewise. (gfc_conv_intrinsic_trim): Allow all character kinds. Minor beautification. (gfc_conv_intrinsic_repeat): Fix comment typo. * simplify.c (gfc_convert_char_constant): Take care of conversion of array constructors. * intrinsics/string_intrinsics_inc.c (string_index): Return correct value for zero-length substring. * intrinsics/cshift0.c: Add _char4 variant. * intrinsics/eoshift0.c (eoshift0): Allow filler to be a pattern wider than a single byte. Add _char4 variant and use above functionality. * intrinsics/eoshift2.c (eoshift2): Likewise. * m4/eoshift1.m4: Likewise. * m4/eoshift3.m4: Likewise. * m4/cshift1.m4: Add _char4 variants. * gfortran.map (GFORTRAN_1.1): Add _gfortran_cshift0_1_char4, _gfortran_cshift0_2_char4, _gfortran_cshift0_4_char4, _gfortran_cshift0_8_char4, _gfortran_cshift1_16_char4, _gfortran_cshift1_4_char4, _gfortran_cshift1_8_char4, _gfortran_eoshift0_1_char4, _gfortran_eoshift0_2_char4, _gfortran_eoshift0_4_char4, _gfortran_eoshift0_8_char4, _gfortran_eoshift1_16_char4, _gfortran_eoshift1_4_char4, _gfortran_eoshift1_8_char4, _gfortran_eoshift2_1_char4, _gfortran_eoshift2_2_char4, _gfortran_eoshift2_4_char4, _gfortran_eoshift2_8_char4, _gfortran_eoshift3_16_char4, _gfortran_eoshift3_4_char4 and _gfortran_eoshift3_8_char4. * generated/eoshift3_4.c: Regenerate. * generated/eoshift1_8.c: Regenerate. * generated/eoshift1_16.c: Regenerate. * generated/cshift1_4.c: Regenerate. * generated/eoshift1_4.c: Regenerate. * generated/eoshift3_8.c: Regenerate. * generated/eoshift3_16.c: Regenerate. * generated/cshift1_8.c: Regenerate. * generated/cshift1_16.c: Regenerate. * gfortran.dg/widechar_5.f90: New file. * gfortran.dg/widechar_6.f90: New file. * gfortran.dg/widechar_7.f90: New file. * gfortran.dg/widechar_intrinsics_5.f90: Uncomment the lines testing the SPREAD intrinsic. * gfortran.dg/widechar_intrinsics_6.f90: New file. * gfortran.dg/widechar_intrinsics_7.f90: New file. * gfortran.dg/widechar_intrinsics_8.f90: New file. * gfortran.dg/widechar_intrinsics_9.f90: New file. * gfortran.dg/widechar_intrinsics_10.f90: New file. From-SVN: r136129
2008-05-28 23:11:39 +02:00
2008-05-28 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/36319
* intrinsic.c (gfc_convert_chartype): Don't mark conversion
function as pure.
* trans-array.c (gfc_trans_array_ctor_element): Divide element
size by the size of one character to obtain length.
* iresolve.c (gfc_resolve_cshift): Call the _char4 variant when
appropriate.
(gfc_resolve_eoshift): Likewise.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime): Minor beautification.
(gfc_conv_intrinsic_fdate): Minor beautification.
(gfc_conv_intrinsic_ttynam): Minor beautification.
(gfc_conv_intrinsic_minmax_char): Allow all character kinds.
(size_of_string_in_bytes): New function.
(gfc_conv_intrinsic_size): Call size_of_string_in_bytes for
character expressions.
(gfc_conv_intrinsic_sizeof): Likewise.
(gfc_conv_intrinsic_array_transfer): Likewise.
(gfc_conv_intrinsic_trim): Allow all character kinds. Minor
beautification.
(gfc_conv_intrinsic_repeat): Fix comment typo.
* simplify.c (gfc_convert_char_constant): Take care of conversion
of array constructors.
2008-05-27 Tobias Burnus <burnus@net-b.de>
PR fortran/36316
* trans-array.c (gfc_set_loop_bounds_from_array_spec):
Add missing fold_convert.
2008-05-26 Daniel Franke <franke.daniel@gmail.com>
* fortran/cpp.c (cpp_define_builtins): Remove usage of TARGET_* macros,
added FIXME instead.
re PR fortran/18428 (No preprocessing option -cpp for gfortran) gcc: 2008-05-26 Daniel Franke <franke.daniel@gmail.com> PR fortran/18428 * c.opt: Removed undocumented option '-lang-fortran'. * c-common.h: Removed global variable 'lang_fortran'. * c-opts.c (c_common_handle_option): Removed code to handle option '-lang-fortran'. Updated includes. * c-cppbuiltin.c (c_cpp_builtins): Removed conditional definition of '__GFORTRAN__'. (define__GNUC__): Reimplemented to use BASEVER and cpp_define_formatted. (builtin_define_with_value_n): Removed. * c-incpath.h: Renamed to ... * incpath.h: ... this. * c-incpath.c: Renamed to ... * incpath.c: ... this. Updated includes. * fix-header.c: Updated includes. * Makefile.in: Replaced c-incpath.[ch] by incpath.[ch]. (c-cppbuiltin.o): Added dependency on and definition of BASEVER. (OBJ-archive): Added cppdefault.o, incpath.o and prefix.o. gcc/cp: 2008-05-26 Daniel Franke <franke.daniel@gmail.com> * Makefile.in: Adjusted dependencies on c-incpath.o. gcc/fortran: 2008-05-26 Daniel Franke <franke.daniel@gmail.com> PR fortran/18428 * lang.opt (A, C, CC, D, E, H, P, U, cpp, d, fworking-directory, imultilib, iprefix, iquote, isysroot, isystem, nocpp, nostdinc, o, undef, v): New options. * options.c (gfc_init_options): Also initialize preprocessor options. (gfc_post_options): Also handle post-initialization of preprocessor options. (gfc_handle_option): Check if option is a preprocessor option. If yes, let gfc_cpp_handle_option() handle the option. * lang-specs.h: Reorganized to handle new options. * scanner.c (gfc_new_file): Read temporary file instead of input source if preprocessing is enabled. * f95-lang.c (gfc_init): Initialize preprocessor. (gfc_finish): Clean up preprocessor. * cpp.c: New. * cpp.h: New. * Make-lang.in: Added new objects and dependencies. * gfortran.texi: Updated section "Preprocessing and conditional compilation". * invoke.texi: Added new section "Preprocessing Options", listed and documented the preprocessing options handled by gfortran. From-SVN: r135882
2008-05-26 00:37:41 +02:00
2008-05-26 Daniel Franke <franke.daniel@gmail.com>
PR fortran/18428
* lang.opt (A, C, CC, D, E, H, P, U, cpp, d, fworking-directory,
imultilib, iprefix, iquote, isysroot, isystem, nocpp, nostdinc,
o, undef, v): New options.
* options.c (gfc_init_options): Also initialize preprocessor
options.
(gfc_post_options): Also handle post-initialization of preprocessor
options.
(gfc_handle_option): Check if option is a preprocessor option.
If yes, let gfc_cpp_handle_option() handle the option.
* lang-specs.h: Reorganized to handle new options.
* scanner.c (gfc_new_file): Read temporary file instead of
input source if preprocessing is enabled.
* f95-lang.c (gfc_init): Initialize preprocessor.
(gfc_finish): Clean up preprocessor.
* cpp.c: New.
* cpp.h: New.
* Make-lang.in: Added new objects and dependencies.
* gfortran.texi: Updated section "Preprocessing and
conditional compilation".
* invoke.texi: Added new section "Preprocessing Options",
listed and documented the preprocessing options handled
by gfortran.
2008-05-25 Tobias Burnus <burnus@net-b.de>
PR fortran/32600
* trans-expr.c (gfc_conv_function_call): Remove library
call for c_f_pointer with scalar Fortran pointers and for
c_f_procpointer.
2008-05-21 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/36257
* iresolve.c (check_charlen_present): Don't force the rank to 1.
2008-05-19 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/36265
* trans-expr.c (gfc_conv_string_tmp): Pick the correct type for
the temporary variable.
2008-05-19 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* simplify.c (gfc_simplify_dble, gfc_simplify_real): Initialize
result variable to avoid warnings.
intrinsic.c (char_conversions, ncharconv): New static variables. * intrinsic.c (char_conversions, ncharconv): New static variables. (find_char_conv): New function. (add_functions): Add simplification functions for ADJUSTL and ADJUSTR. Don't check the kind of their argument. Add checking for LGE, LLE, LGT and LLT. (add_subroutines): Fix argument type for SLEEP. Fix argument name for SYSTEM. (add_char_conversions): New function. (gfc_intrinsic_init_1): Call add_char_conversions. (gfc_intrinsic_done_1): Free char_conversions. (check_arglist): Use kind == 0 as a signal that we don't want the kind value to be checked. (do_simplify): Also simplify character functions. (gfc_convert_chartype): New function * trans-array.c (gfc_trans_array_ctor_element): Don't force the use of default character type. (gfc_trans_array_constructor_value): Likewise. (get_array_ctor_var_strlen): Use integer kind to build an integer instead of a character kind! (gfc_build_constant_array_constructor): Don't force the use of default character type. (gfc_conv_loop_setup): Likewise. * trans-expr.c (gfc_conv_string_tmp): Don't force the use of default character type. Allocate enough memory for wide strings. (gfc_conv_concat_op): Make sure operand kind are the same. (string_to_single_character): Remove gfc_ prefix. Reindent. Don't force the use of default character type. (gfc_conv_scalar_char_value): Likewise. (gfc_build_compare_string): Call string_to_single_character. (fill_with_spaces): New function (gfc_trans_string_copy): Add kind arguments. Use them to deal with wide character kinds. (gfc_conv_statement_function): Whitespace fix. Call gfc_trans_string_copy with new kind arguments. (gfc_conv_substring_expr): Call gfc_build_wide_string_const instead of using gfc_widechar_to_char. (gfc_conv_string_parameter): Don't force the use of default character type. (gfc_trans_scalar_assign): Pass kind args to gfc_trans_string_copy. * intrinsic.h (gfc_check_lge_lgt_lle_llt, gfc_convert_char_constant, gfc_resolve_adjustl, gfc_resolve_adjustr): New prototypes. * decl.c (gfc_set_constant_character_len): Don't assert the existence of a single character kind. * trans-array.h (gfc_trans_string_copy): New prototype. * gfortran.h (gfc_check_character_range, gfc_convert_chartype): New prototypes. * error.c (print_wide_char_into_buffer): New function lifting code from gfc_print_wide_char. Fix order to output '\x??' instead of 'x\??'. (gfc_print_wide_char): Call print_wide_char_into_buffer. (show_locus): Call print_wide_char_into_buffer with buffer local to this function. * trans-const.c (gfc_build_wide_string_const): New function. (gfc_conv_string_init): Deal with wide characters strings constructors. (gfc_conv_constant_to_tree): Call gfc_build_wide_string_const. * trans-stmt.c (gfc_trans_label_assign): Likewise. (gfc_trans_character_select): Deal with wide strings. * expr.c (gfc_check_assign): Allow conversion between character kinds on assignment. * trans-const.h (gfc_build_wide_string_const): New prototype. * trans-types.c (gfc_get_character_type_len_for_eltype, gfc_get_character_type_len): Create too variants of the old gfc_get_character_type_len, one getting kind argument and the other one directly taking a type tree. * trans.h (gfor_fndecl_select_string_char4, gfor_fndecl_convert_char1_to_char4, gfor_fndecl_convert_char4_to_char1): New prototypes. * trans-types.h (gfc_get_character_type_len_for_eltype): New prototype. * resolve.c (resolve_operator): Exit early when kind mismatches are detected, because that makes us issue an error message later. (validate_case_label_expr): Fix wording of error message. * iresolve.c (gfc_resolve_adjustl, gfc_resolve_adjustr): New functions. (gfc_resolve_pack): Call _char4 variants of library function when dealing with wide characters. (gfc_resolve_reshape): Likewise. (gfc_resolve_spread): Likewise. (gfc_resolve_transpose): Likewise. (gfc_resolve_unpack): Likewise. * target-memory.c (size_character): Take character kind bit size correctly into account (not that it changes anything for now, but it's more generic). (gfc_encode_character): Added gfc_ prefix. Encoding each character of a string by calling native_encode_expr for the corresponding unsigned integer. (gfc_target_encode_expr): Add gfc_ prefix to encode_character. * trans-decl.c (gfc_build_intrinsic_function_decls): Build gfor_fndecl_select_string_char4, gfor_fndecl_convert_char1_to_char4 and gfor_fndecl_convert_char4_to_char1. * target-memory.h (gfc_encode_character): New prototype. * arith.c (gfc_check_character_range): New function. (eval_intrinsic): Allow non-default character kinds. * check.c (gfc_check_access_func): Only allow default character kind arguments. (gfc_check_chdir): Likewise. (gfc_check_chdir_sub): Likewise. (gfc_check_chmod): Likewise. (gfc_check_chmod_sub): Likewise. (gfc_check_lge_lgt_lle_llt): New function. (gfc_check_link): Likewise. (gfc_check_link_sub): Likewise. (gfc_check_symlnk): Likewise. (gfc_check_symlnk_sub): Likewise. (gfc_check_rename): Likewise. (gfc_check_rename_sub): Likewise. (gfc_check_fgetputc_sub): Likewise. (gfc_check_fgetput_sub): Likewise. (gfc_check_stat): Likewise. (gfc_check_stat_sub): Likewise. (gfc_check_date_and_time): Likewise. (gfc_check_ctime_sub): Likewise. (gfc_check_fdate_sub): Likewise. (gfc_check_gerror): Likewise. (gfc_check_getcwd_sub): Likewise. (gfc_check_getarg): Likewise. (gfc_check_getlog): Likewise. (gfc_check_hostnm): Likewise. (gfc_check_hostnm_sub): Likewise. (gfc_check_ttynam_sub): Likewise. (gfc_check_perror): Likewise. (gfc_check_unlink): Likewise. (gfc_check_unlink_sub): Likewise. (gfc_check_system_sub): Likewise. * primary.c (got_delim): Perform correct character range checking for all kinds. * trans-intrinsic.c (gfc_conv_intrinsic_conversion): Generate calls to library functions convert_char4_to_char1 and convert_char1_to_char4 for character conversions. (gfc_conv_intrinsic_char): Allow all character kings. (gfc_conv_intrinsic_strcmp): Fix whitespace. (gfc_conv_intrinsic_repeat): Take care of all character kinds. * intrinsic.texi: For all GNU intrinsics accepting character arguments, mention that they're restricted to the default kind. * simplify.c (simplify_achar_char): New function. (gfc_simplify_achar, gfc_simplify_char): Call simplify_achar_char. gfc_simplify_ichar): Don't error out for wide characters. (gfc_convert_char_constant): New function. * gfortran.dg/achar_3.f90: Adjust error messages. * gfortran.dg/achar_5.f90: New test. * gfortran.dg/achar_6.F90: New test. * gfortran.dg/widechar_1.f90: New test. * gfortran.dg/widechar_2.f90: New test. * gfortran.dg/widechar_3.f90: New test. * gfortran.dg/widechar_4.f90: New test. * gfortran.dg/widechar_intrinsics_1.f90: New test. * gfortran.dg/widechar_intrinsics_2.f90: New test. * gfortran.dg/widechar_intrinsics_3.f90: New test. * gfortran.dg/widechar_intrinsics_4.f90: New test. * gfortran.dg/widechar_intrinsics_5.f90: New test. * gfortran.dg/widechar_select_1.f90: New test. * gfortran.dg/widechar_select_2.f90: New test. From-SVN: r135515
2008-05-19 00:45:05 +02:00
2008-05-18 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* intrinsic.c (char_conversions, ncharconv): New static variables.
(find_char_conv): New function.
(add_functions): Add simplification functions for ADJUSTL and
ADJUSTR. Don't check the kind of their argument. Add checking for
LGE, LLE, LGT and LLT.
(add_subroutines): Fix argument type for SLEEP. Fix argument name
for SYSTEM.
(add_char_conversions): New function.
(gfc_intrinsic_init_1): Call add_char_conversions.
(gfc_intrinsic_done_1): Free char_conversions.
(check_arglist): Use kind == 0 as a signal that we don't want
the kind value to be checked.
(do_simplify): Also simplify character functions.
(gfc_convert_chartype): New function
* trans-array.c (gfc_trans_array_ctor_element): Don't force the
use of default character type.
(gfc_trans_array_constructor_value): Likewise.
(get_array_ctor_var_strlen): Use integer kind to build an integer
instead of a character kind!
(gfc_build_constant_array_constructor): Don't force the use of
default character type.
(gfc_conv_loop_setup): Likewise.
* trans-expr.c (gfc_conv_string_tmp): Don't force the use of
default character type. Allocate enough memory for wide strings.
(gfc_conv_concat_op): Make sure operand kind are the same.
(string_to_single_character): Remove gfc_ prefix. Reindent.
Don't force the use of default character type.
(gfc_conv_scalar_char_value): Likewise.
(gfc_build_compare_string): Call string_to_single_character.
(fill_with_spaces): New function
(gfc_trans_string_copy): Add kind arguments. Use them to deal
with wide character kinds.
(gfc_conv_statement_function): Whitespace fix. Call
gfc_trans_string_copy with new kind arguments.
(gfc_conv_substring_expr): Call gfc_build_wide_string_const
instead of using gfc_widechar_to_char.
(gfc_conv_string_parameter): Don't force the use of default
character type.
(gfc_trans_scalar_assign): Pass kind args to gfc_trans_string_copy.
* intrinsic.h (gfc_check_lge_lgt_lle_llt, gfc_convert_char_constant,
gfc_resolve_adjustl, gfc_resolve_adjustr): New prototypes.
* decl.c (gfc_set_constant_character_len): Don't assert the
existence of a single character kind.
* trans-array.h (gfc_trans_string_copy): New prototype.
* gfortran.h (gfc_check_character_range, gfc_convert_chartype):
New prototypes.
* error.c (print_wide_char_into_buffer): New function lifting
code from gfc_print_wide_char. Fix order to output '\x??' instead
of 'x\??'.
(gfc_print_wide_char): Call print_wide_char_into_buffer.
(show_locus): Call print_wide_char_into_buffer with buffer local
to this function.
* trans-const.c (gfc_build_wide_string_const): New function.
(gfc_conv_string_init): Deal with wide characters strings
constructors.
(gfc_conv_constant_to_tree): Call gfc_build_wide_string_const.
* trans-stmt.c (gfc_trans_label_assign): Likewise.
(gfc_trans_character_select): Deal with wide strings.
* expr.c (gfc_check_assign): Allow conversion between character
kinds on assignment.
* trans-const.h (gfc_build_wide_string_const): New prototype.
* trans-types.c (gfc_get_character_type_len_for_eltype,
gfc_get_character_type_len): Create too variants of the old
gfc_get_character_type_len, one getting kind argument and the
other one directly taking a type tree.
* trans.h (gfor_fndecl_select_string_char4,
gfor_fndecl_convert_char1_to_char4,
gfor_fndecl_convert_char4_to_char1): New prototypes.
* trans-types.h (gfc_get_character_type_len_for_eltype): New
prototype.
* resolve.c (resolve_operator): Exit early when kind mismatches
are detected, because that makes us issue an error message later.
(validate_case_label_expr): Fix wording of error message.
* iresolve.c (gfc_resolve_adjustl, gfc_resolve_adjustr): New
functions.
(gfc_resolve_pack): Call _char4 variants of library function
when dealing with wide characters.
(gfc_resolve_reshape): Likewise.
(gfc_resolve_spread): Likewise.
(gfc_resolve_transpose): Likewise.
(gfc_resolve_unpack): Likewise.
* target-memory.c (size_character): Take character kind bit size
correctly into account (not that it changes anything for now, but
it's more generic).
(gfc_encode_character): Added gfc_ prefix. Encoding each
character of a string by calling native_encode_expr for the
corresponding unsigned integer.
(gfc_target_encode_expr): Add gfc_ prefix to encode_character.
* trans-decl.c (gfc_build_intrinsic_function_decls): Build
gfor_fndecl_select_string_char4, gfor_fndecl_convert_char1_to_char4
and gfor_fndecl_convert_char4_to_char1.
* target-memory.h (gfc_encode_character): New prototype.
* arith.c (gfc_check_character_range): New function.
(eval_intrinsic): Allow non-default character kinds.
* check.c (gfc_check_access_func): Only allow default
character kind arguments.
(gfc_check_chdir): Likewise.
(gfc_check_chdir_sub): Likewise.
(gfc_check_chmod): Likewise.
(gfc_check_chmod_sub): Likewise.
(gfc_check_lge_lgt_lle_llt): New function.
(gfc_check_link): Likewise.
(gfc_check_link_sub): Likewise.
(gfc_check_symlnk): Likewise.
(gfc_check_symlnk_sub): Likewise.
(gfc_check_rename): Likewise.
(gfc_check_rename_sub): Likewise.
(gfc_check_fgetputc_sub): Likewise.
(gfc_check_fgetput_sub): Likewise.
(gfc_check_stat): Likewise.
(gfc_check_stat_sub): Likewise.
(gfc_check_date_and_time): Likewise.
(gfc_check_ctime_sub): Likewise.
(gfc_check_fdate_sub): Likewise.
(gfc_check_gerror): Likewise.
(gfc_check_getcwd_sub): Likewise.
(gfc_check_getarg): Likewise.
(gfc_check_getlog): Likewise.
(gfc_check_hostnm): Likewise.
(gfc_check_hostnm_sub): Likewise.
(gfc_check_ttynam_sub): Likewise.
(gfc_check_perror): Likewise.
(gfc_check_unlink): Likewise.
(gfc_check_unlink_sub): Likewise.
(gfc_check_system_sub): Likewise.
* primary.c (got_delim): Perform correct character range checking
for all kinds.
* trans-intrinsic.c (gfc_conv_intrinsic_conversion): Generate
calls to library functions convert_char4_to_char1 and
convert_char1_to_char4 for character conversions.
(gfc_conv_intrinsic_char): Allow all character kings.
(gfc_conv_intrinsic_strcmp): Fix whitespace.
(gfc_conv_intrinsic_repeat): Take care of all character kinds.
* intrinsic.texi: For all GNU intrinsics accepting character
arguments, mention that they're restricted to the default kind.
* simplify.c (simplify_achar_char): New function.
(gfc_simplify_achar, gfc_simplify_char): Call simplify_achar_char.
gfc_simplify_ichar): Don't error out for wide characters.
(gfc_convert_char_constant): New function.
2008-05-18 Steven G. Kargl <kargls@comcast.net>
PR fortran/36251
* symbol.c (check_conflict): Issue errors for abuse of PUBLIC, PRIVATE,
and BIND(C).
* resolve.c (gfc_verify_binding_labels): Fix NULL pointer dereference.
2008-05-17 Tobias Burnus <burnus@net-b.de>
* intrinsic.texi: Correct description of GET_COMMAND_ARGUMENT
and GET_ENVIRONMENT_VARIABLE; fix keyword= name for GETENV,
GETLOG, GMTIME, HOSTNM, IRAND, ITIME, KILL.
Move LOG_GAMMA after LOG10.
2008-05-17 Tobias Burnus <burnus@net-b.de>
* intrinsic.c (add_functions): Change FLUSH(C) to FLUSH(UNIT).
* intrinsic.texi: Change INTEGER(*) to INTEGER; fix keyword= name for
ABS, ADJUSTL, AINT, ALLOCATED, ANINT, ASSOCIATED, C_ASSOCIATED,
CEILING, DBLE, DFLOAT, DOT_PRODUCT, DREAL, FLOAT, FLOOR, GET_COMMAND.
2008-05-16 Paul Thomas <pault@gcc.gnu.org>
PR fortran/35756
PR fortran/35759
* trans-stmt.c (gfc_trans_where): Tighten up the dependency
check for calling gfc_trans_where_3.
PR fortran/35743
* trans-stmt.c (gfc_trans_where_2): Set the mask size to zero
if it is calculated to be negative.
PR fortran/35745
* trans-stmt.c (gfc_trans_where_3, gfc_trans_where_assign): Set
ss->where for scalar right hand sides.
* trans-array.c (gfc_add_loop_ss_code): If ss->where is set do
not evaluate scalars outside the loop. Clean up whitespace.
* trans.h : Add a bitfield 'where' to gfc_ss.
2008-05-16 Tobias Burnus <burnus@net-b.de>
* libgfortran.h: Increase GFC_MAX_DIMENSIONS to 15.
* array.c (gfc_match_array_spec): Error with -std=f2003 if rank > 7.
re PR fortran/27997 (Fortran 2003: Support type-spec for array constructor) 2008-04-16 Daniel Kraft <d@domob.eu> PR fortran/27997 * gfortran.h: Added field "length_from_typespec" to gfc_charlength. * aray.c (gfc_match_array_constructor): Added code to parse * typespec. (check_element_type, check_constructor_type, gfc_check_constructor_type): Extended to support explicit typespec on constructor. (gfc_resolve_character_array_constructor): Pad strings correctly for explicit, constant character length. * trans-array.c: New static global variable * "typespec_chararray_ctor" (gfc_trans_array_constructor): New code to support explicit but dynamic character lengths. 2008-04-16 Daniel Kraft <d@domob.eu> PR fortran/27997 * gfortran.dg/array_constructor_type_1.f03: New test * gfortran.dg/array_constructor_type_2.f03: New test * gfortran.dg/array_constructor_type_3.f03: New test * gfortran.dg/array_constructor_type_4.f03: New test * gfortran.dg/array_constructor_type_5.f03: New test * gfortran.dg/array_constructor_type_6.f03: New test * gfortran.dg/array_constructor_type_7.f03: New test * gfortran.dg/array_constructor_type_8.f03: New test * gfortran.dg/array_constructor_type_9.f: New test * gfortran.dg/array_constructor_type_10.f03: New test * gfortran.dg/array_constructor_type_11.f03: New test * gfortran.dg/array_constructor_type_12.f03: New test * gfortran.dg/array_constructor_type_13.f90: New test * gfortran.dg/array_constructor_type_14.f03: New test * gfortran.dg/array_constructor_type_15.f03: New test * gfortran.dg/array_constructor_type_16.f03: New test * gfortran.dg/array_constructor_type_17.f03: New test * gfortran.dg/array_constructor_type_18.f03: New test From-SVN: r135439
2008-05-16 21:50:04 +02:00
2008-04-16 Daniel Kraft <d@domob.eu>
PR fortran/27997
* gfortran.h: Added field "length_from_typespec" to gfc_charlength.
* aray.c (gfc_match_array_constructor): Added code to parse typespec.
(check_element_type, check_constructor_type, gfc_check_constructor_type):
Extended to support explicit typespec on constructor.
(gfc_resolve_character_array_constructor): Pad strings correctly for
explicit, constant character length.
* trans-array.c: New static global variable "typespec_chararray_ctor"
(gfc_trans_array_constructor): New code to support explicit but dynamic
character lengths.
2008-05-16 Jerry DeLisle <jvdelisle@gcc.gnu.org>
re PR fortran/27997 (Fortran 2003: Support type-spec for array constructor) 2008-04-16 Daniel Kraft <d@domob.eu> PR fortran/27997 * gfortran.h: Added field "length_from_typespec" to gfc_charlength. * aray.c (gfc_match_array_constructor): Added code to parse * typespec. (check_element_type, check_constructor_type, gfc_check_constructor_type): Extended to support explicit typespec on constructor. (gfc_resolve_character_array_constructor): Pad strings correctly for explicit, constant character length. * trans-array.c: New static global variable * "typespec_chararray_ctor" (gfc_trans_array_constructor): New code to support explicit but dynamic character lengths. 2008-04-16 Daniel Kraft <d@domob.eu> PR fortran/27997 * gfortran.dg/array_constructor_type_1.f03: New test * gfortran.dg/array_constructor_type_2.f03: New test * gfortran.dg/array_constructor_type_3.f03: New test * gfortran.dg/array_constructor_type_4.f03: New test * gfortran.dg/array_constructor_type_5.f03: New test * gfortran.dg/array_constructor_type_6.f03: New test * gfortran.dg/array_constructor_type_7.f03: New test * gfortran.dg/array_constructor_type_8.f03: New test * gfortran.dg/array_constructor_type_9.f: New test * gfortran.dg/array_constructor_type_10.f03: New test * gfortran.dg/array_constructor_type_11.f03: New test * gfortran.dg/array_constructor_type_12.f03: New test * gfortran.dg/array_constructor_type_13.f90: New test * gfortran.dg/array_constructor_type_14.f03: New test * gfortran.dg/array_constructor_type_15.f03: New test * gfortran.dg/array_constructor_type_16.f03: New test * gfortran.dg/array_constructor_type_17.f03: New test * gfortran.dg/array_constructor_type_18.f03: New test From-SVN: r135439
2008-05-16 21:50:04 +02:00
PR fortran/34325
* decl.c (match_attr_spec): Check for matching pairs of parenthesis.
* expr.c (gfc_specification_expr): Supplement the error message with the
type that was found.
* resolve.c (gfc_resolve_index): Likewise.
* match.c (gfc_match_parens): Clarify error message with "at or before".
(gfc_match_do): Check for matching pairs of parenthesis.
2008-05-16 Tobias Burnus <burnus@net-b.de
* intrinsic.texi: Write Fortran 77/90/95 instead of F77/90/95;
add missing KIND argument to ACHAR and NINT; and state that
the KIND argument is a F2003 extension for ACHAR, COUNT, IACHAR,
ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND, VERIFY.
2008-05-16 Daniel Kraft <d@domob.eu>
* primary.c: New private structure "gfc_structure_ctor_component".
(gfc_free_structure_ctor_component): New helper function.
(gfc_match_structure_constructor): Extended largely to support named
arguments and default initialization for structure constructors.
2008-05-15 Steven G. Kargl <kargls@comcast.net>
* simplify.c (gfc_simplify_dble, gfc_simplify_float,
simplify_bound, gfc_simplify_nearest, gfc_simplify_real): Plug
possible memory leaks.
(gfc_simplify_reshape): Plug possible memory leaks and dereferencing
of NULL pointers.
2008-05-15 Steven G. Kargl <kargls@comcast.net>
PR fortran/36239
* simplify.c (gfc_simplify_int, gfc_simplify_intconv): Replaced hand
rolled integer conversion with gfc_int2int, gfc_real2int, and
gfc_complex2int.
(gfc_simplify_intconv): Renamed to simplify_intconv.
2008-05-15 Steven G. Kargl, <kargl@comcast.net>
* gfortran.dg/and_or_xor.f90: New test
* fortran/simplify.c (gfc_simplify_and, gfc_simplify_or,
gfc_simplify_xor): Don't range check logical results.
trans-expr.c (gfc_conv_concat_op): Take care of nondefault character kinds. * trans-expr.c (gfc_conv_concat_op): Take care of nondefault character kinds. (gfc_build_compare_string): Add kind argument and use it. (gfc_conv_statement_function): Fix indentation. * gfortran.h (gfc_character_info): New structure. (gfc_character_kinds): New array. * trans-types.c (gfc_character_kinds, gfc_character_types, gfc_pcharacter_types): New array. (gfc_init_kinds): Fill character kinds array. (validate_character): Take care of nondefault character kinds. (gfc_build_uint_type): New function. (gfc_init_types): Take care of nondefault character kinds. (gfc_get_char_type, gfc_get_pchar_type): New functions. (gfc_get_character_type_len): Use gfc_get_char_type. * trans.h (gfc_build_compare_string): Adjust prototype. (gfor_fndecl_compare_string_char4, gfor_fndecl_concat_string_char4, gfor_fndecl_string_len_trim_char4, gfor_fndecl_string_index_char4, gfor_fndecl_string_scan_char4, gfor_fndecl_string_verify_char4, gfor_fndecl_string_trim_char4, gfor_fndecl_string_minmax_char4, gfor_fndecl_adjustl_char4, gfor_fndecl_adjustr_char4): New prototypes. * trans-types.h (gfc_get_char_type, gfc_get_pchar_type): New prototypes. * trans-decl.c (gfor_fndecl_compare_string_char4, gfor_fndecl_string_len_trim_char4, gfor_fndecl_string_index_char4, gfor_fndecl_string_scan_char4, gfor_fndecl_string_verify_char4, gfor_fndecl_string_trim_char4, gfor_fndecl_string_minmax_char4, gfor_fndecl_adjustl_char4, gfor_fndecl_adjustr_char4, gfor_fndecl_concat_string_char4): New function decls. (gfc_build_intrinsic_function_decls): Define new *_char4 function decls. * trans-intrinsic.c (gfc_conv_intrinsic_minmax_char, gfc_conv_intrinsic_len_trim, gfc_conv_intrinsic_ichar, gfc_conv_intrinsic_strcmp, gfc_conv_intrinsic_trim, gfc_conv_intrinsic_function): Deal with nondefault character kinds. From-SVN: r135397
2008-05-15 23:12:53 +02:00
2008-05-15 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* trans-expr.c (gfc_conv_concat_op): Take care of nondefault
character kinds.
(gfc_build_compare_string): Add kind argument and use it.
(gfc_conv_statement_function): Fix indentation.
* gfortran.h (gfc_character_info): New structure.
(gfc_character_kinds): New array.
* trans-types.c (gfc_character_kinds, gfc_character_types,
gfc_pcharacter_types): New array.
(gfc_init_kinds): Fill character kinds array.
(validate_character): Take care of nondefault character kinds.
(gfc_build_uint_type): New function.
(gfc_init_types): Take care of nondefault character kinds.
(gfc_get_char_type, gfc_get_pchar_type): New functions.
(gfc_get_character_type_len): Use gfc_get_char_type.
* trans.h (gfc_build_compare_string): Adjust prototype.
(gfor_fndecl_compare_string_char4, gfor_fndecl_concat_string_char4,
gfor_fndecl_string_len_trim_char4, gfor_fndecl_string_index_char4,
gfor_fndecl_string_scan_char4, gfor_fndecl_string_verify_char4,
gfor_fndecl_string_trim_char4, gfor_fndecl_string_minmax_char4,
gfor_fndecl_adjustl_char4, gfor_fndecl_adjustr_char4): New
prototypes.
* trans-types.h (gfc_get_char_type, gfc_get_pchar_type): New
prototypes.
* trans-decl.c (gfor_fndecl_compare_string_char4,
gfor_fndecl_string_len_trim_char4, gfor_fndecl_string_index_char4,
gfor_fndecl_string_scan_char4, gfor_fndecl_string_verify_char4,
gfor_fndecl_string_trim_char4, gfor_fndecl_string_minmax_char4,
gfor_fndecl_adjustl_char4, gfor_fndecl_adjustr_char4,
gfor_fndecl_concat_string_char4): New function decls.
(gfc_build_intrinsic_function_decls): Define new *_char4 function
decls.
* trans-intrinsic.c (gfc_conv_intrinsic_minmax_char,
gfc_conv_intrinsic_len_trim, gfc_conv_intrinsic_ichar,
gfc_conv_intrinsic_strcmp, gfc_conv_intrinsic_trim,
gfc_conv_intrinsic_function): Deal with nondefault character kinds.
2008-05-15 Sa Liu <saliu@de.ibm.com>
* iso-c-binding.def: Add standard parameter to macro NAMED_INTCST.
All existing NAMED_INTCST definitions has standard GFC_STD_F2003,
c_int128_t, c_int_least128_t and c_int_fast128_t are added as
GNU extensions.
* iso-fortran-evn.def: Add standard parameter GFC_STD_F2003
to macro NAMED_INTCST.
* symbol.c (std_for_isocbinding_symbol): New helper function to
return the standard that supports this isocbinding symbol.
(generate_isocbinding_symbol): Do not generate GNU extension symbols
if std=f2003. Add new parameter to NAMED_INTCST.
* module.c (use_iso_fortran_env_module): Add new parameter to
NAMED_INTCST and new field standard to struct intmod_sym.
* gfortran.h: Add new parameter to NAMED_INTCST.
* trans-types.c (init_c_interop_kinds): Add new parameter to
NAMED_INTCST.
* intrinsic.texi: Documented new types C_INT128_T, C_INT_LEASE128_T
and C_INT_FAST128_T.
2008-05-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/36059
* trans-decl.c (gfc_build_dummy_array_decl): Don't repack
arrays that have the TARGET attribute.
2008-05-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/36186
* simplify.c (only_convert_cmplx_boz): New function.
(gfc_simplify_cmplx, gfc_simplify_complex, gfc_simplify_dcmplx):
Call only_convert_cmplx_boz.
2008-05-14 Paul Thomas <pault@gcc.gnu.org>
PR fortran/36233
* interface.c (compare_actual_formal): Do not check sizes if the
actual is BT_PROCEDURE.
2008-05-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/35682
* trans-array.c (gfc_conv_ss_startstride): Any negative size is
the same as zero size.
(gfc_conv_loop_setup): Fix size calculation.
2008-05-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/35685
* trans-intrinsic.c (gfc_conv_intrinsic_bound): Correctly
handle zero-size sections.
2008-05-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/36215
* scanner.c (preprocessor_line): Allocate enough memory for a
wide string.
2008-05-12 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/36176
* target-memory.c (gfc_target_expr_size): Correctly treat
substrings.
(gfc_target_encode_expr): Likewise.
(gfc_interpret_complex): Whitespace change.
2008-05-11 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/35719
* trans.c (gfc_call_malloc): If size equals zero, allocate one
byte; don't return a null pointer.
2008-05-10 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/36197
* module.c (quote_string): Fix sprintf format.
2008-05-09 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/36162
* module.c (quote_string, unquote_string,
mio_allocated_wide_string): New functions.
(mio_expr): Call mio_allocated_wide_string where needed.
[multiple changes] 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com> PATCH rtl/7335 PATCH rtl/33826 * see.c (see_copy_insn): Copy new pure const attributes for new call. * c-decl.c (merge_decls): Ditto. * postreload.c (record_opr_changes): Change CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. * tree.c (define_local_buitin): Rename DECL_IS_PURE to DECL_PURE_P. Initialized DECL_LOOPING_CONST_PURE. (process_call_operands): Set tree_side_effects properly. * tree.h (TREE_READONLY_DECL_P): Removed. (DECL_IS_PURE): Renamed to DECL_PURE_P. (DECL_LOOPING_OR_CONST_P): New macro. (struct tree_function_decl): Added looping_const_or_pure_p. (ECF_*) Renumbered. (ECF_LOOPING_OR_CONST_P): New macro, * rtlanal.c (pure_const_p): Removed. * builtins.c (expand_builtin): Rename DECL_IS_PURE to DECL_PURE_P. * reorg.c (delete_prior_computation) Changed CONST_OR_PURE_CALL_P to RTL_CONST_CALL_P. * ipa-pure-const.c (pure_const_state_e): Added looping field. (check_decl, check_tree, check_call, scan_function): Initialize looping. (analyze_function): Rename DECL_IS_PURE to DECL_PURE_P. (static_execute): Set looping true for recursive functions. Undo setting state to IPA_NEITHER for recursive functions. * cse.c (cse_insn): * ifcvt.c (noce_can_store_speculate_p): Changed CONST_OR_PURE_CALL_P and pure_call_p to RTL_CONST_CALL_P or RTL_CONST_OR_PURE_CALL_P. * dse.c (scan_insn): Ditto. * local-alloc.c (validate_equiv_mem, memref_used_between_p): Ditto. * gcse.c (oprs_not_seen_p) Changed CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. (store_killed_in_insn): Changed CONST_OR_PURE_CALL_P and pure_call_p to RTL_CONST_CALL_P. * gimplify.c (gimplify_call_expr): Clear side effects for non-looping pure and constant calls. * calls.c (emit_call_1): Set rtl flags from ecf flags. (flags_from_decl_or_type): Set ecf flags from decl flags. (initialize_argument_information): Turn off ECF_LOOPING_CONST_OR_PURE when turning off ECF_CONST. Change const to pure if callee_copies is true rather than just turning off const. (expand_call): Turn off ECF_LOOPING_PURE_CONST_CALL and remove old way of marking pure calls. (emit_library_call_value_1): Turn off ECF_LOOPING_PURE_CONST_CALL. Remove hack that was supposed to fix pr7335 and remove old way of marking pure calls. * emit-rtl.c (emit_copy_of_insn_after): Copy RTL_CONST_CALL_P, RTL_PURE_CALL_P, RTL_LOOPING_CONST_OR_PURE_CALL_P. * cselib.c (cselib_process_insn): Changed CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. * tree-ssa-pre.c (can_value_number_call): Fixed spacing. * loop-invariant.c (find_exits, find_invariant_bb): Changed CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. * sched-deps.c (schedule_analyze): Ditto. * rtl.h (struct rtx_def): Use call field, unchanging field, and return_val field of calls to represent pure and const function info. (CONST_OR_PURE_CALL_P): Deleted macro. (RTL_CONST_CALL_P, RTL_PURE_CALL_P, RTL_LOOPING_CONST_OR_PURE_CALL_P, RTL_CONST_OR_PURE_P): New macros. * tree-inline.c (copy_body_r): Changed TREE_READONLY_DECL_P to TREE_READONLY. * tree-optimize.c (execute_fixup_cfg): Added test for ECF_LOOPING_CONST_OR_PURE. * c-common.c (handle_pure_attribute): Changed DECL_IS_PURE to DECL_PURE_P. * tree-cfg.c (update_call_expr_flags): Do not clear tree side effects for looping pure or const calls. (verify_gimple_expr): Added verification code. * config/alpha/alpha.c (alpha_legitimize_address, alpha_emit_xfloating_libcall): Changed CONST_OR_PURE_CALL_P to RTL_CONST_CALL_P. * config/s390/s390.c (s390_emit_tls_call_insn): Ditto. * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Ditto. * config/mips/mips.c (mips_call_tls_get_addr): Ditto. * cfgrtl.c (need_fake_edge_p): Changed CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. * dce.c (deletable_insn_p): Allow non looping, non sibling, pure and const calls to be deleted. java: 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com> * decl.c (java_init_decl_processing): Change DECL_IS_PURE to DECL_PURE_P. cp: 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com> * decl.c (duplicate_decls): Merge in DECL_PURE_P, TREE_READONLY, DECL_LOOPING_CONST_OR_PURE_P attributes. * rtti.c (build_dynamic_cast_1): Rename DECL_IS_PURE to DECL_PURE_P. gfortran: 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com> * trans-decl.c (gfc_get_extern_function_decl, build_function_decl): Rename DECL_IS_PURE to DECL_PURE_P. From-SVN: r135053
2008-05-07 22:48:07 +02:00
2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com>
* trans-decl.c (gfc_get_extern_function_decl, build_function_decl):
Rename DECL_IS_PURE to DECL_PURE_P.
arith.c: (gfc_arith_concat... * arith.c: (gfc_arith_concat, gfc_compare_string, gfc_compare_with_Cstring, hollerith2representation, gfc_hollerith2int, gfc_hollerith2real, gfc_hollerith2complex, gfc_hollerith2character, gfc_hollerith2logical): Use wide characters for character constants. * data.c (create_character_intializer): Likewise. * decl.c (gfc_set_constant_character_len): Likewise. * dump-parse-tree.c (show_char_const): Correctly dump wide character strings. error.c (print_wide_char): Rename into gfc_print_wide_char. (show_locus): Adapt to new prototype of gfc_print_wide_char. expr.c (free_expr0): Representation is now disjunct from character string value, so we always free it. (gfc_copy_expr, find_substring_ref, gfc_simplify_expr): Adapt to wide character strings. * gfortran.h (gfc_expr): Make value.character.string a wide string. (gfc_wide_toupper, gfc_wide_strncasecmp, gfc_wide_memset, gfc_widechar_to_char, gfc_char_to_widechar): New prototypes. (gfc_get_wide_string): New macro. (gfc_print_wide_char): New prototype. * io.c (format_string): Make a wide string. (next_char, gfc_match_format, compare_to_allowed_values, gfc_match_open): Deal with wide strings. * module.c (mio_expr): Convert between wide strings and ASCII ones. * primary.c (match_hollerith_constant, match_charkind_name): Handle wide strings. * resolve.c (build_default_init_expr): Likewise. * scanner.c (gfc_wide_toupper, gfc_wide_memset, gfc_char_to_widechar): New functions. (wide_strchr, gfc_widechar_to_char, gfc_wide_strncasecmp): Changes in prototypes. (gfc_define_undef_line, load_line, preprocessor_line, include_line, load_file, gfc_read_orig_filename): Handle wide strings. * simplify.c (gfc_simplify_achar, gfc_simplify_adjustl, gfc_simplify_adjustr, gfc_simplify_char, gfc_simplify_iachar, gfc_simplify_ichar, simplify_min_max, gfc_simplify_new_line, gfc_simplify_repeat): Handle wide strings. (wide_strspn, wide_strcspn): New helper functions. (gfc_simplify_scan, gfc_simplify_trim, gfc_simplify_verify): Handle wide strings. * symbol.c (generate_isocbinding_symbol): Likewise. * target-memory.c (size_character, gfc_target_expr_size, encode_character, gfc_target_encode_expr, gfc_interpret_character, gfc_target_interpret_expr): Handle wide strings. * trans-const.c (gfc_conv_string_init): Lower wide strings to narrow ones. (gfc_conv_constant_to_tree): Likewise. * trans-expr.c (gfc_conv_substring_expr): Handle wide strings. * trans-io.c (gfc_new_nml_name_expr): Likewise. * trans-stmt.c (gfc_trans_label_assign): Likewise. From-SVN: r135006
2008-05-06 23:06:20 +02:00
2008-05-06 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* arith.c: (gfc_arith_concat, gfc_compare_string,
gfc_compare_with_Cstring, hollerith2representation,
gfc_hollerith2int, gfc_hollerith2real, gfc_hollerith2complex,
gfc_hollerith2character, gfc_hollerith2logical): Use wide
characters for character constants.
* data.c (create_character_intializer): Likewise.
* decl.c (gfc_set_constant_character_len): Likewise.
* dump-parse-tree.c (show_char_const): Correctly dump wide
character strings.
error.c (print_wide_char): Rename into gfc_print_wide_char.
(show_locus): Adapt to new prototype of gfc_print_wide_char.
expr.c (free_expr0): Representation is now disjunct from
character string value, so we always free it.
(gfc_copy_expr, find_substring_ref, gfc_simplify_expr): Adapt
to wide character strings.
* gfortran.h (gfc_expr): Make value.character.string a wide string.
(gfc_wide_toupper, gfc_wide_strncasecmp, gfc_wide_memset,
gfc_widechar_to_char, gfc_char_to_widechar): New prototypes.
(gfc_get_wide_string): New macro.
(gfc_print_wide_char): New prototype.
* io.c (format_string): Make a wide string.
(next_char, gfc_match_format, compare_to_allowed_values,
gfc_match_open): Deal with wide strings.
* module.c (mio_expr): Convert between wide strings and ASCII ones.
* primary.c (match_hollerith_constant, match_charkind_name):
Handle wide strings.
* resolve.c (build_default_init_expr): Likewise.
* scanner.c (gfc_wide_toupper, gfc_wide_memset,
gfc_char_to_widechar): New functions.
(wide_strchr, gfc_widechar_to_char, gfc_wide_strncasecmp):
Changes in prototypes.
(gfc_define_undef_line, load_line, preprocessor_line,
include_line, load_file, gfc_read_orig_filename): Handle wide
strings.
* simplify.c (gfc_simplify_achar, gfc_simplify_adjustl,
gfc_simplify_adjustr, gfc_simplify_char, gfc_simplify_iachar,
gfc_simplify_ichar, simplify_min_max, gfc_simplify_new_line,
gfc_simplify_repeat): Handle wide strings.
(wide_strspn, wide_strcspn): New helper functions.
(gfc_simplify_scan, gfc_simplify_trim, gfc_simplify_verify):
Handle wide strings.
* symbol.c (generate_isocbinding_symbol): Likewise.
* target-memory.c (size_character, gfc_target_expr_size,
encode_character, gfc_target_encode_expr, gfc_interpret_character,
gfc_target_interpret_expr): Handle wide strings.
* trans-const.c (gfc_conv_string_init): Lower wide strings to
narrow ones.
(gfc_conv_constant_to_tree): Likewise.
* trans-expr.c (gfc_conv_substring_expr): Handle wide strings.
* trans-io.c (gfc_new_nml_name_expr): Likewise.
* trans-stmt.c (gfc_trans_label_assign): Likewise.
2008-05-06 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* simplify.c (gfc_simplify_bessel_j0,gfc_simplify_bessel_j1,
gfc_simplify_bessel_jn,gfc_simplify_bessel_y0,
gfc_simplify_bessel_y1,gfc_simplify_bessel_yn): Mark arguments
with ATTRIBUTE_UNUSED.
2008-05-06 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* check.c (gfc_check_sizeof): Switch to ATTRIBUTE_UNUSED.
* simplify.c (gfc_simplify_lgamma): Likewise.
2008-05-06 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
openmp.c (gfc_match_omp_eos): Use gfc_next_ascii_char and gfc_peek_ascii_char. * openmp.c (gfc_match_omp_eos): Use gfc_next_ascii_char and gfc_peek_ascii_char. * decl.c (gfc_match_kind_spec, gfc_match_type_spec, gfc_match_implicit_none, match_implicit_range, gfc_match_implicit, match_string_p, match_attr_spec, gfc_match_suffix, match_procedure_decl, gfc_match_entry, gfc_match_subroutine): Likewise. * gfortran.h (gfc_char_t): New type. (gfc_linebuf): Make line member a gfc_char_t. (locus): Make nextc member a gfc_char_t. (gfc_wide_is_printable, gfc_wide_is_digit, gfc_wide_fits_in_byte, gfc_wide_tolower, gfc_wide_strlen, gfc_next_ascii_char, gfc_peek_ascii_char, gfc_check_digit): New prototypes. * error.c (print_wide_char): New function. (show_locus): Use print_wide_char and gfc_wide_strlen. * io.c (next_char): Use gfc_char_t type. (match_io): Use gfc_peek_ascii_char and gfc_next_ascii_char. * match.c (gfc_match_parens, gfc_match_eos, gfc_match_small_literal_int, gfc_match_name, gfc_match_name_C, gfc_match_intrinsic_op, gfc_match_char, gfc_match_return, gfc_match_common): Likewise. * match.h (gfc_match_special_char): Change prototype. * parse.c (decode_specification_statement, decode_statement, decode_omp_directive, next_free, next_fixed): Use gfc_peek_ascii_char and gfc_next_ascii_char. * primary.c (gfc_check_digit): Change name. (match_digits, match_hollerith_constant, match_boz_constant, match_real_constant, next_string_char, match_charkind_name, match_string_constant, match_logical_constant_string, match_complex_constant, match_actual_arg, match_varspec, gfc_match_rvalue, match_variable): Use gfc_peek_ascii_char and gfc_next_ascii_char. * scanner.c (gfc_wide_fits_in_byte, wide_is_ascii, gfc_wide_is_printable, gfc_wide_tolower, gfc_wide_is_digit, gfc_wide_is_digit, wide_atoi, gfc_wide_strlen, wide_strcpy, wide_strchr, widechar_to_char, wide_strncmp, wide_strncasecmp, gfc_next_ascii_char, gfc_peek_ascii_char): New functions. (next_char, gfc_define_undef_line, skip_free_comments, gfc_next_char_literal, gfc_next_char, gfc_peek_char, gfc_error_recovery, load_line, preprocessor_line, include_line, load_file, gfc_read_orig_filename): Use gfc_char_t for source characters and the {gfc_,}wide_* functions to manipulate wide strings. From-SVN: r134992
2008-05-06 20:28:32 +02:00
* openmp.c (gfc_match_omp_eos): Use gfc_next_ascii_char and
gfc_peek_ascii_char.
* decl.c (gfc_match_kind_spec, gfc_match_type_spec,
gfc_match_implicit_none, match_implicit_range, gfc_match_implicit,
match_string_p, match_attr_spec, gfc_match_suffix,
match_procedure_decl, gfc_match_entry, gfc_match_subroutine):
Likewise.
* gfortran.h (gfc_char_t): New type.
(gfc_linebuf): Make line member a gfc_char_t.
(locus): Make nextc member a gfc_char_t.
(gfc_wide_is_printable, gfc_wide_is_digit, gfc_wide_fits_in_byte,
gfc_wide_tolower, gfc_wide_strlen, gfc_next_ascii_char,
gfc_peek_ascii_char, gfc_check_digit): New prototypes.
* error.c (print_wide_char): New function.
(show_locus): Use print_wide_char and gfc_wide_strlen.
* io.c (next_char): Use gfc_char_t type.
(match_io): Use gfc_peek_ascii_char and gfc_next_ascii_char.
* match.c (gfc_match_parens, gfc_match_eos,
gfc_match_small_literal_int, gfc_match_name, gfc_match_name_C,
gfc_match_intrinsic_op, gfc_match_char, gfc_match_return,
gfc_match_common): Likewise.
* match.h (gfc_match_special_char): Change prototype.
* parse.c (decode_specification_statement, decode_statement,
decode_omp_directive, next_free, next_fixed): Use
gfc_peek_ascii_char and gfc_next_ascii_char.
* primary.c (gfc_check_digit): Change name.
(match_digits, match_hollerith_constant, match_boz_constant,
match_real_constant, next_string_char, match_charkind_name,
match_string_constant, match_logical_constant_string,
match_complex_constant, match_actual_arg, match_varspec,
gfc_match_rvalue, match_variable): Use gfc_peek_ascii_char and
gfc_next_ascii_char.
* scanner.c (gfc_wide_fits_in_byte, wide_is_ascii,
gfc_wide_is_printable, gfc_wide_tolower, gfc_wide_is_digit,
gfc_wide_is_digit, wide_atoi, gfc_wide_strlen, wide_strcpy,
wide_strchr, widechar_to_char, wide_strncmp, wide_strncasecmp,
gfc_next_ascii_char, gfc_peek_ascii_char):
New functions.
(next_char, gfc_define_undef_line, skip_free_comments,
gfc_next_char_literal, gfc_next_char, gfc_peek_char,
gfc_error_recovery, load_line, preprocessor_line, include_line,
load_file, gfc_read_orig_filename): Use gfc_char_t for source
characters and the {gfc_,}wide_* functions to manipulate wide
strings.
2008-05-06 Tobias Burnus <burnus@net-b.de>
PR fortran/36117
* intrinsic.c (add_functions): Call gfc_simplify_bessel_*.
* intrinsic.h: Add prototypes for gfc_simplify_bessel_*.
* simplify.c (gfc_simplify_bessel_j0,gfc_simplify_bessel_j1,
gfc_simplify_bessel_jn,gfc_simplify_bessel_y0,
gfc_simplify_bessel_y1,gfc_simplify_bessel_yn): New.
2008-05-03 Janus Weil <jaydub66@gmail.com>
* misc.c (gfc_clear_ts): Set interface to NULL.
2008-05-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33268
* gfortran.h: Add extra_comma pointer to gfc_dt structure. Add iokind to
gfc_expr value union. Add io_kind enum to here from io.c.
* io.c (gfc_free_dt): Free extra_comma.
(gfc_resolve_dt): If an extra comma was encountered and io_unit is type
BT_CHARACTER, resolve to format_expr and set default unit. Error if
io_kind is M_WRITE. (match_io): Match the extra comma and set new
pointer, extra_comma.
2008-05-01 Bud Davis <bdavis9659@sbcglobal.net>
PR35940/Fortran
* simplify.c (gfc_simplify_index): Check for direction argument
being a constant.
2008-05-01 Janus Weil <jaydub66@gmail.com>
* gfortran.h (struct gfc_symbol): Moving "interface" member to
gfc_typespec (plus fixing a small docu error).
* interface.c (gfc_procedure_use): Ditto.
* decl.c (match_procedure_decl): Ditto.
* resolve.c (resolve_specific_f0,
resolve_specific_f0, resolve_symbol): Ditto.
2008-04-30 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* intrinsic.c (add_functions): Add SELECTED_CHAR_KIND intrinsic.
* intrinsic.h (gfc_check_selected_char_kind,
gfc_simplify_selected_char_kind): New prototypes.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_SC_KIND.
* trans.h (gfor_fndecl_sc_kind): New function decl.
* trans-decl.c (gfor_fndecl_sc_kind): Build new decl.
* arith.c (gfc_compare_with_Cstring): New function.
* arith.h (gfc_compare_with_Cstring): New prototype.
* check.c (gfc_check_selected_char_kind): New function.
* primary.c (match_string_constant, match_kind_param): Mark
symbols used as literal constant kind param as referenced.
* trans-intrinsic.c (gfc_conv_intrinsic_sc_kind): New function.
(gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_sc_kind.
* intrinsic.texi (SELECTED_CHAR_KIND): Document new intrinsic.
* simplify.c (gfc_simplify_selected_char_kind): New function.
2008-04-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/35997
* module.c (find_symbol): Do not return a result for a symbol
that has been renamed in another module.
2008-04-26 George Helffrich <george@gcc.gnu.org>
PR fortran/35892
PR fortran/35154
* trans-common.c (create_common): Add decl to function
chain (if inside one) to preserve identifier scope in debug output.
re PR testsuite/35843 (-fdump-rtl-expand does not exist anymore) PR testsuite/35843 * cfgexpand.c (pass_expand): Turn into RTL pass. * passes.c (execute_one_pass): Do pass typechecking after execution. * tree-pass.h (pass_expand): Turn into RTL pass. * function.h (struct rtl_data): Move here fields accesses_prior_frames, calls_eh_return, saves_all_registers, has_nonlocal_goto, has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda, tail_call_emit, arg_pointer_save_area_init from struct function; turn into bool. (struct function): Move calls_eh_return, saves_all_registers, has_nonlocal_goto, has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda, tail_call_emit, arg_pointer_save_area_init into struct rtl_data. Remove recursive_call_emit and gimplified flags. (current_function_returns_struct, current_function_returns_pcc_struct, current_function_calls_setjmp, current_function_calls_alloca, current_function_accesses_prior_frames, current_function_calls_eh_return, current_function_is_thunk, current_function_stdarg, current_function_profile, current_function_limit_stack, current_function_uses_pic_offset_table, current_function_uses_const_pool, current_function_has_nonlocal_label, current_function_saves_all_registers, current_function_has_nonlocal_goto, current_function_has_asm_statement): Remove accesor macros. * ra-conflict.c (global_conflicts): Update. * tree-tailcall.c (suitable_for_tail_opt_p): Update. (suitable_for_tail_call_opt_p): Update. * builtins.c (expand_builtin_return_addr): Update. (expand_builtin_setjmp_setup): Update. (expand_builtin_nonlocal_goto): Update. * final.c (final_start_function): Update. (profile_function): Update. (leaf_function_p): Update. (only_leaf_regs_used): Update. * df-scan.c (df_get_exit_block_use_set): Update. * dojump.c (clear_pending_stack_adjust): Update. * tree-stdarg.c (gate_optimize_stdarg): Update. * gimple-low.c (lower_function_body): Update. * global.c (compute_regsets): Update. (global_alloc): Update. * dwarf2out.c (dwarf2out_begin_prologue): Update. * expr.c (expand_assignment): Update. * dse.c (dse_step0): Update. (dse_step1): Update. * c-decl.c (store_parm_decls): Update. * local-alloc.c (combine_regs): Update. (find_free_reg): Update. * function.c (assign_parms_augmented_arg_list): Update. (assign_parm_find_data_types): Update. (assign_parms): Update. (allocate_struct_function): Update. (expand_function_start): Update. (expand_function_end): Update. (get_arg_pointer_save_area): Update. (thread_prologue_and_epilogue_insns): Update. (rest_of_match_asm_constraints): Update. * stor-layout.c (variable_size): Update. * gcse.c (gcse_main): Update. (bypass_jumps): Update. * gimplify.c (gimplify_function_tree): Update. * calls.c (emit_call_1): Update. (expand_call): Update. * bt-load.c (compute_defs_uses_and_gen): Update. * except.c (sjlj_assign_call_site_values): Update. (sjlj_emit_function_enter): Update. (can_throw_external): Update. (set_nothrow_function_flags): Update. (expand_builtin_unwind_init): Update. (expand_eh_return): Update. (convert_to_eh_region_ranges): Update. (output_function_exception_table): Update. * emit-rtl.c (gen_tmp_stack_mem): Update. * cfgexpand.c (expand_used_vars): Update. (tree_expand_cfg): Update. * cfgcleanup.c (rest_of_handle_jump): Update. * explow.c (allocate_dynamic_stack_space): Update. * varasm.c (assemble_start_function): Update. (force_const_mem): Update. (mark_constant_pool): Update. * tree-optimize.c (tree_rest_of_compilation): Update. * stack-ptr-mod.c (notice_stack_pointer_modification): Update. * tree-cfg.c (notice_special_calls): Update. (is_ctrl_altering_stmt): Update. (tree_can_make_abnormal_goto): Update. (tree_purge_dead_abnormal_call_edges): Update. * config/alpha/predicates.md: Update. * config/alpha/alpha.c (alpha_sa_mask): Update. (alpha_sa_size): Update. (alpha_does_function_need_gp): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_output_function_end_prologue): Update. (alpha_expand_epilogue): Update. * config/frv/frv.c (frv_stack_info): Update. (frv_expand_epilogue): Update. * config/s390/s390.c (s390_regs_ever_clobbered): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_init_frame_layout): Update. (s390_can_eliminate): Update. (save_gprs): Update. * config/spu/spu.c (spu_split_immediate): Update. (need_to_save_reg): Update. (spu_expand_prologue): Update. (spu_expand_epilogue): Update. * config/sparc/sparc.md: Update. * config/sparc/sparc.c (eligible_for_return_delay): Update. (sparc_tls_got): Update. (legitimize_pic_address): Update. (sparc_emit_call_insn): Update. (sparc_expand_prologue): Update. (output_return): Update. (print_operand): Update. (sparc_function_ok_for_sibcall): Update. * config/sparc/sparc.h (EXIT_IGNORE_STACK): Update. * config/m32r/m32r.md: Update. * config/m32r/m32r.c (MUST_SAVE_RETURN_ADDR): Update. (m32r_compute_frame_size): Update. (m32r_expand_prologue): Update. (m32r_expand_epilogue): Update. (m32r_legitimize_pic_address): Update. * config/m32r/m32r.h (FRAME_POINTER_REQUIRED): Update. * config/i386/linux.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update. * config/i386/i386.c (ix86_frame_pointer_required): Update. (gen_push): Update. (ix86_save_reg): Update. (ix86_compute_frame_layout): Update. (ix86_expand_prologue): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh5_schedule_saves): Update. (sh_expand_prologue): Update. (sh_expand_epilogue): Update. (sh_setup_incoming_varargs): Update. (sh_allocate_initial_value): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): Update. * config/sh/sh.md (label:): Update. * config/avr/avr.c (out_movhi_mr_r): Update. * config/crx/crx.h (enum): Update. * config/xtensa/xtensa.h (along): Update. * config/stormy16/stormy16.c Update. (xstormy16_compute_stack_layout): Update. * config/fr30/fr30.c (MUST_SAVE_RETURN_POINTER): Update. (fr30_expand_prologue): Update. * config/cris/cris.c (cris_conditional_register_usage): Update. (cris_reg_saved_in_regsave_area): Update. (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. (cris_expand_pic_call_address): Update. (cris_asm_output_symbol_ref): Update. (cris_asm_output_label_ref): Update. * config/cris/cris.md Update. * config/iq2000/iq2000.c (compute_frame_size): Update. (iq2000_expand_epilogue): Update. * config/mt/mt.h (save_direction): Update. * config/mn10300/mn10300.c (mn10300_function_value): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_secondary_reload_class): Update. * config/m68k/m68k.c (m68k_save_reg): Update. (m68k_expand_prologue): Update. (m68k_expand_epilogue): Update. (legitimize_pic_address): Update. * config/rs6000/rs6000.c (rs6000_got_register): Update. (first_reg_to_save): Update. (first_altivec_reg_to_save): Update. (compute_vrsave_mask): Update. (compute_save_world_info): Update. (rs6000_stack_info): Update. (spe_func_has_64bit_regs_p): Update. (rs6000_ra_ever_killed): Update. (rs6000_emit_eh_reg_restore): Update. (rs6000_emit_allocate_stack): Update. (rs6000_emit_prologue): Update. (rs6000_emit_epilogue): Update. (rs6000_output_function_epilogue): Update. (output_profile_hook): Update. (rs6000_elf_declare_function_name): Update. * config/rs6000/rs6000.h (rs6000_args): Update. * config/rs6000/rs6000.md: Update. * config/mcore/mcore.c (mcore_expand_prolog): Update. * config/arc/arc.c (arc_output_function_epilogue): Update. * config/arc/arc.h (FRAME_POINTER_REQUIRED): Update. * config/darwin.c (machopic_function_base_name): Update. * config/score/score3.c (score3_compute_frame_size): Update. (rpush): Update. (rpop): Update. (score3_epilogue): Update. * config/score/score7.c (score7_compute_frame_size): Update. (score7_prologue): Update. (score7_epilogue): Update. * config/score/score.h (FRAME_POINTER_REQUIRED): Update. * config/arm/linux-elf.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update. * config/arm/arm.c (use_return_insn): Update. (require_pic_register): Update. (arm_load_pic_register): Update. (arm_compute_save_reg0_reg12_mask): Update. (arm_compute_save_reg_mask): Update. (thumb1_compute_save_reg_mask): Update. (output_return_instruction): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_pushpop): Update. (thumb_exit): Update. (thumb1_expand_prologue): Update. (thumb1_expand_epilogue): Update. (arm_unwind_emit): Update. (arm_output_fn_unwind): Update. * config/arm/arm.h (FRAME_POINTER_REQUIRED): Update. * config/arm/arm.md: Update. * config/pa/pa.md: Update. * config/pa/pa.c (legitimize_pic_address): Update. (compute_frame_size): Update. (hppa_expand_prologue): Update. (hppa_expand_epilogue): Update. (borx_reg_operand): Update. * config/pa/pa.h (FRAME_POINTER_REQUIRED): Update. (HARD_REGNO_RENAME_OK): Update. * config/mips/mips.c (mips_global_pointer): Update. (mips_save_reg_p): Update. (mips_compute_frame_info): Update. (mips_frame_pointer_required): Update. (mips_expand_prologue): Update. (mips_expand_epilogue): Update. (mips_can_use_return_insn): Update. (mips_reorg_process_insns): Update. * config/v850/v850.c (compute_register_save_size): Update. * config/mmix/mmix.h (FRAME_POINTER_REQUIRED): Update. * config/mmix/mmix.c (along): Update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (legitimize_pic_address): Update. (must_save_p): Update. (stack_frame_needed_p): Update. (add_to_reg): Update. (bfin_expand_prologue): Update. * stmt.c (expand_asm_operands): Update. * reload1.c (reload): Update. (init_elim_table): Update. From-SVN: r134682
2008-04-26 01:14:40 +02:00
2008-04-25 Jan Hubicka <jh@suse.cz>
* trans-decl.c (trans_function_start): Update.
2008-04-25 Tobias Burnus <burnus@net-b.de>
Daniel Franke <franke.daniel@gmail.com>
PR fortran/35156
* gfortranspec.c (lang_specific_driver): Deprecate
-M option; fix ICE when "-M" is last argument and
make "-M<dir>" work.
* options.c (gfc_handle_module_path_options):
Use -J instead of -M in error messages.
* invoke.texi: Mark -M as depecated.
2008-04-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/35994
* trans-instrinsic.c (gfc_conv_intrinsic_minmaxloc): Correctly adjust
loop counter offset.
tree-cfg.c (verify_expr): Check with is_gimple_address. 2008-04-23 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (verify_expr): Check with is_gimple_address. Don't check TREE_INVARIANT. * tree-gimple.c (is_gimple_address): New. (is_gimple_invariant_address): Simplify using decl_address_invariant_p. * tree-gimple.h (is_gimple_address): New. * tree.h (decl_address_invariant_p): New. * tree.c (make_node_stat): Don't set TREE_INVARIANT. (build_string): Likewise. (decl_address_invariant_p): New, from is_gimple_invariant_address. (tree_invariant_p_1): Likewise. (save_expr): Use it. (tree_invariant_p): New. (skip_simple_arithmetic): Use it. (stabilize_reference_1): Use it. (recompute_tree_invariant_for_addr_expr): Don't update TREE_INVARIANT, simplify. (build1_stat): Drop code to compute TREE_INVARIANT. (build2_stat): Drop code to compute TREE_INVARIANT. (build3_stat): Drop code to compute TREE_INVARIANT. (build4_stat): Drop code to compute TREE_INVARIANT. (build5_stat): Drop code to compute TREE_INVARIANT. (build7_stat): Drop code to compute TREE_INVARIANT. (merge_dllimport_decl_attributes): Don't mention TREE_INVARIANT. * tree.h (struct tree_base): Remove invariant_flag. (TREE_INVARIANT): Remove. * builtins.c (build_string_literal): Don't set TREE_INVARIANT. (fold_builtin_expect): Check TREE_CONSTANT. * tree-ssa-ccp.c (fold_stmt_r): Adjust comment. * c-tree.h (c_expr_to_decl): Drop third parameter. * c-typeck.c (build_external_ref): Don't set TREE_INVARIANT. (build_c_cast): Don't set TREE_INVARIANT. (pop_init_level): Don't set TREE_INVARIANT. (c_objc_common_truthvalue_conversion): Don't set TREE_INVARIANT. * gimplify.c (gimplify_init_ctor_preeval): Add assertion, test TREE_CONSTANT. (gimplify_init_constructor): Don't set TREE_INVARIANT. (gimplify_addr_expr): Adjust comment. * tree-mudflap.c (mf_build_string): * print-tree.c (print_node): Don't print TREE_INVARIANT. * tree-nested.c (convert_nonlocal_reference): Adjust comment. * c-common.c (fix_string_type): Don't set TREE_INVARIANT. * langhooks-def.h (lhd_expr_to_decl): Drop third parameter. * langhooks.c (lhd_expr_to_decl): Drop third parameter. * langhooks.h (struct lang_hooks): Drop third parameter from expr_to_decl. java: 2008-04-23 Paolo Bonzini <bonzini@gnu.org> * class.c (build_utf8_ref): Don't set TREE_INVARIANT. (build_classdollar_field): Don't set TREE_INVARIANT. (get_dispatch_table): Don't set TREE_INVARIANT. (make_class_data): Don't set TREE_INVARIANT. (build_symbol_entry): Don't set TREE_INVARIANT. (emit_symbol_table): Don't set TREE_INVARIANT. * constants.c (build_constant_data_ref): Don't set TREE_INVARIANT. (build_ref_from_constant_pool): Don't set TREE_INVARIANT. * resource.c (compile_resource_data): Don't set TREE_INVARIANT. * expr.c (cache_cpool_data_ref): Don't set TREE_INVARIANT. objc: 2008-04-23 Paolo Bonzini <bonzini@gnu.org> * objc-act.c (objc_build_string_object): Don't set TREE_INVARIANT. cp: 2008-04-23 Paolo Bonzini <bonzini@gnu.org> * typeck.c (get_member_function_from_ptrfunc): Don't set TREE_INVARIANT. (build_ptrmemfunc1): Don't set TREE_INVARIANT. * init.c (build_zero_init): Don't set TREE_INVARIANT. * class.c (build_base_path): Don't set TREE_INVARIANT. (build_vtbl_ref_1): Don't set TREE_INVARIANT. (build_vtbl_initializer): Don't set TREE_INVARIANT. * decl.c (build_enumerator): Don't set TREE_INVARIANT. * rtti.c (tinfo_base_init): Don't set TREE_INVARIANT. (generic_initializer): Don't set TREE_INVARIANT. (ptr_initializer): Don't set TREE_INVARIANT. (ptm_initializer): Don't set TREE_INVARIANT. (class_initializer): Don't set TREE_INVARIANT. * typeck2.c (process_init_constructor): Don't set TREE_INVARIANT. * pt.c (push_inline_template_parms_recursive): Don't set TREE_INVARIANT. (build_template_parm_index): Don't set TREE_INVARIANT. (reduce_template_parm_level): Don't set TREE_INVARIANT. (process_template_parm): Don't set TREE_INVARIANT. ada: 2008-04-23 Paolo Bonzini <bonzini@gnu.org> * trans.c (Attribute_to_gnu): Don't set TREE_INVARIANT. (call_to_gnu): Don't set TREE_INVARIANT. * utils2.c (gnat_build_constructor): Don't set TREE_INVARIANT. fortran: 2008-04-23 Paolo Bonzini <bonzini@gnu.org> * trans-expr.c (gfc_conv_structure): Don't set TREE_INVARIANT. * trans-array.c (gfc_build_null_descriptor): Don't set TREE_INVARIANT. (gfc_trans_array_constructor_value): Don't set TREE_INVARIANT. (gfc_build_constant_array_constructor): Don't set TREE_INVARIANT. (gfc_conv_array_initializer): Don't set TREE_INVARIANT. * trans-common.c (get_init_field): Don't set TREE_INVARIANT. (create_common): Don't set TREE_INVARIANT. * trans-stmt.c (gfc_trans_character_select): Don't set TREE_INVARIANT. * trans-decl.c (gfc_generate_function_code): Don't set TREE_INVARIANT. From-SVN: r134599
2008-04-23 17:00:52 +02:00
2008-04-23 Paolo Bonzini <bonzini@gnu.org>
* trans-expr.c (gfc_conv_structure): Don't set TREE_INVARIANT.
* trans-array.c (gfc_build_null_descriptor): Don't set TREE_INVARIANT.
(gfc_trans_array_constructor_value): Don't set TREE_INVARIANT.
(gfc_build_constant_array_constructor): Don't set TREE_INVARIANT.
(gfc_conv_array_initializer): Don't set TREE_INVARIANT.
* trans-common.c (get_init_field): Don't set TREE_INVARIANT.
(create_common): Don't set TREE_INVARIANT.
* trans-stmt.c (gfc_trans_character_select): Don't set TREE_INVARIANT.
* trans-decl.c (gfc_generate_function_code): Don't set TREE_INVARIANT.
2008-04-21 Steve Ellcey <sje@cup.hp.com>
* f95-lang.c (gfc_init_decl_processing): use ptr_mode instead of Pmode.
2008-04-21 Daniel Franke <franke.daniel@gmail.com>
PR fortran/35019
* gfortranspec.c (lookup_option): Properly handle separated arguments
in -J option, print missing argument message when necessary.
2008-04-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/35882
* scanner.c (skip_fixed_comments): Update continue_line when comment is
detected. (gfc_next_char_literal): Likewise.
2008-04-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/35944
PR fortran/35946
PR fortran/35947
* trans_array.c (gfc_trans_array_constructor): Temporarily
realign loop, if loop->from is not zero, before creating
the temporary array and provide an offset.
PR fortran/35959
* trans-decl.c (gfc_init_default_dt): Add gfc_ prefix to name
and allow for NULL body. Change all references from
init_default_dt to gfc_init_default_dt.
* trans.h : Add prototype for gfc_init_default_dt.
* trans-array.c (gfc_trans_deferred_vars): After nullification
call gfc_init_default_dt for derived types with allocatable
components.
2008-04-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/35892
* trans-common.c (create_common): Revert patch causing regression.
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.
2008-04-16 Paul Thomas <pault@gcc.gnu.org>
PR fortran/35932
* trans-intrinsic.c (gfc_conv_intrinsic_char): Even though KIND
is not used, the argument must be converted.
2008-04-16 Jakub Jelinek <jakub@redhat.com>
PR target/35662
* f95-lang.c (gfc_init_builtin_functions): Make sure
BUILT_IN_SINCOS{,F,L} types aren't varargs.
2008-04-15 Paul Thomas <pault@gcc.gnu.org>
PR fortran/35864
* expr.c (scalarize_intrinsic_call): Reorder identification of
array argument so that if one is not found a segfault does not
occur. Return FAILURE if all scalar arguments.
2008-04-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
PR fortran/35882
* options.c (gfc_init_options): Set the default maximum continuation
lines to 255 for both free and fixed form source for warnings.
(gfc_handle_option): Set -std=f95 fixed form max continuations to 19 and
the -std=f95 free form max continuations to 39 for warnings.
* scanner.c (gfc_next_char_literal): Adjust the current_line number only
if it is less than the current locus.
2008-04-07 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/25829 28655
* io.c (io_tag): Add new tags for decimal, encoding, asynchronous,
round, sign, and id. (match_open_element): Match new tags.
(gfc_resolve_open): Resolve new tags. (gfc_match_open): Enable encoding
for DEFAULT only. Update error messages. (match_dt_element): Fix match
tag for asynchronous. Update error messages. (gfc_free_inquire): Free
new expressions. (match_inquire_element): Match new tags.
(gfc_match_inquire): Add constraint for ID and PENDING.
(gfc_resolve_inquire): Resolve new tags.
* trans-io.c (gfc_trans_inquire): Clean up whitespace and fix setting of
mask for ID parameter.
* ioparm.def: Fix order of parameters for pending, round, and sign.
NOTE: These must line up with the definitions in libgfortran/io/io.h. or
things don't work.
Index... Index: gcc/fortran/trans-stmt.c =================================================================== *** gcc/fortran/trans-stmt.c (revision 133728) --- gcc/fortran/trans-stmt.c (working copy) *************** gfc_trans_where_2 (gfc_code * code, tree *** 3540,3547 **** /* Translate a simple WHERE construct or statement without dependencies. CBLOCK is the "then" clause of the WHERE statement, where CBLOCK->EXPR ! is the mask condition, and EBLOCK if non-NULL is the "else" clause. ! Currently both CBLOCK and EBLOCK are restricted to single assignments. */ static tree gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock) --- 3540,3550 ---- /* Translate a simple WHERE construct or statement without dependencies. CBLOCK is the "then" clause of the WHERE statement, where CBLOCK->EXPR ! is the mask condition, and EBLOCK if non-NULL is the "then" clause of ! the ELSWHERE. As required by 7.5.3.2, the WHERE and ELSEWHERE are ! executed with separate loops. It should be noted that the mask expression ! is evaluated for both loops. Currently both CBLOCK and EBLOCK are ! restricted to single assignments. */ static tree gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock) *************** gfc_trans_where_3 (gfc_code * cblock, gf *** 3561,3566 **** --- 3564,3570 ---- edst = eblock ? eblock->next->expr : NULL; esrc = eblock ? eblock->next->expr2 : NULL; + /*---------------First do the WHERE part.----------------*/ gfc_start_block (&block); gfc_init_loopinfo (&loop); *************** gfc_trans_where_3 (gfc_code * cblock, gf *** 3584,3619 **** gfc_add_ss_to_loop (&loop, tdss); gfc_add_ss_to_loop (&loop, tsss); - if (eblock) - { - /* Handle the else clause. */ - gfc_init_se (&edse, NULL); - gfc_init_se (&esse, NULL); - edss = gfc_walk_expr (edst); - esss = gfc_walk_expr (esrc); - if (esss == gfc_ss_terminator) - { - esss = gfc_get_ss (); - esss->next = gfc_ss_terminator; - esss->type = GFC_SS_SCALAR; - esss->expr = esrc; - } - gfc_add_ss_to_loop (&loop, edss); - gfc_add_ss_to_loop (&loop, esss); - } - gfc_conv_ss_startstride (&loop); gfc_conv_loop_setup (&loop); gfc_mark_ss_chain_used (css, 1); gfc_mark_ss_chain_used (tdss, 1); gfc_mark_ss_chain_used (tsss, 1); ! if (eblock) ! { ! gfc_mark_ss_chain_used (edss, 1); ! gfc_mark_ss_chain_used (esss, 1); ! } ! gfc_start_scalarized_body (&loop, &body); gfc_copy_loopinfo_to_se (&cse, &loop); --- 3588,3600 ---- gfc_add_ss_to_loop (&loop, tdss); gfc_add_ss_to_loop (&loop, tsss); gfc_conv_ss_startstride (&loop); gfc_conv_loop_setup (&loop); gfc_mark_ss_chain_used (css, 1); gfc_mark_ss_chain_used (tdss, 1); gfc_mark_ss_chain_used (tsss, 1); ! gfc_start_scalarized_body (&loop, &body); gfc_copy_loopinfo_to_se (&cse, &loop); *************** gfc_trans_where_3 (gfc_code * cblock, gf *** 3622,3637 **** cse.ss = css; tdse.ss = tdss; tsse.ss = tsss; - if (eblock) - { - gfc_copy_loopinfo_to_se (&edse, &loop); - gfc_copy_loopinfo_to_se (&esse, &loop); - edse.ss = edss; - esse.ss = esss; - } gfc_conv_expr (&cse, cond); ! gfc_add_block_to_block (&body, &cse.pre); cexpr = cse.expr; gfc_conv_expr (&tsse, tsrc); --- 3603,3611 ---- cse.ss = css; tdse.ss = tdss; tsse.ss = tsss; gfc_conv_expr (&cse, cond); ! gfc_add_block_to_block (&block, &cse.pre); cexpr = cse.expr; gfc_conv_expr (&tsse, tsrc); *************** gfc_trans_where_3 (gfc_code * cblock, gf *** 3643,3650 **** --- 3617,3678 ---- else gfc_conv_expr (&tdse, tdst); + /* Make the assignment on condition 'cond'. */ + tstmt = gfc_trans_scalar_assign (&tdse, &tsse, tdst->ts, false, false); + tmp = build3_v (COND_EXPR, cexpr, tstmt, build_empty_stmt ()); + gfc_add_expr_to_block (&body, tmp); + gfc_add_block_to_block (&body, &cse.post); + + gfc_trans_scalarizing_loops (&loop, &body); + gfc_add_block_to_block (&block, &loop.pre); + gfc_add_block_to_block (&block, &loop.post); + gfc_cleanup_loop (&loop); + + /*---------------Now do the ELSEWHERE.--------------*/ if (eblock) { + gfc_init_loopinfo (&loop); + + /* Handle the condition. */ + gfc_init_se (&cse, NULL); + css = gfc_walk_expr (cond); + gfc_add_ss_to_loop (&loop, css); + + /* Handle the then-clause. */ + gfc_init_se (&edse, NULL); + gfc_init_se (&esse, NULL); + edss = gfc_walk_expr (edst); + esss = gfc_walk_expr (esrc); + if (esss == gfc_ss_terminator) + { + esss = gfc_get_ss (); + esss->next = gfc_ss_terminator; + esss->type = GFC_SS_SCALAR; + esss->expr = esrc; + } + gfc_add_ss_to_loop (&loop, edss); + gfc_add_ss_to_loop (&loop, esss); + + gfc_conv_ss_startstride (&loop); + gfc_conv_loop_setup (&loop); + + gfc_mark_ss_chain_used (css, 1); + gfc_mark_ss_chain_used (edss, 1); + gfc_mark_ss_chain_used (esss, 1); + + gfc_start_scalarized_body (&loop, &body); + + gfc_copy_loopinfo_to_se (&cse, &loop); + gfc_copy_loopinfo_to_se (&edse, &loop); + gfc_copy_loopinfo_to_se (&esse, &loop); + cse.ss = css; + edse.ss = edss; + esse.ss = esss; + + gfc_conv_expr (&cse, cond); + gfc_add_block_to_block (&body, &cse.pre); + cexpr = cse.expr; + gfc_conv_expr (&esse, esrc); if (edss != gfc_ss_terminator && loop.temp_ss != NULL) { *************** gfc_trans_where_3 (gfc_code * cblock, gf *** 3653,3672 **** } else gfc_conv_expr (&edse, edst); } - tstmt = gfc_trans_scalar_assign (&tdse, &tsse, tdst->ts, false, false); - estmt = eblock ? gfc_trans_scalar_assign (&edse, &esse, edst->ts, false, false) - : build_empty_stmt (); - tmp = build3_v (COND_EXPR, cexpr, tstmt, estmt); - gfc_add_expr_to_block (&body, tmp); - gfc_add_block_to_block (&body, &cse.post); - - gfc_trans_scalarizing_loops (&loop, &body); - gfc_add_block_to_block (&block, &loop.pre); - gfc_add_block_to_block (&block, &loop.post); - gfc_cleanup_loop (&loop); - return gfc_finish_block (&block); } --- 3681,3700 ---- } else gfc_conv_expr (&edse, edst); + + /* Make the assignment on condition 'NOT.cond'. */ + estmt = gfc_trans_scalar_assign (&edse, &esse, edst->ts, false, false); + cexpr = fold_build1 (TRUTH_NOT_EXPR, boolean_type_node, cexpr); + tmp = build3_v (COND_EXPR, cexpr, estmt, build_empty_stmt ()); + gfc_add_expr_to_block (&body, tmp); + gfc_add_block_to_block (&body, &cse.post); + + gfc_trans_scalarizing_loops (&loop, &body); + gfc_add_block_to_block (&block, &loop.pre); + gfc_add_block_to_block (&block, &loop.post); + gfc_cleanup_loop (&loop); } return gfc_finish_block (&block); } *************** gfc_trans_where (gfc_code * code) *** 3698,3708 **** cblock->next->expr2, 0)) return gfc_trans_where_3 (cblock, NULL); } else if (!eblock->expr && !eblock->block && eblock->next && eblock->next->op == EXEC_ASSIGN ! && !eblock->next->next) { /* A simple "WHERE (cond) x1 = y1 ELSEWHERE x2 = y2 ENDWHERE" block is dependence free if cond is not dependent on writes --- 3726,3739 ---- cblock->next->expr2, 0)) return gfc_trans_where_3 (cblock, NULL); } + /* Since gfc_trans_where_3 evaluates the condition expression + twice, do not use it if the condition is not a variable. */ else if (!eblock->expr && !eblock->block && eblock->next && eblock->next->op == EXEC_ASSIGN ! && !eblock->next->next ! && cblock->expr->expr_type == EXPR_VARIABLE) { /* A simple "WHERE (cond) x1 = y1 ELSEWHERE x2 = y2 ENDWHERE" block is dependence free if cond is not dependent on writes Index: gcc/testsuite/gfortran.dg/where_1.f90 =================================================================== *** gcc/testsuite/gfortran.dg/where_1.f90 (revision 0) --- gcc/testsuite/gfortran.dg/where_1.f90 (revision 0) *************** *** 0 **** --- 1,61 ---- + ! { dg-do run } + ! { dg-options "-fdump-tree-original" } + ! Tests the fix for PR35759, in which the simple WHERE was logically + ! wrong. 7.5.3.2 requires that the WHERE and ELSEWHERE are execute in + ! separate loops, whereas gfortran was implementing them as a single + ! loop with an 'if' and 'else'. Since the condition expression is + ! evaluated twice with the fix, the use of anything other than a + ! variable or parameter array for the condition will trigger the more + ! comprehensive implementation of WHERE. This is checked by the + ! check of the declaration of temp.15 in the 'original' code. + ! + ! Contributed by Dick Hendrickson <dick.hendrickson@gmail.com> + ! + program RG0023 + + integer UDA1L(6) + integer :: UDA1R(6), expected(6) = (/2,0,5,0,3,0/) + LOGICAL LDA(5) + LOGICAL, parameter :: PDA(5) = (/ (i/2*2 .ne. I, i=1,5) /) + + UDA1L(1:6) = 0 + uda1r = (/1,2,3,4,5,6/) + lda = pda + + WHERE (lda) ! expected + UDA1L(1:5) = UDA1R(2:6) ! uda1l = 2,0,4,0,6,0 + ELSEWHERE + UDA1L(2:6) = UDA1R(6:2:-1) !uda1l = 2,0,5,0,3,0 + ENDWHERE + + if (any (uda1l /= expected)) call abort () + + uda1l = 0 + + WHERE (pda) ! expected + UDA1L(1:5) = UDA1R(2:6) ! uda1l = 2,0,4,0,6,0 + ELSEWHERE + UDA1L(2:6) = UDA1R(6:2:-1) !uda1l = 2,0,5,0,3,0 + ENDWHERE + + if (any (uda1l /= expected)) call abort () + + uda1l = 0 + + WHERE (lfoo ()) ! expected + UDA1L(1:5) = UDA1R(2:6) ! uda1l = 2,0,4,0,6,0 + ELSEWHERE + UDA1L(2:6) = UDA1R(6:2:-1) !uda1l = 2,0,5,0,3,0 + ENDWHERE + + if (any (uda1l /= expected)) call abort () + + contains + + function lfoo () result (ltmp) + logical ltmp(5) + ltmp = lda + end function lfoo + END + ! { dg-final { scan-tree-dump-times "temp.18\\\[5\\\]" 1 "original" } } + ! { dg-final { cleanup-tree-dump "original" } } From-SVN: r133965
2008-04-06 21:37:45 +02:00
2008-04-06 Paul Thomas <pault@gcc.gnu.org>
PR fortran/35780
* expr.c (scalarize_intrinsic_call): Identify which argument is
an array and use that as the template.
(check_init_expr): Remove tests that first argument is an array
in the call to scalarize_intrinsic_call.
2008-04-06 Tobias Schlüter <tobi@gcc.gnu.org>
PR fortran/35832
* io.c (io_tag): Add field 'value'. Split 'spec' field in
existing io_tags.
(match_etag, match_vtag, match_ltag): Split parsing in two steps
to give better error messages.
2008-04-06 Tobias Burnus <burnus@net-b.de>
* io.c (check_io_constraints): Add constrains. ID= requires
asynchronous= and asynchronous= must be init expression.
2008-04-06 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* f95-lang.c: Set LANG_HOOKS_NAME to "GNU Fortran".
2008-04-06 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* dump-parse-tree.c: Use fprintf, fputs and fputc instead of
gfc_status and gfc_status_char. Remove gfc_ prefix of the gfc_show_*
functions and make them static. Add new gfc_dump_parse_tree
function.
* gfortran.h (gfc_option_t): Rename verbose into dump_parse_tree.
(gfc_status, gfc_status_char): Delete prototypes.
* error.c (gfc_status, gfc_status_char): Remove functions.
* scanner.c (gfc_new_file): Use printf instead of gfc_status.
* options.c (gfc_init_options): Rename verbose into dump_parse_tree.
(gfc_handle_module_path_options): Use gfc_fatal_error instead of
gfc_status and exit.
(gfc_handle_option): Rename verbose into dump_parse_tree.
* parse.c (gfc_parse_file): Use gfc_dump_parse_tree.
PR fortran/25829 28655 2008-04-05 Jerry DeLisle <jvdelisle@gcc.gnu.org> Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> PR fortran/25829 28655 * dump-parse-tree.c (gfc_show_code_node): Show new I/O parameters. * gfortran.h (gfc_statement): Add ST_WAIT enumerator. (gfc_open): Add pointers for decimal, encoding, round, sign, asynchronous. (gfc_inquire): Add pointers for asynchronous, decimal, encoding, pending, round, sign, size, id. (gfc_wait): New typedef struct. (gfc_dt): Add pointers for id, pos, asynchronous, blank, decimal, delim, pad, round, sign. (gfc_exec_op): Add EXEC_WAIT enumerator. (gfc_code): Add pointer for wait. (gfc_free_wait), (gfc_resolve_wait): New function prototypes. * trans-stmt.h (gfc_trans_wait): New function prototype. * trans.c (gfc_trans_code): Add case for EXEC_WAIT. * io.c (io_tag): Add new tags for DECIMAL, ENCODING, ROUND, SIGN, ASYCHRONOUS, ID. (match_open_element): Add matchers for new tags. (gfc_free_open): Free new pointers. (gfc_resolve_open): Resolve new tags. (gfc_resolve_open): Remove comment around check for allowed values and ASYNCHRONOUS, update it. Likewise for DECIMAL, ENCODING, ROUND, and SIGN. (match_dt_element): Add matching for new tags. (gfc_free_wait): New function. (gfc_resolve_wait): New function. (match_wait_element): New function. (gfc_match_wait): New function. * resolve.c (gfc_resolve_blocks): Add case for EXEC_WAIT. (resolve_code): Add case for EXEC_WAIT. * st.c (gfc_free_statement): Add case for EXEC_WAIT. * trans-io.c (ioparam_type): Add IOPARM_ptype_wait. (gfc_st_parameter): Add "wait" entry. (iocall): Add IOCALL_WAIT enumerator. (gfc_build_io_library_fndecls): Add function declaration for st_wait. (gfc_trans_open): Add mask bits for new I/O tags. (gfc_trans_inquire): Add mask bits for new I/O tags. (gfc_trans_wait): New translation function. (build_dt): Add mask bits for new I/O tags. * match.c (gfc_match_if) Add matcher for "wait". * match.h (gfc_match_wait): Prototype for new function. * ioparm.def: Add new I/O parameter definitions. * parse.c (decode_statement): Add match for "wait" statement. (next_statement): Add case for ST_WAIT. (gfc_ascii_statement): Same. Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> From-SVN: r133944
2008-04-06 00:23:27 +02:00
2008-04-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/25829 28655
* dump-parse-tree.c (gfc_show_code_node): Show new I/O parameters.
* gfortran.h (gfc_statement): Add ST_WAIT enumerator.
(gfc_open): Add pointers for decimal, encoding, round, sign,
asynchronous. (gfc_inquire): Add pointers for asynchronous, decimal,
encoding, pending, round, sign, size, id.
(gfc_wait): New typedef struct. (gfc_dt): Add pointers for id, pos,
asynchronous, blank, decimal, delim, pad, round, sign.
(gfc_exec_op): Add EXEC_WAIT enumerator. (gfc_code): Add pointer for
wait. (gfc_free_wait), (gfc_resolve_wait): New function prototypes.
* trans-stmt.h (gfc_trans_wait): New function prototype.
* trans.c (gfc_trans_code): Add case for EXEC_WAIT.
* io.c (io_tag): Add new tags for DECIMAL, ENCODING, ROUND, SIGN,
ASYCHRONOUS, ID. (match_open_element): Add matchers for new tags.
(gfc_free_open): Free new pointers. (gfc_resolve_open): Resolve new
tags. (gfc_resolve_open): Remove comment around check for allowed
values and ASYNCHRONOUS, update it. Likewise for DECIMAL, ENCODING,
ROUND, and SIGN. (match_dt_element): Add matching for new tags.
(gfc_free_wait): New function. (gfc_resolve_wait): New function.
(match_wait_element): New function. (gfc_match_wait): New function.
* resolve.c (gfc_resolve_blocks): Add case for EXEC_WAIT.
(resolve_code): Add case for EXEC_WAIT.
* st.c (gfc_free_statement): Add case for EXEC_WAIT.
* trans-io.c (ioparam_type): Add IOPARM_ptype_wait. (gfc_st_parameter):
Add "wait" entry. (iocall): Add IOCALL_WAIT enumerator.
(gfc_build_io_library_fndecls): Add function declaration for st_wait.
(gfc_trans_open): Add mask bits for new I/O tags.
(gfc_trans_inquire): Add mask bits for new I/O tags.
(gfc_trans_wait): New translation function.
(build_dt): Add mask bits for new I/O tags.
* match.c (gfc_match_if) Add matcher for "wait".
* match.h (gfc_match_wait): Prototype for new function.
* ioparm.def: Add new I/O parameter definitions.
* parse.c (decode_statement): Add match for "wait" statement.
(next_statement): Add case for ST_WAIT. (gfc_ascii_statement): Same.
2008-04-03 Jakub Jelinek <jakub@redhat.com>
PR fortran/35786
* openmp.c (resolve_omp_clauses): Diagnose if a clause symbol
isn't a variable.
2008-04-03 Tom Tromey <tromey@redhat.com>
* Make-lang.in (fortran_OBJS): New variable.
2008-04-03 Paolo Bonzini <bonzini@gnu.org>
* f95-lang.c (insert_block): Kill.
trans-common.c (create_common): Add decl to function chain to preserve identifier scope in debug output. * fortran/trans-common.c (create_common): Add decl to function chain to preserve identifier scope in debug output. * dbxout.c: Emit .stabs debug info for Fortran COMMON block variables as base symbol name + offset using N_BCOMM/N_ECOMM. (is_fortran, dbxout_common_name, dbxout_common_check): New functions. (dbxout_symbol_location): Transform N_LCSYM to N_GSYM for storage in common. (dbxout_syms): Check for COMMON-based symbol and wrap in N_BCOMM/N_ECOMM stab bracket, including as many symbols as possible in bracket for efficiency. * dwarf2out.c: Emit DWARF debug info for Fortran COMMON block using DW_TAG_common_block + member offset. (add_pubname_string): New function. (dw_expand_expr): New function to find block name and offset for COMMON var. (common_check): New function to check whether symbol in Fortran COMMON. (gen_variable_die): If COMMON, use DW_TAG_common_block. * testsuite/gcc.dg/debug/pr35154.c: New test to check that non-Fortran use of common is unchanged. * testsuite/lib/gfortran-dg.exp: New harness to compile Fortran progs with all combinations of debug options available on target. * testsuite/gfortran.dg/debug/debug.exp: Ditto. * testsuite/gfortran.dg/debug/trivial.f: Ditto. * testsuite/gfortran.dg/debug/pr35154-stabs.f: New test case for .stabs functionality. * testsuite/gfortran.dg/debug/pr35154-dwarf2.f: New test case for DWARF functionality. From-SVN: r133801
2008-04-01 23:23:36 +02:00
2008-04-01 George Helffrich <george@gcc.gnu.org>
PR fortran/35154, fortran/23057
trans-common.c (create_common): Add decl to function chain to preserve identifier scope in debug output. * fortran/trans-common.c (create_common): Add decl to function chain to preserve identifier scope in debug output. * dbxout.c: Emit .stabs debug info for Fortran COMMON block variables as base symbol name + offset using N_BCOMM/N_ECOMM. (is_fortran, dbxout_common_name, dbxout_common_check): New functions. (dbxout_symbol_location): Transform N_LCSYM to N_GSYM for storage in common. (dbxout_syms): Check for COMMON-based symbol and wrap in N_BCOMM/N_ECOMM stab bracket, including as many symbols as possible in bracket for efficiency. * dwarf2out.c: Emit DWARF debug info for Fortran COMMON block using DW_TAG_common_block + member offset. (add_pubname_string): New function. (dw_expand_expr): New function to find block name and offset for COMMON var. (common_check): New function to check whether symbol in Fortran COMMON. (gen_variable_die): If COMMON, use DW_TAG_common_block. * testsuite/gcc.dg/debug/pr35154.c: New test to check that non-Fortran use of common is unchanged. * testsuite/lib/gfortran-dg.exp: New harness to compile Fortran progs with all combinations of debug options available on target. * testsuite/gfortran.dg/debug/debug.exp: Ditto. * testsuite/gfortran.dg/debug/trivial.f: Ditto. * testsuite/gfortran.dg/debug/pr35154-stabs.f: New test case for .stabs functionality. * testsuite/gfortran.dg/debug/pr35154-dwarf2.f: New test case for DWARF functionality. From-SVN: r133801
2008-04-01 23:23:36 +02:00
* trans-common.c (create_common): Add decl to function
chain to preserve identifier scope in debug output.
2008-04-01 Joseph Myers <joseph@codesourcery.com>
* gfortran.texi: Include gpl_v3.texi instead of gpl.texi
* Make-lang.in (GFORTRAN_TEXI): Include gpl_v3.texi instead of
gpl.texi.
2008-03-30 Paul Thomas <pault@gcc.gnu.org>
PR fortran/35740
* resolve.c (resolve_function, resolve_call): If the procedure
is elemental do not look for noncopying intrinsics.
2008-03-29 Paul Thomas <pault@gcc.gnu.org>
PR fortran/35698
* trans-array.c (gfc_array_init_size): Set 'size' zero if
negative in one dimension.
PR fortran/35702
* trans-expr.c (gfc_trans_string_copy): Only assign a char
directly if the lhs and rhs types are the same.
2008-03-28 Daniel Franke <franke.daniel@gmail.com>
Paul Richard Thomas <paul.richard.thomas@gmail.com>
PR fortran/34714
* primary.c (match_variable): Improved matching of function
result variables.
* resolve.c (resolve_allocate_deallocate): Removed checks if
the actual argument for STAT is a variable.
2008-03-28 Tobias Burnus <burnus@net-b.de>
* symbol.c (gfc_get_default_type): Fix error message; option
-fallow_leading_underscore should be -fallow-leading-underscore
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.
2008-03-27 Tom Tromey <tromey@redhat.com>
* Make-lang.in: Revert automatic dependency patch.
x-solaris (host-solaris.o): Update. gcc * config/x-solaris (host-solaris.o): Update. * config/x-linux (host-linux.o): Update. * config/x-hpux (host-hpux.o): Update. * config/x-darwin (host-darwin.o): Update. * config/v850/t-v850e (v850-c.o): Update. * config/v850/t-v850 (v850-c.o): Update. * config/t-vxworks (vxworks.o): Update. * config/t-sol2 (sol2-c.o, sol2.o): Update. * config/t-darwin (darwin.o, darwin-c.o, darwin-driver.o): Update. * config/spu/t-spu-elf (spu-c.o): Update. (spu.o): Remove. * config/sh/t-symbian (sh-c.o): Update. (symbian.o): Update. * config/sh/t-sh (sh-c.o): Update. * config/score/t-score-elf (score7.o, score3.o): Update. * config/rs6000/x-rs6000 (driver-rs6000.o): Update. * config/rs6000/x-darwin64 (host-ppc64-darwin.o): Update. * config/rs6000/x-darwin (host-ppc-darwin.o): Update. * config/rs6000/t-rs6000 (rs6000-c.o): Update. (rs6000.o): Remove. * config/m68k/t-uclinux (generated_files): Add sysroot-suffix.h. * config/m32c/t-m32c (m32c-pragma.o): Update. * config/ia64/t-ia64 (ia64-c.o): Update. * config/i386/x-mingw32 (host-mingw32.o): Update. * config/i386/x-i386 (driver-i386.o): Update. * config/i386/x-darwin (host-i386-darwin.o): Update. * config/i386/x-cygwin (host-cygwin.o): Update. * config/i386/t-nwld (nwld.o): Update. * config/i386/t-netware (netware.o): Update. * config/i386/t-interix (winnt.o): Update. * config/i386/t-cygwin (cygwin1.o, cygwin2.o): Update. * config/i386/t-cygming (winnt.o, winnt-cxx.o, winnt-stubs.o, msformat-c.o): Update. * config/bfin/t-bfin-linux (generated_files): Add linux-sysroot-suffix.h. * config/arm/t-wince-pe (pe.o): Update. * config/arm/t-strongarm-pe (pe.o): Update. * config/arm/t-pe (pe.o): Update. * config/arm/t-arm (arm-c.o): Update. * doc/install.texi (Prerequisites): Require make 3.80. * Makefile.in: Remove .o targets. (CCDEPMODE, DEPDIR, depcomp, BUILD_DEPMODE): New variables. (OBSTACK_H, FIBHEAP_H, PARTITION_H, MD5_H, BCONFIG_H): Remove. (simple_generated_h, simple_generated_c): Move earlier. (generated_files): New variable. (TARGET_H, MACHMODE_H, HOOKS_H, HOSTHOOKS_DEF_H, LANGHOOKS_DEF_H, TARGET_DEF_H, RTL_BASE_H, RTL_H, PARAMS_H, BUILTINS_DEF, TREE_H, BASIC_BLOCK_H, GCOV_IO_H, COVERAGE_H, DEMANGLE_H, RECOG_H, ALIAS_H, EMIT_RTL_H, FLAGS_H, FUNCTION_H, EXPR_H, OPTABS_H, REGS_H, RA_H, RESOURCE_H, SCHED_INT_H, INTEGRATE_H, CFGLAYOUT_H, CFGLOOP_H, IPA_UTILS_H, IPA_REFERENCE_H, IPA_TYPE_ESCAPE_H, CGRAPH_H, DF_H, RESOURCE_H, DDG_H, GCC_H, GGC_H, TIMEVAR_H, INSN_ATTR_H, C_COMMON_H, C_PRAGMA_H, C_TREE_H, SYSTEM_H, PREDICT_H, DECNUM_H, MKDEPS_H, SYMTAB_H, TREE_DUMP_H, TREE_GIMPLE_H, TREE_FLOW_H, TREE_SSA_LIVE_H, PRETTY_PRINT_H, DIAGNOSTIC_H, C_PRETTY_PRINT_H, SCEV_H, LAMBDA_H, TREE_DATA_REF_H, VARRAY_H, TREE_INLINE_H, REAL_H, DBGCNT_H, EBIMAP_H): Remove. (.c.o): Remove. (COMPILE.base, COMPILE): New variables. (%.o): New pattern rule. (ALL_HOST_OBJS): New variable. (xgcc$(exeext), cpp$(exeext)): Remove extra version.o. (dummy-checksum.o, cc1-checksum.o): Remove. (DRIVER_SHLIB): New variable. (DRIVER_DEFINES): Use it. (gencondmd.c): Move out of build/. (s-conditions): Update. (BUILDCOMPILE.base, BUILDCOMPILE): New variables. (ALL_BUILD_OBJS): Likewise. (build/%.o): Use BUILDCOMPILE. (build/ggc-none.o, build/ggc-none.o, build/min-insn-modes.o, build/print-rtl.o, build/read-rtl.o, build/rtl.o, build/vec.o, build/gencondmd.o, build/genattrtab.o, build/genautomata.o, build/gencheck.o, build/gencodes.o, build/genconditions.o, build/genconfig.o, build/genconstants.o, build/genemit.o, build/genextract.o, build/genflags.o, build/genmddeps.o, build/genopinit.o, build/genoutput.o, build/genpeep.o, build/genpreds.o, build/genrecog.o, build/gcov-iov.o, build/gen-protos.o, build/scan.o, build/fix-header.o, build/scan-decls.o): Simplify. (collect2.o, c-opts.o, gcc.o, gccspec.o, gcc-options.o, cppdefault.o, protoize.o, unprotoize.o, intl.o, version.o, prefix.o, toplev.o): Reduce to variable setting. (libbackend.o): Use COMPILE. Remove most dependencies. Move later. ($(out_object_file), gcc-options.o): New targets. ($(ALL_HOST_OBJS)): New target. Include dependency files. * configure: Rebuilt. * configure.ac: Call ZW_CREATE_DEPDIR, ZW_PROG_COMPILER_DEPENDENCIES. * doc/sourcebuild.texi (Front End Directory): Document new variable. gcc/java * Make-lang.in: Removed most explicit .o targets. (java/jvspec.o): Reduce to variable setting. Moved to java/. ($(GCJ)$(exeext)): Update. (JAVA_OBJS): New variable. (JCFDUMP_OBJS): Reformat. (java_OBJS): New variable. (java/jvspec.o-warn): Update. (java/parse.o-warn): Remove. (JAVA_TREE_H): Remove. (java/jcf-io.o): Reduce to variable setting. (ALL_CPPFLAGS): Likewise. gcc/objc * Make-lang.in (objc_OBJS): New variable. (cc1obj-checksum.o, objc/objc-lang.o, objc/objc-act.o): Remove. gcc/objcp * Make-lang.in (objcp_OBJS): New variable. (cc1objplus-checksum.o, objcp/objcp-lang.o, objcp/objcp-decl.o, objcp/objcp-act.o): Remove. gcc/cp * Make-lang.in: Remove .o targets. (cp/g++spec.o): Moved to cp/. Reduce to variable setting. (GXX_OBJS): Update. (c++_OBJS): New variable. (CXX_TREE_H, CXX_PRETTY_PRINT_H): Remove. gcc/fortran * Make-lang.in: Remove .o targets. (fortran_OBJS): New variable. (fortran/gfortranspec.o): Move to fortran/. Reduce to variable setting. (GFORTRAN_D_OBJS): Update. (GFORTRAN_TRANS_DEPS): Remove. From-SVN: r133523
2008-03-25 17:56:50 +01:00
2008-03-25 Tom Tromey <tromey@redhat.com>
* Make-lang.in: Remove .o targets.
(fortran_OBJS): New variable.
(fortran/gfortranspec.o): Move to fortran/. Reduce to variable
setting.
(GFORTRAN_D_OBJS): Update.
(GFORTRAN_TRANS_DEPS): Remove.
2008-03-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34813
* resolve.c (resolve_structure_cons): It is an error to assign
NULL to anything other than a pointer or allocatable component.
PR fortran/33295
* resolve.c (resolve_symbol): If the symbol is a derived type,
resolve the derived type. If the symbol is a derived type
function, ensure that the derived type is visible in the same
namespace as the function.
2008-03-23 Tobias Schlüter <tobi@gcc.gnu.org>
* trans.h: Use fold_build in build1_v, build2_v and build3_v
macros.
* trans-openmp.c (gfc_trans_omp_critical, gfc_trans_omp_single):
Don't use build2_v macro.
2008-03-19 Daniel Franke <franke.daniel@gmail.com>
PR fortran/35152
* interface.c (gfc_procedure_use): Check for keyworded arguments in
procedures without explicit interfaces.
2008-03-16 Paul Thomas <pault@gcc.gnu.org>
PR fortran/35470
* resolve.c (check_assumed_size_reference): Only visit the
first reference and look directly at the highest dimension.
2008-03-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/35184
* trans-array.c (gfc_conv_array_index_offset): Remove unnecessary
assert.
2008-03-15 Daniel Franke <franke.daniel@gmail.com>
PR fortran/35584
* resolve.c (resolve_branch): Less strict and pessimistic warning
message.
2008-03-11 Paolo Bonzini <bonzini@gnu.org>
* f95-lang.c (LANG_HOOKS_CLEAR_BINDING_STACK): Delete.
(gfc_be_parse_file): Call clear_binding_stack from here.
(gfc_clear_binding_stack): Rename to clear_binding_stack.
2008-03-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/35474
* module.c (mio_symtree_ref): After providing a symbol for a
missing equivalence member, resolve and NULL the fixups.
2008-03-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* invoke.texi (Error and Warning Options): Document
-Wline-truncation.
2008-03-08 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/34956
* trans-array.c (gfc_conv_ss_startstride): Fix the logic to avoid
checking bounds of absent optional arguments.
2008-03-06 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* intrinsic.c (add_functions): Add simplification routines for
ERF, DERF, ERFC and DERFC.
* decl.c (gfc_match_suffix, gfc_match_subroutine): Change GNU
extensions into Fortran 2008 features.
* intrinsic.h (gfc_simplify_erf, gfc_simplify_erfc): New
prototypes.
* simplify.c (gfc_simplify_erf, gfc_simplify_erfc): New functions.
re PR fortran/33197 (Fortran 2008: math functions) 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-03-04 00:46:20 +01:00
2008-03-03 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33197
* 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.
2008-03-02 Jakub Jelinek <jakub@redhat.com>
* gfortranspec.c (lang_specific_driver): Update copyright notice
dates.
2008-02-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/35059
* expr.c (find_array_element): Modify traversing the constructor to
avoid trying to access NULL memory pointed to by next for the
last element. (find_array_section): Exit while loop if cons->next is
NULL.
* trans-expr.c (gfc_conv_scalar_char_value): Initialize gfc_typespec.
(gfc_conv_function_call): Same.
* decl.c (gfc_match_implicit): Same.
* trans-intrinsic.c (gfc_conv_intrinsic_sr_kind): Same.
2008-02-28 Daniel Franke <franke.daniel@gmail.com>
PR fortran/31463
PR fortran/33950
PR fortran/34296
* lang.opt: Added -Wreturn-type.
* options.c (gfc_handle_option): Recognize -Wreturn-type.
* trans-decl.c (gfc_trans_deferred_vars): Emit warnings for funtions
where the result value is not set.
(gfc_generate_function_code): Likewise.
(generate_local_decl): Emit warnings for funtions whose RESULT
variable is not set.
2008-02-28 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/34868
* trans-expr.c (gfc_conv_variable): Don't build indirect
references when explicit interface is mandated.
* resolve.c (resolve_formal_arglist): Set attr.always_explicit
on the result symbol as well as the procedure symbol.
2008-02-27 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
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.
2008-02-26 Tobias Burnus <burnus@net-b.de>
PR fortran/35033
* interface.c (check_operator_interface): Show better line for error
messages; fix constrains for user-defined assignment operators.
(gfc_extend_assign): Fix constrains for user-defined assignment
operators.
system.h (USE_MAPPED_LOCATION): Poison. gcc * system.h (USE_MAPPED_LOCATION): Poison. * Makefile.in (GTFILES): Put CPP_ID_DATA_H first. * tree-cfg.c (make_cond_expr_edges): Remove old location code. (make_goto_expr_edges): Likewise. (remove_bb): Likewise. (execute_warn_function_return): Likewise. * basic-block.h (struct edge_def) <goto_locus>: Change type to location_t. * c-common.c (fname_decl): Remove old location code. * tree-vect-transform.c (vect_finish_stmt_generation): Remove old location code. * rtl.h (ASM_OPERANDS_SOURCE_LOCATION): Remove old-location variant. (ASM_INPUT_SOURCE_LOCATION): Likewise. (gen_rtx_ASM_INPUT): Likewise. (gen_rtx_ASM_INPUT_loc): Likewise. (get_rtx_asm_OPERANDS): Remove. * cfglayout.c (insn_locators_alloc): Remove old location code. (set_curr_insn_source_location): Likewise. (curr_insn_locator): Likewise. * print-tree.c (print_node): Remove old location code. * tree-mudflap.c (mf_varname_tree): Remove old location code. (mf_file_function_line_tree): Remove test of USE_MAPPED_LOCATION. * cfgexpand.c (expand_gimple_cond_expr): Don't use location_from_locus. (construct_exit_block): Remove old location code. * emit-rtl.c (force_next_line_note): Remove old location code. * profile.c (branch_prob): Remove old location code. * tree-vectorizer.h (LOC, UNKNOWN_LOC, EXPR_LOC, LOC_FILE, LOC_LINE): Remove old-location variants. * langhooks.c (lhd_print_error_function): Remove old location code. * configure, config.in: Rebuilt. * configure.ac (--enable-mapped-location): Remove. * c-decl.c (c_init_decl_processing): Remove old location code. (finish_function): Likewise. * recog.c (decode_asm_operands): Remove old location code. * c-pch.c (c_common_read_pch): Remove old location code. * rtl.def (ASM_INPUT, ASM_OPERANDS): Remove old location variants. * gimple-low.c (lower_function_body): Remove old location code. * toplev.c (unknown_location): Remove. (push_srcloc): Remove old-location variant. (process_options): Remove old location code. (lang_dependent_init): Likewise. * input.h (UNKNOWN_LOCATION): Move definition. (location_t): Undeprecate. (source_locus): Remove. (location_from_locus): Remove. (struct location_s): Remove. Remove all old-location code. (input_line, input_filename): Remove. * final.c (final_scan_insn): Remove old location code. * diagnostic.c (diagnostic_build_prefix): Remove USE_MAPPED_LOCATION test. * tree.h (gimple_stmt) <locus>: Now a location_t. (tree_exp) <locus>: Likewise. (DECL_IS_BUILTIN): Remove old-location variant. (annotate_with_file_line, annotate_with_locus): Likewise. (expr_locus, set_expr_locus): Update. * tree.c (build1_stat): Remove old location code. (last_annotated_node): Remove. (annotate_with_file_line): Remove old-location variant. (annotate_with_locus): Likewise. (expr_location): Remove old location code. (set_expr_location): Likewise. (expr_has_location): Likewise. (expr_locus): Likewise. (set_expr_locus): Likewise. (expr_filename): Don't use location_from_locus. (expr_lineno): Likewise. * rtl-error.c (location_for_asm): Remove old location code. * c-lex.c (cb_line_change): Remove old location code. (fe_file_change): Likewise. (cb_def_pragma): Likewise. (c_lex_with_flags): Likewise. * gengtype.c (do_typedef): Don't special-case location types. (define_location_structures): Remove. (main): Don't call define_location_structures. * tree-pretty-print.c (dump_implicit_edges): Remove old location code. gcc/ada * misc.c (internal_error_function): Remove test of USE_MAPPED_LOCATION. * trans.c (gigi): Remove test of USE_MAPPED_LOCATION. (Sloc_to_locus): Remove old location code. gcc/cp * parser.c (eof_token): Remove old location code. (check_empty_body): Remove test of USE_MAPPED_LOCATION. * decl2.c (generate_ctor_or_dtor_function): Remove old location code. (cp_write_global_declarations): Likewise. * lex.c (cxx_init): Remove old location code. (handle_pragma_implementation): Remove test of USE_MAPPED_LOCATION. * pt.c (tsubst): Remove old location code. * error.c (cp_print_error_function): Remove test of USE_MAPPED_LOCATION. * decl.c (pop_label): Remove old location code. (finish_function): Likewise. gcc/fortran * trans-io.c (set_error_locus): Remove old location code. * trans-decl.c (gfc_set_decl_location): Remove old location code. * f95-lang.c (gfc_init): Remove test of USE_MAPPED_LOCATION. * scanner.c (gfc_gobble_whitespace): Remove old location code. (get_file): Likewise. (preprocessor_line): Likewise. (load_file): Likewise. (gfc_new_file): Likewise. * trans.c (gfc_trans_runtime_check): Remove old location code. (gfc_get_backend_locus): Likewise. (gfc_set_backend_locus): Likewise. * data.c (gfc_assign_data_value): Remove old location code. * error.c (show_locus): Remove old location code. * gfortran.h (gfc_linebuf): Remove old location code. (gfc_linebuf_linenum): Remove old-location variant. gcc/java * lang.c (java_post_options): Remove conditional. * expr.c (expand_byte_code): Remove old location code. * jcf-parse.c (set_source_filename): Remove old location code. (give_name_to_class): Likewise. (jcf_parse): Likewise. (duplicate_class_warning): Likewise. (parse_class_file): Likewise. (java_parse_file): Likewise. * decl.c (finish_method): Remove old location code. * class.c (push_class): Remove old location code. gcc/objc * objc-act.c (objc_init): Remove old location code. gcc/treelang * tree1.c (treelang_init): Remove old location code. (treelang_parse_file): Likewise. * lex.l (LINEMAP_POSITION_FOR_COLUMN): Remove. (update_lineno_charno): Remove old location code. From-SVN: r132679
2008-02-26 17:05:24 +01:00
2008-02-26 Tom Tromey <tromey@redhat.com>
* trans-io.c (set_error_locus): Remove old location code.
* trans-decl.c (gfc_set_decl_location): Remove old location code.
* f95-lang.c (gfc_init): Remove test of USE_MAPPED_LOCATION.
* scanner.c (gfc_gobble_whitespace): Remove old location code.
(get_file): Likewise.
(preprocessor_line): Likewise.
(load_file): Likewise.
(gfc_new_file): Likewise.
* trans.c (gfc_trans_runtime_check): Remove old location code.
(gfc_get_backend_locus): Likewise.
(gfc_set_backend_locus): Likewise.
* data.c (gfc_assign_data_value): Remove old location code.
* error.c (show_locus): Remove old location code.
* gfortran.h (gfc_linebuf): Remove old location code.
(gfc_linebuf_linenum): Remove old-location variant.
2008-02-25 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/34729
* trans-const.c (gfc_build_string_const): Don't call gettext.
(gfc_build_localized_string_const): New function.
* trans-const.h (gfc_build_localized_string_const): New prototype.
* trans.c (gfc_trans_runtime_check): Use
gfc_build_localized_string_const instead of gfc_build_string_const.
(gfc_call_malloc): Likewise.
(gfc_allocate_with_status): Likewise.
(gfc_allocate_array_with_status): Likewise.
(gfc_deallocate_with_status): Likewise.
(gfc_call_realloc): Likewise.
* trans-io.c (gfc_trans_io_runtime_check): Likewise.
2008-02-24 Tobias Schlüter <tobi@gcc.gnu.org>
* 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.
2008-02-24 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/35223
* simplify.c (gfc_simplify_ibclr), (gfc_simplify_ibits),
(gfc_simplify_ibset): Remove call to range_check.
(simplify_cmplx), (gfc_simplify_dble), (gfc_simplify_float)
(gfc_simplify_real): Add call gfc_clear_ts to initialize the
temporary gfc_typspec variable.
2008-02-24 Tobias Schlüter <tobi@gcc.gnu.org>
* trans-array.c (gfc_conv_descriptor_data_get,
gfc_conv_descriptor_data_set_internal,
gfc_conv_descriptor_data_addr, gfc_conv_descriptor_offset,
gfc_conv_descriptor_dtype, gfc_conv_descriptor_dimension,
gfc_conv_descriptor_stride, gfc_conv_descriptor_lbound,
gfc_conv_descriptor_ubound, gfc_trans_create_temp_array,
gfc_conv_array_transpose, gfc_grow_array,
gfc_trans_array_constructor_subarray,
gfc_trans_array_constructor_value, gfc_trans_scalarized_loop_end,
gfc_array_init_size, gfc_array_allocate, gfc_array_deallocate,
gfc_conv_array_initializer, gfc_trans_array_bounds,
gfc_trans_auto_array_allocation, gfc_trans_dummy_array_bias,
gfc_get_dataptr_offset, gfc_conv_array_parameter,
gfc_trans_dealloc_allocated, get_full_array_size,
gfc_duplicate_allocatable, structure_alloc_comps): Use fold_buildN
instead of buildN.
* trans-expr.c (gfc_conv_expr_present, gfc_conv_missing_dummy,
gfc_conv_component_ref, gfc_conv_cst_int_power,
gfc_conv_function_call, gfc_trans_structur_assign): Likewise.
* trans-common.c (create_common): Likewise.
* trans-openmp.c (gfc_trans_omp_atomic, gfc_trans_omp_do):
Likewise.
* trans-const.c (gfc_conv_constant_to_tree): Likewise.
* trans-stmt.c (gfc_trans_goto, gfc_trans_return, gfc_trans_do,
gfc_trans_integer_select, gfc_trans_character_select,
gfc_trans_forall_loop, compute_overall_iter_number,
gfc_trans_forall_1, gfc_evaluate_where_mask, gfc_trans_allocate,
gfc_trans_deallocate): Likewise.
* trans.c (gfc_build_addr_expr, gfc_trans_runtime_check,
gfc_allocate_with_status, gfc_allocate_array_with_status,
gfc_deallocate_with_status): Likewise.
* f95-lang.c (gfc_truthvalue_conversion): Likewise.
* trans-io.c (set_parameter_const, set_parameter_value,
set_parameter_ref, set_string, set_internal_unit, io_result,
set_error_locus, nml_get_addr_expr, transfer_expr): Likewise.
* trans-decl.c (gfc_build_qualified_array, build_entry_thunks,
gfc_get_fake_result_decl, gfc_trans_auto_character_variable,
gfc_generate_function_code): Likewise.
* convert.c (convert): Likewise.
* trans-intrinsic.c (gfc_conv_intrinsic_conversion,
build_fixbound_expr, build_fix_expr, gfc_conv_intrinsic_aint,
gfc_conv_intrinsic_int, gfc_conv_intrinsic_imagpart,
gfc_conv_intrinsic_conjg, gfc_conv_intrinsic_abs,
gfc_conv_intrinsic_cmplx, gfc_conv_intrinsic_mod,
gfc_conv_intrinsic_dim, gfc_conv_intrinsic_dprod,
gfc_conv_intrinsic_ctime, gfc_conv_intrinsic_fdate,
gfc_conv_intrinsic_ttynam, gfc_conv_intrinsic_minmax,
gfc_conv_intrinsic_minmax_char, gfc_conv_intrinsic_count,
gfc_conv_intrinsic_arith, gfc_conv_intrinsic_dot_product,
gfc_conv_intrinsic_minmaxloc, gfc_conv_intrinsic_minmaxval,
gfc_conv_intrinsic_btest, gfc_conv_intrinsic_not,
gfc_conv_intrinsic_ibits, gfc_conv_intrinsic_ishft,
gfc_conv_intrinsic_ichar, gfc_conv_intrinsic_size,
gfc_conv_intrinsic_array_transfer, gfc_conv_intrinsic_transfer,
gfc_conv_allocated, gfc_conv_associated, gfc_conv_intrinsic_trim,
gfc_conv_intrinsic_repeat): Likewise.
2008-02-23 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR target/25477
* trans-expr.c (gfc_conv_power_op): Use BUILT_IN_CPOW{F,,L}.
* f95-lang.c (gfc_init_builtin_functions): Define BUILT_IN_CPOW{F,,L}.
* trans.h (gfor_fndecl_math_cpow, gfor_fndecl_math_cpowf,
gfor_fndecl_math_cpowl10, gfor_fndecl_math_cpowl16): Remove.
* trans-decl.c: Likewise.
2008-02-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/35059
* expr.c (find_array_element): Modify traversing the constructor to
avoid trying to access NULL memory pointed to by next for the
last element. (find_array_section): Exit while loop if cons->next is
NULL.
2008-02-22 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.
2008-02-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* gfc-internals.texi: Fix typos and markup nits.
* gfortran.texi: Likewise.
* intrinsic.texi: Likewise.
2008-02-21 Richard Guenther <rguenther@suse.de>
* trans-expr.c (gfc_conv_expr_op): Expand INTRINSIC_PARENTHESES
as unary PAREN_EXPR for real and complex typed expressions.
(gfc_conv_unary_op): Fold the built tree.
2008-02-20 Tobias Burnus <burnus@net-b.de>
PR fortran/34997
* match.c (gfc_match_name): Improve error message for '$'.
2008-02-19 Daniel Franke <franke.daniel@gmail.com>
PR fortran/35030
* expr.c (gfc_check_pointer_assign): Add type and kind information
to type-mismatch message.
(gfc_check_assign): Unify error messages.
2008-02-16 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/34952
* gfortran.texi: Create new section for unimplemented extensions.
Add "STRUCTURE and RECORD" and "ENCODE and DECODE statements".
Remove "smaller projects" list. Fix a few typos.
2008-02-15 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* intrinsic.texi: Rename INDEX node to avoid clashing with
index.html on case-insensitive systems.
2008-02-15 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/35150
* trans-expr.c (gfc_conv_function_call): Force evaluation of
se->expr.
2008-02-10 Daniel Franke <franke.daniel@gmail.com>
PR fortran/35019
* lang.opt: Allow '-J<dir>' next to '-J <dir>',
likewise '-I <dir>' and '-I<dir>'.
2008-02-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
PR other/35107
* Make-lang.in (f951): Add $(GMPLIBS).
2008-02-05 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/35037
* trans-common.c (build_field): Mark fields as volatile when needed.
2008-02-05 Tobias Burnus <burnus@net-b.de>
PR fortran/35093
* data.c (gfc_assign_data_value): Only free "size" if
it has not already been freed.
2008-02-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34945
* array.c (match_array_element_spec): Remove check for negative
array size.
(gfc_resolve_array_spec): Add check for negative size.
2008-02-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/32315
* data.c (gfc_assign_data_value): Add bounds check for array
references.
2008-02-04 Daniel Franke <franke.daniel@gmail.com>
* resolve.c (resolve_where): Fix typo.
(gfc_resolve_where_code_in_forall): Likewise.
2008-02-03 Paul Thomas <pault@gcc.gnu.org>
PR fortran/32760
* resolve.c (resolve_allocate_deallocate): New function.
(resolve_code): Call it for allocate and deallocate.
* match.c (gfc_match_allocate, gfc_match_deallocate) : Remove
the checking of the STAT tag and put in above new function.
* primary,c (match_variable): Do not fix flavor of host
associated symbols yet if the type is not known.
2008-01-31 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34910
* expr.c (gfc_check_assign): It is an error to assign
to a sibling procedure.
2008-01-30 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34975
* symbol.c (gfc_delete_symtree, gfc_undo_symbols): Rename
delete_symtree to gfc_delete_symtree.
* gfortran.h : Add prototype for gfc_delete_symtree.
* module.c (load_generic_interfaces): Transfer symbol to a
unique symtree and delete old symtree, instead of renaming.
(read_module): The rsym and the found symbol are the same, so
the found symtree can be deleted.
PR fortran/34429
* decl.c (match_char_spec): Remove the constraint on deferred
matching of functions and free the length expression.
delete_symtree to gfc_delete_symtree.
(gfc_match_type_spec): Whitespace.
(gfc_match_function_decl): Defer characteristic association for
all types except BT_UNKNOWN.
* parse.c (decode_specification_statement): Only derived type
function matching is delayed to the end of specification.
2008-01-28 Tobias Burnus <burnus@net-b.de>
PR libfortran/34980
* simplify.c (gfc_simplify_shape): Simplify rank zero arrays.
2008-01-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/34990
* array.c (gfc_check_constructor_type): Revert clearing the expression.
2008-01-26 Tobias Burnus <burnus@net-b.de>
PR fortran/34848
* trans-expr.c (gfc_conv_function_call): Don't call
gfc_add_interface_mapping if the expression is NULL.
2008-01-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/31610
* trans-array.c (gfc_trans_create_temp_array): Remove call to
gcc_assert (integer_zerop (loop->from[n])).
2008-01-25 Daniel Franke <franke.daniel@gmail.com>
PR fortran/34661
* resolve.c (resolve_where): Added check if user-defined assignment
operator is an elemental subroutine.
(gfc_resolve_where_code_in_forall): Likewise.
2008-01-24 Daniel Franke <franke.daniel@gmail.com>
PR fortran/33375
PR fortran/34858
* gfortran.h: Revert changes from 2008-01-17.
* match.c: Likewise.
* symbol.c: Likewise.
(gfc_undo_symbols): Undo namespace changes related to common blocks.
2008-01-24 Daniel Franke <franke.daniel@gmail.com>
PR fortran/34202
* data.c (formalize_structure_cons): Skip formalization on
empty structures.
2008-01-24 Daniel Franke <franke.daniel@gmail.com>
* gfortran.texi (OpenMP): Extended existing documentation.
(contributors): Added major contributors of 2008 that were
not listed yet.
(proposed extensions): Removed implemented items.
2008-01-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34872
* parse.c (next_statement) : If ST_GET_FCN_CHARACTERISTICS is
seen, check for a statement label and, if present, delete it
and set the locus to the start of the statement.
2008-01-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34875
* trans-io.c (gfc_trans_transfer): If the array reference in a
read has a vector subscript, use gfc_conv_subref_array_arg to
copy back the temporary.
2008-01-22 Tobias Burnus <burnus@net-b.de>
PR fortran/34848
* interface.c (compare_actual_formal): Fix adding type
to missing_arg_type for absent optional arguments.
2008-01-22 Tobias Burnus <burnus@net-b.de>
PR fortran/34907
* parse.c (parse_spec): Change = into ==.
2008-01-22 Daniel Franke <franke.daniel@gmail.com>
PR fortran/34915
* expr.c (check_elemental): Fix check for valid data types.
2008-01-22 Tobias Burnus <burnus@net-b.de>
PR fortran/34899
* scanner.c (load_line): Support <tab><digit> continuation lines.
* invoke.texi (-Wtabs): Document this.
2008-01-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34896
* module.c (read_module): Set use_rename attribute.
2007-01-21 Tobias Burnus <burnus@net-b.de>
PR fortran/34901
* interface.c (compare_parameter): Improved error message
for arguments of same type and mismatched kinds.
2008-01-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34861
* resolve.c (resolve_entries): Do not do an array bounds check
if the result symbols are the same.
PR fortran/34854
* module.c (read_module) : Hide the symtree of the previous
version of the symbol if this symbol is renamed.
2008-01-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34784
* array.c (gfc_check_constructor_type): Clear the expression ts
so that the checking starts from the deepest level of array
constructor.
* primary.c (match_varspec): If an unknown type is changed to
default character and the attempt to match a substring fails,
change it back to unknown.
PR fortran/34785
* trans-array.c (gfc_add_loop_ss_code) : If ss->string_length is
NULL for an array constructor, use the cl.length expression to
build it.
(gfc_conv_array_parameter): Change call to gfc_evaluate_now to
a tree assignment.
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 Tobias Burnus <burnus@net-b.de>
PR fortran/34760
* primary.c (match_variable): Handle FL_UNKNOWN without
uneducated guessing.
(match_variable): Improve error message.
2008-01-18 Tobias Burnus <burnus@net-b.de>
PR fortran/32616
* interface.c (get_expr_storage_size): Return storage size
for array element designators.
(compare_actual_formal): Reject unequal string sizes for
assumed-shape dummy arguments. And fix error message for
array-sections with vector subscripts.
2008-01-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/34556
* simplify.c (is_constant_array_expr): New static function that returns
true if the given expression is an array and is constant.
(gfc_simplify_reshape): Use new function.
2008-01-17 H.J. Lu <hongjiu.lu@intel.com>
PR fortran/33375
* symbol.c (free_common_tree): Renamed to ...
(gfc_free_common_tree): This. Remove static.
(gfc_free_namespace): Updated.
* gfortran.h (gfc_free_common_tree): New.
* match.c (gfc_match_common): Call gfc_free_common_tree () with
gfc_current_ns->common_root and set gfc_current_ns->common_root
to NULL on syntax error.
2008-01-18 Richard Sandiford <rsandifo@nildram.co.uk>
PR fortran/34686
* trans-expr.c (gfc_conv_function_call): Use proper
type for returned character pointers.
re PR fortran/34429 (Fails: character(len=use_associated_const) function foo()) 2008-01-17 Paul Thomas <pault@gcc.gnu.org> PR fortran/34429 PR fortran/34431 PR fortran/34471 * decl.c : Remove gfc_function_kind_locus and gfc_function_type_locus. Add gfc_matching_function. (match_char_length): If matching a function and the length does not match, return MATCH_YES and try again later. (gfc_match_kind_spec): The same. (match_char_kind): The same. (gfc_match_type_spec): The same for numeric and derived types. (match_prefix): Rename as gfc_match_prefix. (gfc_match_function_decl): Except for function valued character lengths, defer applying kind, type and charlen info until the end of specification block. gfortran.h (gfc_statement): Add ST_GET_FCN_CHARACTERISTICS. parse.c (decode_specification_statement): New function. (decode_statement): Call it when a function has kind = -1. Set and reset gfc_matching function, as function statement is being matched. (match_deferred_characteristics): Simplify with a single call to gfc_match_prefix. Do appropriate error handling. In any case, make sure that kind = -1 is reset or corrected. (parse_spec): Call above on seeing ST_GET_FCN_CHARACTERISTICS. Throw an error if kind = -1 after last specification statement. parse.h : Prototype for gfc_match_prefix. 2008-01-17 Paul Thomas <pault@gcc.gnu.org> PR fortran/34429 * gfortran.dg/function_charlen_1.f90: New test. PR fortran/34431 * gfortran.dg/function_types_1.f90: New test. * gfortran.dg/function_types_2.f90: New test. PR fortran/34471 * gfortran.dg/function_kinds_4.f90: New test. * gfortran.dg/function_kinds_5.f90: New test. * gfortran.dg/defined_operators_1.f90: Errors now at function declarations. * gfortran.dg/private_type_4.f90: The same. * gfortran.dg/interface_15.f90: The same. * gfortran.dg/elemental_args_check_2.f90: The same. * gfortran.dg/auto_internal_assumed.f90: The same. From-SVN: r131592
2008-01-17 08:19:04 +01:00
2008-01-17 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34429
PR fortran/34431
PR fortran/34471
* decl.c : Remove gfc_function_kind_locus and
gfc_function_type_locus. Add gfc_matching_function.
(match_char_length): If matching a function and the length
does not match, return MATCH_YES and try again later.
(gfc_match_kind_spec): The same.
(match_char_kind): The same.
(gfc_match_type_spec): The same for numeric and derived types.
(match_prefix): Rename as gfc_match_prefix.
(gfc_match_function_decl): Except for function valued character
lengths, defer applying kind, type and charlen info until the
end of specification block.
gfortran.h (gfc_statement): Add ST_GET_FCN_CHARACTERISTICS.
parse.c (decode_specification_statement): New function.
(decode_statement): Call it when a function has kind = -1. Set
and reset gfc_matching function, as function statement is being
matched.
(match_deferred_characteristics): Simplify with a single call
to gfc_match_prefix. Do appropriate error handling. In any
case, make sure that kind = -1 is reset or corrected.
(parse_spec): Call above on seeing ST_GET_FCN_CHARACTERISTICS.
Throw an error if kind = -1 after last specification statement.
parse.h : Prototype for gfc_match_prefix.
2008-01-16 Tobias Burnus <burnus@net-b.de>
PR fortran/34796
* interface.c (compare_parameter): Allow AS_DEFERRED array
elements and reject attr.pointer array elemenents.
(get_expr_storage_size): Return storage size of elements of
assumed-shape and pointer arrays.
2008-01-15 Sebastian Pop <sebastian.pop@amd.com>
* f95-lang.c (gfc_init_builtin_functions): Initialize GOMP builtins
for flag_tree_parallelize_loops.
re PR libfortran/34671 (any(kind=1) and all(kind=1)) 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
2008-01-15 22:22:07 +01:00
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-13 Tobias Burnus <burnus@net-b.de>
PR fortran/34665
* resolve.c (resolve_actual_arglist): For expressions,
also check for assume-sized arrays.
* interface.c (compare_parameter): Move F2003 character checks
here, print error messages here, reject elements of
assumed-shape array as argument to dummy arrays.
(compare_actual_formal): Update for the changes above.
2008-01-13 Tobias Burnus <burnus@net-b.de>
PR fortran/34763
* decl.c (contained_procedure): Only check directly preceeding state.
2008-01-13 Tobias Burnus <burnus@net-b.de>
PR fortran/34759
* check.c (gfc_check_shape): Accept array ranges of
assumed-size arrays.
2008-01-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/34432
* match.c (gfc_match_name): Don't error if leading character is a '(',
just return MATCH_NO.
2008-01-11 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/34722
* trans-io.c (create_dummy_iostat): Commit the symbol.
2008-01-11 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34537
* simplify.c (gfc_simplify_transfer): Return NULL if the size
of the element is unavailable and only assign character length
to the result, if 'mold' is constant.
2008-01-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34396
* trans-array.c (gfc_trans_array_ctor_element): Use gfc_trans_string_copy
to assign strings and perform bounds checks on the string length.
(get_array_ctor_strlen): Remove bounds checking.
(gfc_trans_array_constructor): Initialize string length checking.
* trans-array.h : Add prototype for gfc_trans_string_copy.
2008-01-08 Richard Guenther <rguenther@suse.de>
PR fortran/34706
PR tree-optimization/34683
* trans-types.c (gfc_get_array_type_bounds): Use an array type
with known size for accesses if that is known.
2008-01-08 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34476
* expr.c (find_array_element): Check that the array bounds are
constant before using them. Use lower, as well as upper bound.
(check_restricted): Allow implied index variable.
2008-01-08 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34681
* trans_array.c (gfc_trans_deferred_array): Do not null the
data pointer on entering scope, nor deallocate it on leaving
scope, if the symbol has the 'save' attribute.
PR fortran/34704
* trans_decl.c (gfc_finish_var_decl): Derived types with
allocatable components and an initializer must be TREE_STATIC.
2008-01-07 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34672
* module.c (write_generic): Rewrite completely.
(write_module): Change call to write_generic.
2008-01-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/34659
* scanner.c (load_line): Do not count ' ' as printable when checking for
continuations.
2008-01-06 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34545
* module.c (load_needed): If the namespace has no proc_name
give it the module symbol.
2008-01-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/34387
* trans-expr.c (gfc_conv_missing_dummy): Use a temporary to type convert
the dummy variable expression, test for NULL, and pass the variable
address to the called function.
2007-01-06 Tobias Burnus <burnus@net-b.de>
PR fortran/34658
* match.c (gfc_match_common): Remove blank common in
DATA BLOCK warning.
* resolve.c (resolve_common_vars): New function.
(resolve_common_blocks): Move checks to resolve_common_vars
and invoke that function.
(resolve_types): Call resolve_common_vars for blank commons.
2008-01-06 Tobias Burnus <burnus@net-b.de>
PR fortran/34655
* resolve.c (resolve_equivalence_derived): Reject derived types with
default initialization if equivalenced with COMMON variable.
2008-01-06 Tobias Burnus <burnus@net-b.de>
PR fortran/34654
* io.c (check_io_constraints): Disallow unformatted I/O for
internal units.
2008-01-06 Tobias Burnus <burnus@net-b.de>
PR fortran/34660
* resolve.c (resolve_formal_arglist): Reject dummy procedure in
ELEMENTAL functions.
2008-01-06 Tobias Burnus <burnus@net-b.de>
PR fortran/34662
* interface.c (compare_actual_formal): Reject parameter
actual to intent(out) dummy.
2008-01-04 Tobias Burnus <burnus@net-b.de>
PR fortran/34557
* primary.c (match_varspec): Gobble whitespace before
checking for '('.