2011-09-06 Steve Baird <baird@adacore.com>
* einfo.ads (Extra_Accessibility_Of_Result): New function; in the
(Ada2012) cases described in AI05-0234 where the accessibility
level of a function result is "determined by the point of
call", an implicit parameter representing that accessibility
level is passed in. Extra_Accessibilty_Of_Result yields this
additional formal parameter. Extra_Accessibility_Of_Result
is analogous to the existing Extra_Accessibility
function used in the implementation of access parameters.
(Set_Extra_Accessibility_Of_Result): New procedure; sets
Extra_Accessibility_Of_Result attribute.
* einfo.adb (Extra_Accessibility_Of_Result): New function.
(Set_Extra_Accessibility_Of_Result): New procedure.
(Write_Field19_Name): Display Extra_Accessibilty_Of_Result attribute.
* sem_util.adb (Dynamic_Accessibility_Level): Set Etype of
an accessibility level literal to Natural; introduce a nested
function, Make_Level_Literal, to do this.
* exp_ch6.ads (Needs_Result_Accessibility_Level): New function;
determines whether a given function (or access-to-function
type) needs to have an implicitly-declared accessibility-level
parameter added to its profile.
(Add_Extra_Actual_To_Call): Export an existing procedure which was
previously declared in the body of Exp_Ch6.
* exp_ch6.adb (Add_Extra_Actual_To_Call): Export declaration by moving
it to exp_ch6.ads.
(Has_Unconstrained_Access_Discriminants): New Function; a
predicate on subtype entities which returns True if the given
subtype is unconstrained and has one or more access discriminants.
(Expand_Call): When expanding a call to a function which takes an
Extra_Accessibility_Of_Result parameter, pass in the appropriate
actual parameter value. In the case of a function call which is
used to initialize an allocator, this may not be possible because
the Etype of the allocator may not have been set yet. In this
case, we defer passing in the parameter and handle it later in
Expand_Allocator_Expression.
(Expand_Simple_Function_Return): When returning from a function which
returns an unconstrained subtype having at least one access
discriminant, generate the accessibility check needed to ensure that
the function result will not outlive any objects designated by its
discriminants.
(Needs_Result_Accessibility_Level): New function; see exp_ch6.ads
description.
* exp_ch4.adb (Expand_Allocator_Expression): When a function call
is used to initialize an allocator, we may need to pass in "the
accessibility level determined by the point of call" (AI05-0234)
to the function. Expand_Call, where such actual parameters are
usually generated, is too early in this case because the Etype of
the allocator (which is used in determining the level to be passed
in) may not have been set yet when Expand_Call executes. Instead,
we generate code to pass in the appropriate actual parameter
in Expand_Allocator_Expression.
* sem_ch6.adb (Create_Extra_Formals): Create
the new Extra_Accessibility_Of_Result formal if
Needs_Result_Accessibility_Level returns True. This includes the
introduction of a nested procedure, Check_Against_Result_Level.
From-SVN: r178567
* config/sparc/sol2-64.h: Move ...
* config/sparc/default-64.h: ... to here. Update comment.
* config.gcc: Update Solaris sparc to use default-64.h, also
prefix this header into the list on sparc64-*-linux.
* config/sparc/linux64.h (TARGET_DEFAULT): Only override if
TARGET_64BIT_DEFAULT is defined. Remove commented out reference
to MASK_HARD_QUAD.
From-SVN: r178558
* config.host: Add driver-sparc.o and sparc/x-sparc on
native sparc*-*-linux* builds.
* config/sparc/driver-sparc.c: Correct Linux strings.
* config/sparc/linux.h: Add DRIVER_SELF_SPECS.
* config/sparc/linux64.h: Likewise.
* doc/invoke.texi: Document that Linux also supports
-mcpu=native and -mtune=native on sparc.
From-SVN: r178553
2011-09-05 Hristian Kirtchev <kirtchev@adacore.com>
* s-finmas.adb (Set_Finalize_Address): Explain the reason
for the synchronization. Move the test for null from
s-stposu.Allocate_Any_Controlled to this routine since the check
needs to be protected too.
(Set_Heterogeneous_Finalize_Address): Explain the reason for the
synchronization code.
* s-finmas.ads (Set_Heterogeneous_Finalize_Address): Add comment
explaining the context in which this routine is used.
* s-stposu.adb (Allocate_Any_Controlled): Move the test for null
to s-finmas.Set_Finalize_Address.
2011-09-05 Ed Schonberg <schonberg@adacore.com>
* einfo.ads: Document that itypes have no parent field.
2011-09-05 Robert Dewar <dewar@adacore.com>
* rtsfind.adb (Check_CRT): Check for overloaded entity
* rtsfind.ads: Document that entities to be found by rtsfind
cannot be overloaded
* s-taenca.adb, s-tasren.adb, s-tpobop.adb, s-tpoben.ads, s-tpoben.adb
(Lock_Entries_With_Status): New name for Lock_Entries with two
arguments (changed to meet rtsfind no overloading rule).
From-SVN: r178551
2011-09-05 Hristian Kirtchev <kirtchev@adacore.com>
* s-finmas.adb (Set_Finalize_Address (Address,
Finalize_Address_Ptr)): Renamed to Set_Heterogeneous_Finalize_Address.
(Set_Finalize_Address (in out Finalization_Master,
Finalize_Address_Ptr): Add synchronization code.
* s-finmas.ads (Set_Finalize_Address (Address,
Finalize_Address_Ptr)): Renamed to Set_Heterogeneous_Finalize_Address.
* s-stposu.adb (Allocate_Any_Controlled): Update the call to
Set_Finalize_Address for the heterogeneous case.
2011-09-05 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb: Undo previous change, not suitable after all.
2011-09-05 Robert Dewar <dewar@adacore.com>
* einfo.ads: Minor comment clarification.
From-SVN: r178550
2011-09-05 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch6.adb (Move_Activation_Chain): Rewritten. The routine
no longer needs to search through the entities of the return
statement scope to find the _chain.
* sem_ch5.adb: Add with and use clauses for Exp_Ch6 and Sem_Ch6.
(Analyze_Block_Statement): Add local variable
Is_BIP_Return_Statement. Add machinery to install all entities
produced by the expansion of the return object declaration.
(Install_Return_Entities): New routine.
* sem_ch6.ads, sem_ch6.adb (Install_Entity): Moved from body to spec.
2011-09-05 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Analyze_Context): Apply simple fixup if context
of subunit is incomplete.
(Analyze_Proper_Body): If parent spec is not available, do not
attempt analysis.
From-SVN: r178549
2011-09-05 Ed Schonberg <schonberg@adacore.com>
* sem_disp.adb (Find_Controlling_Arg): Add checks for
interface type conversions, that are expanded into dereferences.
2011-09-05 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch6.adb (Analyze_Subprogram_Body_Helper):
Examine the parameter and return profile of a subprogram and swap
any incomplete types coming from a limited context with their
corresponding non-limited views.
(Exchange_Limited_Views): New routine.
2011-09-05 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Prepare_Private_Subtype_Completion): Set parent
of internal entity to the subtype declaration, so that when
entities are subsequently exchanged in a package body, the tree
remains properly formatted for ASIS.
From-SVN: r178548
2011-09-05 Johannes Kanig <kanig@adacore.com>
* g-comlin.adb (Set_Usage): Additional optional argument to set help
message.
(Display_Help): display the user given help message, if available.
2011-09-05 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (OK_For_Limited_Init_In_05): The expression
is legal if the original node is an identifier that is a
parameterless function call.
From-SVN: r178547
2011-09-05 Robert Dewar <dewar@adacore.com>
* sem_ch6.adb: Minor reformatting.
2011-09-05 Matthew Gingell <gingell@adacore.com>
* s-tassta.adb (Task_Wrapper): Ensure that we don't try to write the
stack guard page on PPC Linux. This patch ensures the 64K guard page at
the bottom of the stack is not overwritten.
From-SVN: r178544
2011-09-05 Thomas Quinot <quinot@adacore.com>
* exp_intr.adb, s-tasini.adb: Minor reformatting.
2011-09-05 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Access_Definition): If an access type declaration
appears in a child unit, the scope of whatever anonymous type
may be generated is the child unit itself.
2011-09-05 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Analyze_Expression_Function): Do not set
Comes_From_Source on rewritten body.
(Analyze_Subprogram_Body_Helper): Check that the original node for
the body comes from source, when determining whether expansion
of a protected operation is needed.
From-SVN: r178543
2011-09-05 Ed Schonberg <schonberg@adacore.com>
* exp_aggr.adb (Replace_Type): If the target of the assignment is
a selected component and the right-hand side is a self-referential
access, the proper prefix of the rewritten attribute is a copy
of the left-hand side, not of its prefix.
2011-09-05 Robert Dewar <dewar@adacore.com>
* sem_ch5.adb: Minor reformatting.
* sem_ch3.adb: Minor code clean up.
2011-09-05 Jose Ruiz <ruiz@adacore.com>
* exp_ch9.adb (Make_Initialize_Protection): The fact that
restriction No_Dynamic_Attachment is in effect or not should
not influence the default priority associated to a protected
object. With this change, when the restriction is in effect (as
is the case for the Ravenscar profile) the default priority of
a protected object with an interrupt handler is in the range of
interrupt priorities (Default_Interrupt_Priority) as required
by D.3(10).
2011-09-05 Arnaud Charlet <charlet@adacore.com>
* a-iteint.ads: Fix header.
2011-09-05 Vincent Celier <celier@adacore.com>
* prj-conf.adb (Do_Autoconf): Make sure Obj_Dir always ends
with a directory separator to avoid output such as:
"/path/to/objauto.cgpr" has been deleted.
From-SVN: r178542
2011-09-05 Robert Dewar <dewar@adacore.com>
* sem_ch3.adb: Minor reformatting.
2011-09-05 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb: Better error message.
2011-09-05 Hristian Kirtchev <kirtchev@adacore.com>
* exp_aggr.adb: Add with and use clause for Exp_Ch6.
(Expand_Array_Aggregate): Detect a special case of an aggregate
which contains tasks in the context of an unexpanded return
statement of a build-in-place function.
* exp_ch6.adb: Add with and use clause for Exp_Aggr.
(Expand_N_Extended_Return_Statement): Detect a delayed aggregate
which contains tasks and expand it now that the original simple
return statement has been rewritten.
* exp_ch9.adb (Build_Activation_Chain_Entity): Code
reformatting. Do not create a chain for an extended return
statement if one is already available.
(Has_Activation_Chain): New routine.
From-SVN: r178539
2011-09-05 Marc Sango <sango@adacore.com>
* sem_ch3.adb (Analyze_Object_Declaration): Remove
the wrong test and add the correct test to detect the violation
of illegal use of unconstrained string type in SPARK mode.
2011-09-05 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb (Analyze_Iteration_Specification): Improve error
message on an iterator over an array.
2011-09-05 Robert Dewar <dewar@adacore.com>
* lib-xref-alfa.adb: Minor reformatting.
From-SVN: r178538
2011-09-05 Hristian Kirtchev <kirtchev@adacore.com>
* einfo.adb (Write_Field28_Name): Update the choices for
Extra_Formals.
* einfo.ads: Update the use of Extra_Formals in various entities.
* exp_ch6.adb (Add_Task_Actuals_To_Build_In_Place_Call): Code
reformatting. Handle the case where the function call returns
an incomplete type coming from a limited with context. Generate
a reference to the _master when the master id is associated
with an access type.
(Is_Build_In_Place_Function_Call): Code
reformatting. The Alfa mode case must appear first since otherwise
we will carry out the function name retrieval regardless of the
compilation mode.
(Make_Build_In_Place_Call_In_Allocator): Code
reformatting. Handle the case where the function call returns
an incomplete type coming from a limited with context. Remove
the reference creation when adding the task-related actuals,
this is now done in Add_Task_Actuals_To_Build_In_Place_Call.
* exp_ch7.adb (Make_Set_Finalize_Address_Call): Remove local
variable Call. Remove the useless wrapping of Set_Finalize_Address
when the finalization master is a build-in-place extra formal. The
whole mechanism of controlled allocation in a build-in-place
context is already protected by an if statement.
* sem_aux.adb (Is_Immutably_Limited_Type): Handle the case
where the type might be related to a function which returns an
incomplete type coming from a limited with.
* sem_ch6.adb (Create_Extra_Formals): Comment
reformatting. Handle the case where the function returns an
incomplete type coming from a limited with context.
2011-09-05 Johannes Kanig <kanig@adacore.com>
* lib-xref-alfa.adb (Is_Alfa_Reference): Improve test for constant
objects and rewrite case statement as /if/elsif/endif.
2011-09-05 Thomas Quinot <quinot@adacore.com>
* sem_ch3.adb, sem_ch4.adb: Minor reformatting.
From-SVN: r178537
2011-09-05 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Build_In_Place_Formal): If extra formals are not
present, create them now. Needed in case the return type was
a limited view in the function declaration.
(Make_Build_In_Place_Call_In_Allocator): If return type contains
tasks, build the activation chain for it. Pass a reference to
the Master_Id in call to Add_Task_Actuals_To_Build_In_Place call.
* exp_ch7.adb (Make_Set_Finalize_Address_Call): Clean up interface
with build_in_place calls.
* sem_ch9.adb (Analyze_Task_Type_Declaration): If partial view was
incomplete, inatialize its Corresponding_Record_Type component.
* sem_ch10.adb (Build_Chain): Initialize Private_Dependents field
of limited views.
From-SVN: r178534
2011-09-05 Johannes Kanig <kanig@adacore.com>
* lib-xref-alfa.adb (Is_Alfa_Reference): Filter constants from effect
information.
2011-09-05 Ed Schonberg <schonberg@adacore.com>
* par-ch6.adb (P_Subprogram): In Ada2012 mode, if the subprogram
appears within a package specification and the token after "IS"
is not a parenthesis, assume that this is an unparenthesized
expression function, even if the token appears in a line by
itself.
* par.adb: Clarify use of Labl field of scope stack in error
recovery.
From-SVN: r178532
2011-09-05 Bob Duff <duff@adacore.com>
* sem_res.adb (Resolve_Intrinsic_Operator): Use unchecked
conversions instead of normal type conversions in all cases where a
type conversion would be illegal. In particular, use unchecked
conversions when the operand types are private.
2011-09-05 Johannes Kanig <kanig@adacore.com>
* lib-xref-alfa.adb (Is_Alfa_Reference): Never declare effects on
objects of task type or protected type.
From-SVN: r178531
2011-09-05 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Analyze_Expression_Function): If the expression
function comes from source, indicate that so does its rewriting,
so it is compatible with any subsequent expansion of the
subprogram body (e.g. when it is a protected operation).
* sem_ch4.adb: minor reformatting
2011-09-05 Hristian Kirtchev <kirtchev@adacore.com>
* lib.adb (Check_Same_Extended_Unit): Comment rewriting. Use
Get_Source_Unit rather than Get_Code_Unit as instantiation unfolding
may lead to wrong ancestor package in the case of instantiated subunit
bodies. If a subunit is instantiated, follow the chain of instantiations
rather than the stub structure.
From-SVN: r178530
2011-09-05 Richard Guenther <rguenther@suse.de>
* stor-layout.c (layout_type): Use size_binop for array size
calculations.
c-family/
* c-common.c (complete_array_type): Use ssize_int (-1) instead
of integer_minus_one_node for empty array upper bounds.
From-SVN: r178526
* config/avr/avr.h (progmem_section): Remove Declaration.
* config/avr/avr.c (progmem_section): Make static and rename to
progmem_swtable_section.
(avr_output_addr_vec_elt): No need to switch sections.
(avr_asm_init_sections): Use output_section_asm_op as section
callback for progmem_swtable_section.
(avr_output_progmem_section_asm_op): Remove Function.
(TARGET_ASM_FUNCTION_RODATA_SECTION): New Define.
(avr_asm_function_rodata_section): New static Function.
* config/avr/elf.h (ASM_OUTPUT_BEFORE_CASE_LABEL): Output
alignment 2**1 for jump tables.
From-SVN: r178525
PR c++/49267
PR c++/49458
DR 1328
* call.c (reference_binding): Set rvaluedness_matches_p properly
for reference to function conversion ops.
(compare_ics): Adjust.
From-SVN: r178520
PR c++/50248
Core 1358
* init.c (perform_member_init): Don't diagnose missing inits here.
(emit_mem_initializers): Or here.
* method.c (process_subob_fn): Don't instantiate constexpr ctors.
* semantics.c (cx_check_missing_mem_inits): New.
(explain_invalid_constexpr_fn): Call it.
(register_constexpr_fundef): Likewise. Leave
DECL_DECLARED_CONSTEXPR_P set when the body is unsuitable.
(cxx_eval_call_expression): Adjust diagnostics.
(cxx_eval_constant_expression): Catch use of 'this' in a constructor.
From-SVN: r178518
PR tree-optimization/50208
* tree-vect-patterns.c (vect_handle_widen_mult_by_const): Add an
argument. Check that def_stmt is inside the loop.
(vect_recog_widen_mult_pattern): Update calls to
vect_handle_widen_mult_by_cons.
(vect_operation_fits_smaller_type): Check that def_stmt is
inside the loop.
Co-Authored-By: Ira Rosen <ira.rosen@linaro.org>
From-SVN: r178508
* tree-vectorizer.c (vect_print_dump_info): Print line
number when dumping to a file.
(vectorize_loops): Add new messages to dump file.
From-SVN: r178507
2011-09-03 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h (ipa_jump_func_t): New typedef.
(struct ipa_edge_args): Removed field argument_count, field
jump_functions turned into a vector.
(ipa_set_cs_argument_count): Removed.
(ipa_get_cs_argument_count): Updated to work on vectors.
(ipa_get_ith_jump_func): Likewise.
* ipa-prop.c (ipa_count_arguments): Removed.
(compute_scalar_jump_functions): Use ipa_get_ith_jump_func to access
jump functions. Update caller.
(compute_pass_through_member_ptrs): Likewise.
(compute_cst_member_ptr_arguments): Likewise.
(ipa_compute_jump_functions_for_edge): Get number of arguments from
the statement, allocate vector.
(ipa_compute_jump_functions): Do not call ipa_count_arguments.
(duplicate_ipa_jump_func_array): Removed.
(ipa_edge_duplication_hook): Use VEC_copy, do not copy argument count.
(ipa_read_node_info): Allocate vector.
From-SVN: r178502