2008-07-31 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Analyze_Generic_Subprogram_Body): After analysis,
transfer pre/postconditions from generic copy to original tree, so that
they will appear in each instance.
(Process_PPCs): Do not transform postconditions into a procedure in a
generic context, to prevent double expansion of check pragmas.
* sem_attr.adb: In an instance, the prefix of the 'result attribute
can be the renaming of the
current instance, so check validity of the name accordingly.
From-SVN: r138372
2008-07-31 Robert Dewar <dewar@adacore.com>
* einfo.adb (Spec_PPC): Now defined for generic subprograms
* einfo.ads (Spec_PPC): Now defined for generic subprograms
* sem_prag.adb (Check_Precondition_Postcondition): Handle generic
subprogram case
From-SVN: r138370
2008-07-31 Robert Dewar <dewar@adacore.com>
* gnat_ugn.texi: Update -gnatN documentation.
* gnat_rm.texi: Add note about pre/postcondition
pragmas not checked in conjunction with front-end inlining.
From-SVN: r138366
2008-07-31 Vincent Celier <celier@adacore.com>
* prj.adb, clean.adb, prj-nmsc.adb, prj.ads: Remove declarations that
were for gprmake only
From-SVN: r138365
2008-07-31 Ed Schonberg <schonberg@adacore.com>
sem_attr.adb: 'Result can have an ambiguous prefix, and is resolved
from context. This attribute must be usable in Ada95 mode.
The attribute can appear in the body of a function marked
Inline_Always, but in this case the postocondition is not enforced.
sem_prag.adb (Check_Precondition_Postcondition): within the expansion
of an inlined call pre- and postconditions are legal
From-SVN: r138364
PR c/36970
* builtins.c (maybe_emit_free_warning): New function.
(expand_builtin): Process BUILT_IN_FREE even at -O0. Call
maybe_emit_free_warning for BUILT_IN_FREE.
* gcc.dg/free-1.c: New test.
* gcc.dg/free-2.c: New test.
From-SVN: r138362
PR debug/36278
* dwarf2out.c (get_context_die): New function.
(force_decl_die, force_type_die): Use it.
(dwarf2out_imported_module_or_decl): Likewise. If base_type_die
returns NULL, force generation of DW_TAG_typedef and put that into
DW_AT_import.
* g++.dg/debug/namespace2.C: New test.
From-SVN: r138361
PR preprocessor/36649
* c-pch.c (c_common_read_pch): Save and restore
line_table->trace_includes across PCH restore.
* gcc.dg/pch/cpp-3.c: New test.
* gcc.dg/pch/cpp-3.hs: New file.
* gcc.dg/pch/cpp-3a.h: New file.
* gcc.dg/pch/cpp-3b.h: New file.
From-SVN: r138360
PR ada/36554
* dwarf2out.c (is_subrange_type): Deal with BOOLEAN_TYPE.
ada/
* back_end.adb (Call_Back_End): Pass Standard_Boolean to gigi.
* gcc-interface/gigi.h (gigi): Take new standard_boolean parameter.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Enumeration_Subtype>:
Set precision to 1 for subtype of BOOLEAN_TYPE.
(set_rm_size): Set TYPE_RM_SIZE_NUM for BOOLEAN_TYPE.
(make_type_from_size): Deal with BOOLEAN_TYPE.
* gcc-interface/misc.c (gnat_print_type): Likewise.
* gcc-interface/trans.c (gigi): Take new standard_boolean parameter.
Set boolean_type_node as its translation in the table, as well
as boolean_false_node for False and boolean_true_node for True.
* gcc-interface/utils.c (gnat_init_decl_processing): Create custom
8-bit boolean_type_node and set its TYPE_RM_SIZE_NUM.
(create_param_decl): Deal with BOOLEAN_TYPE.
(build_vms_descriptor): Likewise.
(build_vms_descriptor64): Likewise.
(convert): Deal with BOOLEAN_TYPE like with ENUMERAL_TYPE.
From-SVN: r138348
2008-07-30 Joey Ye <joey.ye@intel.com>
H.J. Lu <hongjiu.lu@intel.com>
* builtins.c (expand_builtin_setjmp_receiver): Replace
virtual_incoming_args_rtx with crtl->args.internal_arg_pointer.
(expand_builtin_apply_args_1): Likewise.
(expand_builtin_longjmp): Need DRAP for stack alignment.
(expand_builtin_apply): Likewise.
* caller-save.c (setup_save_areas): Call assign_stack_local_1
instead of assign_stack_local to allow alignment reduction.
* calls.c (emit_call_1): Need DRAP for stack alignment if
return pops.
(expand_call): Replace virtual_incoming_args_rtx with
crtl->args.internal_arg_pointer.
* stmt.c (expand_nl_goto_receiver): Likewise.
* cfgexpand.c (get_decl_align_unit): Estimate stack variable
alignment and store to stack_alignment_estimated and
max_used_stack_slot_alignment.
(expand_one_var): Likewise.
(expand_stack_alignment): New function.
(tree_expand_cfg): Initialize max_used_stack_slot_alignment
and stack_alignment_estimated fields in rtl_data. Call
expand_stack_alignment at end.
* defaults.h (INCOMING_STACK_BOUNDARY): New.
(MAX_STACK_ALIGNMENT): Likewise.
(MAX_SUPPORTED_STACK_ALIGNMENT): Likewise.
(SUPPORTS_STACK_ALIGNMENT): Likewise.
* emit-rtl.c (gen_reg_rtx): Estimate stack alignment for
stack alignment when generating virtual registers.
* function.c (assign_stack_local): Renamed to ...
(assign_stack_local_1): This. Add a parameter to indicate
if it is OK to reduce alignment.
(assign_stack_local): Use it.
(instantiate_new_reg): Instantiate virtual incoming args rtx
to vDRAP if stack realignment and DRAP is needed.
(assign_parms): Collect parameter/return type alignment and
contribute to stack_alignment_estimated.
(locate_and_pad_parm): Likewise.
(get_arg_pointer_save_area): Replace virtual_incoming_args_rtx
with crtl->args.internal_arg_pointer.
* function.h (rtl_data): Add new field drap_reg,
max_used_stack_slot_alignment, stack_alignment_estimated,
stack_realign_needed, need_drap, stack_realign_processed and
stack_realign_finalized.
(stack_realign_fp): New macro.
(stack_realign_drap): Likewise.
* global.c (compute_regsets): Frame pointer is needed when
stack is realigned. Can eliminate frame pointer when stack is
realigned and dynamic realigned argument pointer isn't used.
* reload1.c (update_eliminables): Frame pointer is needed
when stack is realigned.
(init_elim_table): Can eliminate frame pointer when stack is
realigned and dynamic realigned argument pointer isn't used.
* rtl.h (assign_stack_local_1): Declare new funtion.
* target-def.h (TARGET_UPDATE_STACK_BOUNDARY): New.
(TARGET_GET_DRAP_RTX): Likewise.
(TARGET_CALLS): Add TARGET_UPDATE_STACK_BOUNDARY and
TARGET_GET_DRAP_RTX.
* target.h (gcc_target): Add update_stack_boundary and
get_drap_rtx.
* tree-vectorizer.c (vect_can_force_dr_alignment_p): Replace
STACK_BOUNDARY with MAX_STACK_ALIGNMENT.
2008-07-30 Xuepeng Guo <xuepeng.guo@intel.com>
H.J. Lu <hongjiu.lu@intel.com>
* dwarf2out.c (dw_fde_struct): Add stack_realignment, drap_reg,
vdrap_reg, stack_realign and drap_reg_saved.
(add_cfi): Don't allow redefining CFA when DRAP is used.
(reg_save): Handle stack alignment.
(dwarf2out_frame_debug_expr): Add rules 16-20 to handle stack
alignment. Don't generate DWARF information for (set fp sp)
when DRAP is used.
(dwarf2out_begin_prologue): Initialize drap_reg and vdrap_reg
to INVALID_REGNUM.
(int_loc_descriptor): Move prototype forward. Also define if
DWARF2_UNWIND_INFO is true.
(output_cfa_loc): Handle DW_CFA_expression.
(build_cfa_aligned_loc): New.
(based_loc_descr): Update assert for stack realign. For local
variables, use sp+offset when stack is aligned without drap and
fp+offset when stack is aligned with drap. For arguments, use
cfa+offset when drap is used to align stack.
2008-07-30 Joey Ye <joey.ye@intel.com>
H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c (ix86_force_align_arg_pointer_string):
Break long line.
(ix86_gen_andsp): New.
(ix86_user_incoming_stack_boundary): Likewise.
(ix86_default_incoming_stack_boundary): Likewise.
(ix86_incoming_stack_boundary): Likewise.
(ix86_can_eliminate): Likewise.
(find_drap_reg): Likewise.
(ix86_update_stack_boundary): Likewise.
(ix86_get_drap_rtx): Likewise.
(ix86_finalize_stack_realign_flags): Likewise.
(TARGET_UPDATE_STACK_BOUNDARY): Likewise.
(TARGET_GET_DRAP_RTX): Likewise.
(override_options): Overide option value for new options.
(ix86_function_ok_for_sibcall): Remove check for
force_align_arg_pointer.
(ix86_handle_cconv_attribute): Likewise.
(ix86_function_regparm): Likewise.
(setup_incoming_varargs_64): Don't set stack_alignment_needed
here.
(ix86_va_start): Replace virtual_incoming_args_rtx with
crtl->args.internal_arg_pointer.
(ix86_select_alt_pic_regnum): Check DRAP register.
(ix86_save_reg): Replace force_align_arg_pointer with drap_reg.
(ix86_compute_frame_layout): Compute frame layout wrt stack
realignment.
(ix86_internal_arg_pointer): Just return
virtual_incoming_args_rtx.
(ix86_expand_prologue): Decide if stack realignment is needed
and generate prologue code accordingly.
(ix86_expand_epilogue): Generate epilogue code wrt stack
realignment is really needed or not.
* config/i386/i386.h (MAIN_STACK_BOUNDARY): New.
(ABI_STACK_BOUNDARY): Likewise.
(PREFERRED_STACK_BOUNDARY_DEFAULT): Likewise.
(STACK_REALIGN_DEFAULT): Likewise.
(INCOMING_STACK_BOUNDARY): Likewise.
(MAX_STACK_ALIGNMENT): Likewise.
(ix86_incoming_stack_boundary): Likewise.
(FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN): Removed.
(REAL_PIC_OFFSET_TABLE_REGNUM): Updated to use BX_REG.
(CAN_ELIMINATE): Defined with ix86_can_eliminate.
(machine_function): Remove force_align_arg_pointer.
* config/i386/i386.md (BX_REG): New.
(R13_REG): Likewise.
* config/i386/i386.opt (mforce_drap): New.
(mincoming-stack-boundary): Likewise.
(mstackrealign): Add Init(-1).
* config/i386/i386-protos.h (ix86_can_eliminate): New
2008-07-30 H.J. Lu <hongjiu.lu@intel.com>
* doc/extend.texi: Update force_align_arg_pointer.
* doc/invoke.texi: Document -mincoming-stack-boundary. Update
-mstackrealign.
* doc/tm.texi (MAX_STACK_ALIGNMENT): Add macro.
(INCOMING_STACK_BOUNDARY): Likewise.
(TARGET_UPDATE_STACK_BOUNDARY): New target hook.
(TARGET_GET_DRAP_RTX): Likewise.
From-SVN: r138335
2008-07-30 Laurent Pautet <pautet@adacore.com>
* g-pehage.adb:
Remove a limitation on the length of the words handled by the minimal
perfect hash function generator.
* g-pehage.ads:
Detail the use of subprograms Insert, Initialize, Compute and Finalize.
Fix some typos.
From-SVN: r138331
2008-07-30 Robert Dewar <dewar@adacore.com>
* exp_util.ads (Find_Prim_Op): Document that Program_Error is raised
if no primitive operation is found.
* exp_util.adb: (Find_Prim_Op): Add comments for previous change
From-SVN: r138329
* config/arm/arm.c (arm_compute_static_chain_stack_bytes): New
function.
(arm_compute_initial_elimination_offset): Use it.
(arm_compute_save_reg_mask): Include static chain save slot when
calculating alignment.
(arm_get_frame_offsets): Ditto.
(thumb1_compute_save_reg_mask): Ensure we have a low register saved
that we can use to decrement the stack when the stack decrement
could be too big for an immediate value in a single insn.
(thumb1_expand_prologue): Avoid using r12 for stack decrement.
From-SVN: r138327
2008-07-30 Hristian Kirtchev <kirtchev@adacore.com>
* einfo.adb: Flag245 is now used.
(Is_Primitive_Wrapper, Set_Is_Primitive_Wrapper): Relax the assertion
check to include functions.
(Is_Private_Primitive, Set_Is_Private_Primitive): New subprograms.
(Wrapped_Entity, Set_Wrapped_Entity): Relax the assertion check to
include functions.
(Write_Entity_Flags): Move flag Is_Primitive, add Is_Private_Primitive
to the list of displayed flags.
* einfo.ads: Update comment on the usage of Is_Primitive_Wrapper and
Wrapped_Entity. These two flags are now present in functions.
New flag Is_Private_Primitive.
(Is_Private_Primitive, Set_Is_Private_Primitive): New subprograms.
* exp_ch9.adb:
(Build_Wrapper_Bodies): New subprogram.
(Build_Wrapper_Body): The spec and body have been moved to in
Build_Wrapper_ Bodies. Code cleanup.
(Build_Wrapper_Spec): Moved to the spec of Exp_Ch9. Code cleanup.
Wrappers are now generated for primitives declared between the private
and full view of a concurrent type that implements an interface.
(Build_Wrapper_Specs): New subprogram.
(Expand_N_Protected_Body): Code reformatting. Replace the wrapper body
creation mechanism with a call to Build_Wrapper_Bodies.
(Expand_N_Protected_Type_Declaration): Code reformatting. Replace the
wrapper spec creation mechanism with a call to Build_Wrapper_Specs.
(Expand_N_Task_Body): Replace the wrapper body creation
mechanism with a call to Build_Wrapper_Bodies.
(Expand_N_Task_Type_Declaration): Replace the wrapper spec
creation mechanism with a call to Build_Wrapper_Specs.
(Is_Private_Primitive_Subprogram): New subprogram.
(Overriding_Possible): Code cleanup.
(Replicate_Entry_Formals): Renamed to Replicate_Formals, code cleanup.
* exp_ch9.ads (Build_Wrapper_Spec): Moved from the body of Exp_Ch9.
* sem_ch3.adb: Add with and use clause for Exp_Ch9.
(Process_Full_View): Build wrapper specs for all primitives
that belong to a private view completed by a concurrent type
implementing an interface.
* sem_ch6.adb (Analyze_Subprogram_Body): When the current subprogram
is a primitive of a
concurrent type with a private view that implements an interface, try to
find the proper spec.
(Analyze_Subprogram_Declaration): Mark a subprogram as a private
primitive if the type of its first parameter is a non-generic tagged
private type.
(Analyze_Subprogram_Specification): Code reformatting.
(Disambiguate_Spec): New routine.
(Find_Corresponding_Spec): Add a flag to controll the output of errors.
(Is_Private_Concurrent_Primitive): New routine.
* sem_ch6.ads:
(Find_Corresponding_Spec): Add a formal to control the output of errors.
From-SVN: r138324
2008-07-30 Ed Schonberg <schonberg@adacore.com>
* sem_ch8.adb (Analyze_Subprogram_Renaming): When renaming an attribute
as a actual in an instance, check for a missing attribute to prevent
program_error on an illegal program.
* exp_util.adb (Find_Prim_Op): Rather than Assert (False), raise program
error if primitive is not found, so that exception can be handled
elsewhere on illegal programs.
From-SVN: r138322
2008-07-30 Thomas Quinot <quinot@adacore.com>
* rtsfind.adb (Check_RPC): Check version consistency even when not
generating RCI stubs. Provide more detailed error message in case of
mismatch.
From-SVN: r138321
2008-07-30 Richard Guenther <rguenther@suse.de>
PR tree-optimization/36967
* tree-predcom.c (remove_stmt): Use gimple_assign_ssa_name_copy_p.
Release defs of statements we remove.
* gfortran.dg/pr36967.f: New testcase.
From-SVN: r138318
2008-07-25 Keith Seitz <keiths@redhat.com>
* acinclude.m4: Remove libide, libgui, and all the other Tcl
functions.
* tcl.m4: New file.
From-SVN: r138313
2008-07-30 Rafael Avila de Espindola <espindola@google.com>
* final.c (call_from_call_insn): New.
(final_scan_insn): Call assemble_external on FUNCTION_DECLs.
2008-07-30 Rafael Avila de Espindola <espindola@google.com>
* gcc.dg/visibility-14.c: New test.
* gcc.dg/visibility-15.c: New test.
* gcc.dg/visibility-16.c: New test.
* gcc.dg/visibility-17.c: New test.
* gcc.dg/visibility-18.c: New test.
* gcc.dg/visibility-19.c: New test.
From-SVN: r138310
2008-07-30 Dodji Seketeli <dseketel@redhat.com>
PR c++/36767
* decl2.c (fix_temporary_vars_context_r): New function.
(one_static_initialization_or_destruction): Make sure temporary
variables part of the initialiser have their DECL_CONTEXT()
properly set.
From-SVN: r138308
2008-07-30 Doug Rupp <rupp@adacore.com>
* gigi.h (build_vms_descriptor64): New function prototype.
(fill_vms_descriptor): Modified function prototype.
* utils.c (build_vms_descriptor64): New function.
* utils2.c (fill_vms_descriptor): Fix handling on 32bit systems.
* trans.c (call_to_gnu): Call fill_vms_descriptor with new third
argument.
* decl.c (gnat_to_gnu_tree): For By_Descriptor mech, build both a
64bit and 32bit descriptor and save the 64bit version as an alternate
TREE_TYPE in the parameter.
(make_type_from_size) <RECORD_TYPE>: Use the appropriate mode for the
thin pointer.
* ada-tree.h (DECL_PARM_ALT, SET_DECL_PARM_ALT): New macros.
From-SVN: r138307
* adaint.c
(__gnat_file_exists): Do not use __gnat_stat for RTX.
(__main for RTX in RTSS mode): Create this dummy procedure symbol to
avoid the use of this symbol from libgcc.a in RTX kernel mode.
* cio.c
(put_int, put_int_stderr, put_char, put_char_stderr): For RTX we call
the function RtPrintf for console output.
* argv.c Do not use the environ variable for RTX.
* gnatlink.adb (gnatlink): The part that handles the --RTS option has
been moved before the call to Osint.Add_Default_Search_Dirs in order
to take into account the flags in system.ads (RTX_RTSS_Kernel_Module)
from the appropriate run time.
* targparm.ads
(RTX_RTSS_Kernel_Module_On_Target): Add this flag that is set to True if
target is a RTSS module for RTX.
* targparm.adb (Targparm_Tags, RTX_Str, Targparm_Str): Add tag RTX for
RTX_RTSS_Kernel_Module
(Get_Target_Parameters): Add processing of RTX_RTSS_Kernel_Module flag.
* gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS for RTX): Use gcc
exception handling mechanism for Windows and RTX in Win32 mode, but
not for RTX in kernel mode (RTSS).
(LIBGNAT_SRCS): Remove ada.h
From-SVN: r138305