2009-08-10 Daniel Kraft <d@domob.eu>
PR fortran/37425
* gfortran.dg/typebound_operator_1.f03: New test.
* gfortran.dg/typebound_operator_2.f03: New test.
2009-08-10 Daniel Kraft <d@domob.eu>
PR fortran/37425
* gfortran.h (struct gfc_namespace): New fields tb_uop_root and tb_op.
(gfc_find_typebound_user_op): New routine.
(gfc_find_typebound_intrinsic_op): Ditto.
(gfc_check_operator_interface): Now public routine.
* decl.c (gfc_match_generic): Match OPERATOR(X) or ASSIGNMENT(=).
* interface.c (check_operator_interface): Made public, renamed to
`gfc_check_operator_interface' accordingly and hand in the interface
as gfc_symbol rather than gfc_interface so it is useful for type-bound
operators, too. Return boolean result.
(gfc_check_interfaces): Adapt call to `check_operator_interface'.
* symbol.c (gfc_get_namespace): Initialize new field `tb_op'.
(gfc_free_namespace): Free `tb_uop_root'-based tree.
(find_typebound_proc_uop): New helper function.
(gfc_find_typebound_proc): Use it.
(gfc_find_typebound_user_op): New method.
(gfc_find_typebound_intrinsic_op): Ditto.
* resolve.c (resolve_tb_generic_targets): New helper function.
(resolve_typebound_generic): Use it.
(resolve_typebound_intrinsic_op), (resolve_typebound_user_op): New.
(resolve_typebound_procedures): Resolve operators, too.
(check_uop_procedure): New, code from gfc_resolve_uops.
(gfc_resolve_uops): Moved main code to new `check_uop_procedure'.
From-SVN: r150622
2009-08-10 Vincent Celier <celier@adacore.com>
* prj-env.adb (Create_Config_Pragmas_File.Write_Temp_File): Do not use
the temporary file name in the error message when the temporary file
cannot be created.
2009-08-10 Yannick Moy <moy@adacore.com>
* gnat_ugn.texi: Fix typo
From-SVN: r150619
2009-08-10 Robert Dewar <dewar@adacore.com>
* exp_ch7.adb: Add ??? comment for last change
2009-08-10 Vincent Celier <celier@adacore.com>
* prj-env.adb (Add_To_Buffer): New procedure
(Create_Config_Pragmas_File): Write to temporary file in one shot
(Create_Mapping_File): Ditto
(Set_Ada_Paths): Ditto
From-SVN: r150618
2009-08-10 Vincent Celier <celier@adacore.com>
PR ada/17566
* xref_lib.adb (Print_Xref): Make sure that there is at least one space
between a declaration name and its type.
From-SVN: r150617
2009-08-10 Dodji Seketeli <dodji@redhat.com>
gcc/ChangeLog:
PR c++/40866
* tree-inline.c (copy_statement_list): The resulting copy shouldn't
loose the original type of the statement list.
gcc/testsuite/ChangeLog:
PR c++/40866
* g++.dg/expr/stmt-expr-1.C: New test.
From-SVN: r150615
* config/alpha/alpha.c (struct machine_function): New flag for VMS,
uses_condition_handler.
(alpha_expand_builtin_establish_vms_condition_handler): New expander.
(alpha_expand_builtin_revert_vms_condition_handler): New expander.
(enum alpha_builtin): New ALPHA_BUILTIN_REVERT_VMS_CONDITION_HANDLER
and ALPHA_BUILTIN_ESTABLISH_VMS_CONDITION_HANDLER values.
(code_for_builtin): New insn codes for the new alpha_builtins.
(alpha_init_builtins): Register the new functions as BUILT_IN_MD.
(alpha_sa_size): Account for uses_condition_handler.
(alpha_expand_prologue): Likewise.
(alpha_start_function): Likewise.
(alpha_expand_epilogue): Likewise.
* config/alpha/alpha-protos.h: Prototype the new alpha.c builtin
establish/revert expanders.
* config/alpha/alpha.h (DWARF_FRAME_REGNUM): Define.
* config/alpha/alpha.md (builtin_establish_vms_condition_handler):
New expander, resorting to the alpha.c associated function.
(builtin_revert_vms_condition_handler): Likewise.
* config/alpha/vms-gcc_shell_handler.c: New file. Implements
__gcc_shell_handler, the static VMS condition handler used as
an indirection wrapper to the current dynamically established
handler.
* config/alpha/vms-unwind.h: Complete rewrite.
* config/alpha/t-vms (LIB2FUNCS_EXTRA): Add vms-gcc_shell_handler.c
* config/alpha/vms.h (MD_UNWIND_SUPPORT):
Co-Authored-By: Douglas B Rupp <rupp@gnat.com>
From-SVN: r150612
* config/alpha/alpha.c (alpha_links): Add 'target' field.
(alpha_need_linkage): Handle aliases. Return function symbol.
(alpha_use_linkage): Rename 'linkage' argument to 'func'.
Use ultimate alias target for the linkage name.
* config/alpha/alpha.md (movmemdi): Use the symbol returned
by alpha_need_linkage for the function symbol.
(setmemdi): Likewise.
Co-Authored-By: Douglas B Rupp <rupp@gnat.com>
From-SVN: r150611
* config/alpha/alpha.c (alpha_initialize_trampoline):
Initialize VMS trampoline IAW ABI for bounded procedure calls.
(alpha_start_function): Emit transfer address on nested functions
for VMS trampoline call.
* config/alpha/t-vms (LIB2FUNCS_EXTRA): Remove vms_tramp.asm
since no longer used.
* config/alpha/vms-tramp.asm: Remove.
* config/alpha/vms.h (TRAMPOLINE_TEMPLATE): Leave undefined
since now only data initialized at runtime.
From-SVN: r150609
gcc/
* c-common.c (c_fully_fold_internal): Issue a warning if a binary
operation overflows. Likewise non-cast unary arithmetic.
If one arm of a conditional expression is always taken,
inhibit evaluation warnings for the other arm. Likewise inhibit
evaluation warnings for the second && or || operand if the first
operand is enough to determine the result.
* c-typeck.c (build_conditional_expr): Apply the same inhibition
rules here.
(build_binary_op): Prevent duplicate evaluation warnings.
gcc/testsuite/
* gcc.dg/overflow-warn-8.c: New test.
From-SVN: r150594
gcc/
* tree-out-of-ssa.c (insert_value_copy_on_edge): If the source
and destination have different modes, Use promote_mode to
determine the signedness of the conversion. Assert that the
promoted source mode matches the destination mode. Don't pass
the destination and destination mode to expand_expr if the source
mode is different. Simplify conversion logic.
From-SVN: r150592
PR tree-optimization/41008
* tree-vect-loop.c (vect_is_simple_reduction): Get operands
from condition only in case it's a comparison. Adjust checks.
From-SVN: r150591
* tree-dfa.c (renumber_gimple_stmt_uids_in_blocks): New function.
* tree-flow.h (renumber_gimple_stmt_uids_in_blocks): Declare it.
* tree-ssa-loop-ivopts.c (comp_cost): Make COST an integer.
(enum iv_position): Add IP_AFTER_USE and IP_BEFORE_USE.
(dump_cand): Handle them.
(struct iv_cand): New members COST_STEP and AINC_USE.
(stmt_after_increment): Likewise.
(stmt_after_inc_pos): Renamed from stmt_after_ip_original_pos. All
callers changed. Use gimple_uid comparison instead of scanning.
(add_candidate_1): When looking for identical candidates, take
AINC_USE into account. Set it for new candidates.
(force_expr_to_var_cost): Cast target_spill_cost to int.
(get_address_cost): New arguments STMT_AFTER_INC and MAY_AUTOINC.
All callers changed. Check for availability of autoinc addressing
modes, both in general for a given mode, and in the specific use
case.
(get_computation_cost_at): New argument CAN_AUTOINC. All callers
changed.
(get_computation_cost): Likewise.
(autoinc_possible_for_pair, set_autoinc_for_original_candidates,
add_autoinc_candidates): New static functions.
(add_candidate): Call add_autoinc_candidates for candidates based on
a USE_ADDRESS use.
(find_iv_candidates): Call set_autoinc_for_original_candidates.
(determine_use_iv_cost_address): If we have an autoinc candidate at
the matching use, verify autoinc is possible and subtract the cost
of the candidate's step from the cost.
(determine_iv_cost): Record the cost of the increment in the COST_STEP
member of the candidate.
(tree_ssa_iv_optimize_loop): Swap the calls to determine_iv_costs and
determine_use_iv_costs. Call renumber_gimple_stmt_uids_in_blocks.
testsuite/
* gcc.target/bfin/loop-autoinc.c: New file.
From-SVN: r150588
* config.build (ia64-hp-*vms*): New target.
(alpha64-dec-*vms*,alpha*-dec-*vms*): Fix for config/vms and unify
with ia64-hp-*vms*.
* config.gcc (ia64-hp-*vms*): New target.
(alpha64-dec-*vms*,alpha*-dec-*vms*): Fix for config/vms and unify
with ia64-hp-*vms*.
* config.host (ia64-hp-*vms*): New target.
(alpha64-dec-*vms*,alpha*-dec-*vms*): Fix for config/vms and unify
with ia64-hp-*vms*.
* libgcc/config.host (ia64-hp-*vms*): New target.
(alpha64-dec-*vms*,alpha*-dec-*vms*): Fix for config/vms and unify
with ia64-hp-*vms*.
From-SVN: r150587
gcc/
* combine.c (gen_lowpart_or_truncate): Exclude CONST_INTs from
mode check. Do truncations in an integer mode.
(force_to_mode): Handle subregs for all mode types. Only do
arithmetic simplifications on integer modes.
From-SVN: r150578
2009-08-07 Robert Dewar <dewar@adacore.com>
* sem_warn.adb (Warn_On_Unreferenced_Entity): Fix obvious typo.
2009-08-07 Vincent Celier <celier@adacore.com>
* gnatcmd.adb (GNATCmd): If -U is not used, one and only one main is
specified on the command line and there are switches in the Compiler
package of the project file, use these compilation switches to invoke
the tool.
2009-08-07 Ben Brosgol <brosgol@adacore.com>
* gnat_ugn.texi: Wordsmithing edits at beginning of gnatcheck chapter.
2009-08-07 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Analyze_Proper_Body): Indicate name of missing subunit
even if not in main unit, to simplify debugging.
2009-08-07 Arnaud Charlet <charlet@adacore.com>
* gcc-interface/Makefile.in: Fix handling of GCC_FOR_TARGET.
* gcc-interface/Make-lang.in: Update dependencies.
From-SVN: r150564
2009-08-07 Robert Dewar <dewar@adacore.com>
* types.ads: Minor reformatting
* sem_ch12.ads (Check_Generic_Child_Unit): Add missing documentation.
* frontend.adb, sem_warn.adb, sem_warn.ads: Fix spelling of
Output_Non_Modified_In_Out_Warnings.
* sem_ch13.adb: Remove ??? comment.
2009-08-07 Vincent Celier <celier@adacore.com>
* mlib-prj.adb (Build_Library): Include binder generate object file
for SAL when library name is only one character.
From-SVN: r150563
2009-08-07 Thomas Quinot <quinot@adacore.com>
* targparm.adb: Minor reformatting
* sem.adb: Minor reformatting
* exp_ch4.adb (Expand_N_Conditional_Expression): Add comment.
2009-08-07 Emmanuel Briot <briot@adacore.com>
* prj-conf.adb: Remove duplicate directory separator in the output when
an object directory does not exist.
2009-08-07 Robert Dewar <dewar@adacore.com>
* exp_util.adb: Minor reformatting
2009-08-07 Vincent Celier <celier@adacore.com>
* mlib-prj.adb (Build_Library): Fixed bug in name of ALI file (wrong
length used).
2009-08-07 Ed Schonberg <schonberg@adacore.com>
* exp_ch9.adb (Expand_N_Protected_Type_Declaration): In Ravenscar mode,
detect non-static private components that will violate restriction
No_Implicit_Heap_Allocation.
2009-08-07 Ben Brosgol <brosgol@adacore.com>
* gnat_ugn.texi: Edited Rule Exemption section of gnatcheck chapter.
From-SVN: r150562
* dwarf2out.c (output_fde): When doing hot/cold partitioning, use
fde->dw_fde_begin as begin label instead of hot/cold label.
Use LLSDAC label instead of LLSDA for second section lsda.
(dwarf2out_do_cfi_startproc): Add SECOND argument. Use LLSDAC
label instead of LLSDA if it is true.
(dwarf2out_begin_prologue, dwarf2out_switch_text_section): Adjust
callers.
* except.c (add_call_site, dw2_size_of_call_site_table): Add
SECTION argument. Use it as index into crtl->eh.call_site_record
array.
(dw2_output_call_site_table): Likewise. Add CS_FORMAT argument,
use it to determine how to print table entries instead of using
#ifdef HAVE_AS_LEB128. For SECTION > 0 use hot resp. cold
label instead of normal begin label as base.
(sjlj_assign_call_site_values): Adjust add_call_site caller.
(convert_to_eh_region_ranges): When doing hot/cold partitioning,
ensure no EH range spans between sections and that landing pads
are always in the corresponding section.
(sjlj_size_of_call_site_table, sjlj_output_call_site_table): Adjust
for crtl->eh.call_site_record being an array rather than scalar.
(output_one_function_exception_table): New function, copied
from output_function_exception_table. Adjust
dw2_size_of_call_site_table, dw2_output_call_site_table
callers. For SECOND section use *C suffixed labels.
(output_function_exception_table): Call
output_one_function_exception_table and, when doing hot/cold
partitioning, also another time for the second section.
* opts.c: Include except.h.
(decode_options): Allow -freorder-blocks-and-partition with
exceptions, unless SJLJ or TARGET_UNWIND_INFO.
* Makefile.in (opts.o): Depend on $(EXCEPT_H).
* function.h (struct rtl_eh): Change call_site_record from
scalar into array of 2 elements.
* g++.dg/tree-prof/partition1.C: New test.
From-SVN: r150560
2009-08-07 Richard Guenther <rguenther@suse.de>
* tree-ssa.c (useless_type_conversion_p_1): Only for types
that require structural equality defer to the langhook.
From-SVN: r150559
2009-08-07 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h (enum jump_func_type): New value IPA_JF_ANCESTOR, changed
comments.
(struct ipa_pass_through_data): New type.
(struct ipa_ancestor_jf_data): New type.
(union jump_func_value): Removed field formal_id, added fields
pass_through and ancestor.
(struct ipa_param_call_note): Changed type of formal_id to int from
unsigned.
* ipa-prop.c (ipa_print_node_jump_functions): Print pass through with
operations jump functions and ancestor jump functions.
(compute_complex_pass_through): New function.
(compute_scalar_jump_functions): Call compute_complex_pass_through,
reflect changes in the jump function strucutre.
(update_jump_functions_after_inlining): Ignore complex pass-through
and ancestor jump functions.
* ipa-cp.c (ipcp_lattice_from_jfunc): Added support for ancestor and
polynomial pass-through with operation jump functions.
From-SVN: r150554
* dwarf2out.c (output_fde): When doing hot/cold partitioning, use
fde->dw_fde_begin as begin label instead of hot/cold label.
Use LLSDAC label instead of LLSDA for second section lsda.
(dwarf2out_do_cfi_startproc): Add SECOND argument. Use LLSDAC
label instead of LLSDA if it is true.
(dwarf2out_begin_prologue, dwarf2out_switch_text_section): Adjust
callers.
* except.c (add_call_site, dw2_size_of_call_site_table): Add
SECTION argument. Use it as index into crtl->eh.call_site_record
array.
(dw2_output_call_site_table): Likewise. Add CS_FORMAT argument,
use it to determine how to print table entries instead of using
#ifdef HAVE_AS_LEB128. For SECTION > 0 use hot resp. cold
label instead of normal begin label as base.
(sjlj_assign_call_site_values): Adjust add_call_site caller.
(convert_to_eh_region_ranges): When doing hot/cold partitioning,
ensure no EH range spans between sections and that landing pads
are always in the corresponding section.
(sjlj_size_of_call_site_table, sjlj_output_call_site_table): Adjust
for crtl->eh.call_site_record being an array rather than scalar.
(output_one_function_exception_table): New function, copied
from output_function_exception_table. Adjust
dw2_size_of_call_site_table, dw2_output_call_site_table
callers. For SECOND section use *C suffixed labels.
(output_function_exception_table): Call
output_one_function_exception_table and, when doing hot/cold
partitioning, also another time for the second section.
* opts.c: Include except.h.
(decode_options): Allow -freorder-blocks-and-partition with
exceptions, unless SJLJ or TARGET_UNWIND_INFO.
* Makefile.in (opts.o): Depend on $(EXCEPT_H).
* function.h (struct rtl_eh): Change call_site_record from
scalar into array of 2 elements.
* g++.dg/tree-prof/partition1.C: New test.
From-SVN: r150553
2009-08-07 Martin Jambor <mjambor@suse.cz>
* ipa-prop.c (count_formal_params_1): New function.
(ipa_get_vector_of_formal_parms): New function.
(get_vector_of_formal_parm_types): New function.
(ipa_modify_formal_parameters): New function.
(ipa_modify_call_arguments): New function.
(index_in_adjustments_multiple_times_p): New function.
(ipa_combine_adjustments): New function.
(ipa_dump_param_adjustments): New function.
* ipa-prop.h (struct ipa_parm_adjustment): New type.
(ipa_get_vector_of_formal_parms): Declare.
(ipa_modify_formal_parameters): Declare.
(ipa_modify_call_arguments): Declare.
(ipa_combine_adjustments): Declare.
(ipa_dump_param_adjustments): Declare.
(build_ref_for_offset): Declare.
* Makefile.in (tree-sra.o): Add ipa-prop.h to dependencies.
* tree-sra.c: Include ipa-prop.c.
(build_ref_for_offset): Make public.
From-SVN: r150551