2008-08-31 Daniel Kraft <d@domob.eu>
* gfortran.h (enum gfc_statement): New entry `ST_GENERIC'.
(struct gfc_tbp_generic): New type.
(struct gfc_typebound_proc): Removed `target' and added union with
`specific' and `generic' members; new members `overridden',
`subroutine', `function' and `is_generic'.
(struct gfc_expr): New members `derived' and `name' in compcall union
member and changed type of `tbp' to gfc_typebound_proc.
(gfc_compare_interfaces), (gfc_compare_actual_formal): Made public.
* match.h (gfc_typebound_default_access): New global.
(gfc_match_generic): New method.
* decl.c (gfc_match_generic): New method.
(match_binding_attributes): New argument `generic' and handle it.
(match_procedure_in_type): Mark matched binding as non-generic.
* interface.c (gfc_compare_interfaces): Made public.
(gfc_compare_actual_formal): Ditto.
(check_interface_1), (compare_parameter): Use new public names.
(gfc_procedure_use), (gfc_search_interface): Ditto.
* match.c (match_typebound_call): Set base-symbol referenced.
* module.c (binding_generic): New global array.
(current_f2k_derived): New global.
(mio_typebound_proc): Handle IO of GENERIC bindings.
(mio_f2k_derived): Record current f2k-namespace in current_f2k_derived.
* parse.c (decode_statement): Handle GENERIC statement.
(gfc_ascii_statement): Ditto.
(typebound_default_access), (set_typebound_default_access): Removed.
(gfc_typebound_default_access): New global.
(parse_derived_contains): New default-access implementation and handle
GENERIC statements encountered.
* primary.c (gfc_match_varspec): Adapted to new gfc_typebound_proc
structure and removed check for SUBROUTINE/FUNCTION from here.
* resolve.c (extract_compcall_passed_object): New method.
(update_compcall_arglist): Use it.
(resolve_typebound_static): Adapted to new gfc_typebound_proc structure.
(resolve_typebound_generic_call): New method.
(resolve_typebound_call): Check target is a SUBROUTINE and handle calls
to GENERIC bindings.
(resolve_compcall): Ditto (check for target being FUNCTION).
(check_typebound_override): Handle GENERIC bindings.
(check_generic_tbp_ambiguity), (resolve_typebound_generic): New methods.
(resolve_typebound_procedure): Handle GENERIC bindings and set new
attributes subroutine, function and overridden in gfc_typebound_proc.
(resolve_fl_derived): Ensure extended type is resolved before the
extending one is.
* st.c (gfc_free_statement): Fix bug with free'ing EXEC_COMPCALL's.
* symbol.c (gfc_find_typebound_proc): Adapt for GENERIC changes.
2008-08-31 Daniel Kraft <d@domob.eu>
* gfortran.dg/typebound_generic_1.f03: New test.
* gfortran.dg/typebound_generic_2.f03: New test.
* gfortran.dg/typebound_generic_3.f03: New test.
From-SVN: r139822
2008-08-30 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/36895
* io/write.c (namelist_write_newline): New function to correctly mark
next records in both external and internal units.
(nml_write_obj): Use new function.
(namelist_write: Use new function.
From-SVN: r139813
PR target/37270
* config/sh/sh.h (LEGITIMIZE_RELOAD_ADDRESS): Generate
the reload address with the index register for SFmode
access with a displacement.
From-SVN: r139809
gcc/
PR target/37283
* config/arm/arm.c (arm_optimization_options): Set
flag_section_anchors to 2 instead of 1 to distinguish it from
-fsection-anchors given explicitely on the command line.
From-SVN: r139803
2008-08-30 Thomas Quinot <quinot@adacore.com>
gcc/ada/
* gcc-interface/Make-lang.in: Allow s-oscons.{o,ali} to
be built even without a separate libada directory.
From-SVN: r139799
* decl.c (start_decl_1): Don't complain about auto being incomplete.
(cp_finish_decl): Deduce auto.
* init.c (build_new): Handle 'new auto'.
* typeck2.c (cxx_incomplete_type_diagnostic): Give a different
message for auto than for normal template type parms.
* pt.c (type_dependent_expression_p): Handle { }.
(make_auto): New function.
(listify_autos): New function.
(do_auto_deduction): New function.
(is_auto): New function.
(type_uses_auto): New function.
* cp-tree.h: Declare them.
* parser.c (cp_parser_decl_specifier_seq): In C++0x mode, don't
treat auto as a declspec.
(cp_parser_simple_type_specifier): It's a type-specifier.
From-SVN: r139798
* mn10300.c (mn10300_secondary_reload_class): We need secondary
reloads for AM33-2 if IN is a pseudo with an equivalent memory
location and class is an FP register.
From-SVN: r139789
PR c/37261
* fold-const.c (fold_binary): In (X | C1) & C2 canonicalization
compute new & and | in type rather than TREE_TYPE (arg0).
* gcc.dg/pr37261.c: New test.
From-SVN: r139784
* dwarf2out.c (descr_info_loc): Handle VAR_DECL.
* trans.h (struct lang_type): Add span.
(GFC_TYPE_ARRAY_SPAN): Define.
* trans-decl.c (gfc_get_symbol_decl): For subref array pointers,
copy TREE_STATIC from decl to span instead of setting it
unconditionally, set DECL_ARTIFICIAL, fix type of initializer
and set GFC_TYPE_ARRAY_SPAN on decl's type.
* trans-types.c (gfc_get_array_descr_info): If
GFC_TYPE_ARRAY_SPAN is non-NULL, use it as element size.
From-SVN: r139782
* dwarf2out.c (gen_const_die): New function.
(size_of_die, value_format, output_die): Output larger
dw_val_class_vec using DW_FORM_block2 or DW_FORM_block4.
(native_encode_initializer): New function.
(tree_add_const_value_attribute): Call it.
(gen_decl_die, dwarf2out_decl): Handle CONST_DECLs if is_fortran ().
* trans-decl.c (check_constant_initializer,
gfc_emit_parameter_debug_info): New functions.
(gfc_generate_module_vars, gfc_generate_function_code): Emit
PARAMETERs and unreferenced variables with initializers into
debug info.
From-SVN: r139781
* gfortran.h (gfc_use_list): Add where field.
* module.c (use_locus): New static variable.
(gfc_match_use): Set it.
(gfc_use_module): Copy it to gfc_use_list's where field.
* trans-decl.c (gfc_generate_module_vars): Call gfc_trans_use_stmts.
(gfc_trans_use_stmts): Set backend locus before calling the debug
hook. Allow non-VAR_DECLs to be created even for non-external
module. Don't emit anything so far for renames from different
modules.
From-SVN: r139780
PR fortran/23057
* dwarf2out.c (gen_variable_die): Represent Fortran COMMON vars
as DW_TAG_variable children of DW_TAG_common_block rather than
DW_TAG_member children. Put DW_AT_external to individual
DW_TAG_variable DIEs, not to DW_TAG_common_block.
* gfortran.dg/debug/pr35154-dwarf2.f: Adjust for replacement
of DW_TAG_member with DW_TAG_variable.
From-SVN: r139775
PR fortran/29635
PR fortran/23057
* debug.h (struct gcc_debug_hooks): Add NAME and CHILD
arguments to imported_module_or_decl.
(debug_nothing_tree_tree): Removed.
(debug_nothing_tree_tree_tree_bool): New prototype.
* debug.c (do_nothing_debug_hooks): Adjust.
(debug_nothing_tree_tree): Removed.
(debug_nothing_tree_tree_tree_bool): New function.
* dwarf2out.c (is_symbol_die): Handle DW_TAG_module.
(gen_variable_die): Put all common vars for the
same COMMON block under one DW_TAG_common_block.
(declare_in_namespace): Return new context_die, for Fortran
return the module DIE instead of adding extra declarations into
the namespace.
(gen_type_die_with_usage): Adjust declare_in_namespace caller.
(gen_namespace_die): If is_fortran (), generate DW_TAG_module
instead of DW_TAG_namespace. If DECL_EXTERNAL is set, add
DW_AT_declaration.
(dwarf2out_global_decl): Don't skip Fortran global vars.
(gen_decl_die): Likewise. Adjust declare_in_namespace callers.
(dwarf2out_imported_module_or_decl): Add NAME and CHILD arguments.
If NAME is non-NULL, add DW_AT_name. If CHILD is non-NULL, put
DW_TAG_imported_declaration as child of previous
DW_TAG_imported_module.
* dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Adjust.
* sdbout.c (sdb_debug_hooks): Likewise.
* vmsdbgout.c (vmsdbg_debug_hooks): Likewise.
* name-lookup.c (do_using_directive, cp_emit_debug_info_for_using):
Adjust debug_hooks->imported_module_or_decl callers.
* f95-lang.c (gfc_init_ts): New function.
(LANG_HOOKS_INIT_TS): Define.
* gfortran.h (gfc_use_rename): New type, moved from module.c.
(gfc_get_use_rename): New macro, moved from module.c.
(gfc_use_list): New type.
(gfc_get_use_list): New macro.
(gfc_namespace): Add use_stmts field.
(gfc_free_use_stmts): New prototype.
* Make-lang.in (fortran/trans-decl.o): Depend on debug.h.
* module.c (gfc_use_rename, gfc_get_use_rename): Moved to
gfortran.h.
(gfc_use_module): Chain the USE statement info to
ns->use_stmts.
(gfc_free_use_stmts): New function.
* symbol.c (gfc_free_namespace): Call gfc_free_use_stmts.
* trans.h (struct module_htab_entry): New type.
(gfc_find_module, gfc_module_add_decl): New functions.
* trans.c (gfc_generate_module_code): Create NAMESPACE_DECL for
the module, adjust DECL_CONTEXTs of module procedures and
call gfc_module_add_decl for them.
* trans-common.c (build_common_decl): Set DECL_IGNORED_P
on the common variable.
(create_common): Set DECL_IGNORED_P for use associated vars.
* trans-decl.c: Include debug.h.
(gfc_get_symbol_decl): Set DECL_IGNORED_P on use_assoc vars from
modules.
(build_function_decl): Allow current_function_decl's context
to be a NAMESPACE_DECL.
(module_htab, cur_module): New variables.
(module_htab_do_hash, module_htab_eq, module_htab_decls_hash,
module_htab_decls_eq, gfc_find_module, gfc_module_add_decl): New
functions.
(gfc_create_module_variable): Adjust DECL_CONTEXTs of module
variables and types and call gfc_module_add_decl for them.
(gfc_generate_module_vars): Temporarily set cur_module.
(gfc_trans_use_stmts): New function.
(gfc_generate_function_code): Call it.
(gfc_generate_block_data): Set DECL_IGNORED_P on decl.
* trans-types.c (gfc_get_derived_type): Adjust DECL_CONTEXT
and TYPE_CONTEXT of module derived types.
From-SVN: r139773
2008-08-29 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-opt/37243
* ira-color (ira_fast_allocation): Don't assign hard registers to
global allocnos.
From-SVN: r139769
2008-08-29 Laurent Guerby <laurent@guerby.net>
* Makefile.in (FLAGS_TO_PASS): renamed to LIBADA_FLAGS_TO_PASS to
avoid conflicts. Factor more flags to pass.
(libsubdir): New variable.
(install-gnatlib): New target.
From-SVN: r139767
2008-08-29 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (create_variable_info_for): Do not
create fields for heap vars or vars with a noalias state.
For NO_ALIAS_ANYTHING variables add a self-constraint, not one
from ESCAPED.
* gfortran.fortran-torture/compile/20080806-1.f90: New testcase.
From-SVN: r139765