2013-04-12 Hristian Kirtchev <kirtchev@adacore.com>
* aspects.adb: Alphabetize subprogram bodies in this unit. Add
an entry for Aspect_Ghost in the table of canonical aspects.
(Has_Aspect): New routine.
* aspects.ads: Add Aspect_Ghost to all relevant
tables. Alphabetize subprograms in this unit.
(Has_Aspect): New routine.
* einfo.adb: Add with and use clauses for Aspects.
(Is_Ghost_Function): New routine.
* einfo.ads: Add new synthesized attribute Is_Ghost_Function and
update the structure of the related nodes.
(Is_Ghost_Function): New routine.
* exp_ch4.adb (Find_Enclosing_Context): Use routine
Is_Body_Or_Package_Declaration to terminate a search.
(Is_Body_Or_Unit): Removed.
* exp_util.adb (Within_Case_Or_If_Expression): Use routine
Is_Body_Or_Package_Declaration to terminate a search.
* par-prag.adb: Add pragma Ghost to the list of pragmas that do
not need special processing by the parser.
* sem_attr.adb (Analyze_Access_Attribute): Detect an
illegal use of 'Access where the prefix is a ghost function.
(Analyze_Attribute): Use routine Is_Body_Or_Package_Declaration
to terminate a search. (Check_References_In_Prefix): Use routine
Is_Body_Or_Package_Declaration to terminate a search.
* sem_ch4.adb (Analyze_Call): Mark a function when it appears
inside an assertion expression. Verify the legality of a call
to a ghost function.
(Check_Ghost_Function_Call): New routine.
* sem_ch6.adb (Analyze_Function_Call): Code reformatting. Move
the setting of attribute In_Assertion_Expression to Analyze_Call.
(Check_Overriding_Indicator): Detect an illegal attempt to
override a function with a ghost function.
* sem_ch12.adb (Preanalyze_Actuals): Detect an illegal use of
a ghost function as a generic actual.
* sem_elab.adb (Check_Internal_Call_Continue): Update the call
to In_Assertion.
* sem_prag.adb: Add an entry for pragma Ghost in the table
of significant arguments.
(Analyze_Pragma): Do not analyze
an "others" case guard. Add processing for pragma Ghost. Use
Preanalyze_Assert_Expression when analyzing the expression of
pragmas Loop_Invariant and Loop_Variant.
* sem_util.adb (Get_Subprogram_Entity): Reimplemented.
(Is_Body_Or_Package_Declaration): New routine.
* sem_util.ads: Alphabetize subprotrams in this unit.
(Is_Body_Or_Package_Declaration): New routine.
* sinfo.adb (In_Assertion): Rename to In_Assertion_Expression.
(Set_In_Assertion): Rename to Set_In_Assertion_Expression.
* sinfo.ads: Rename flag In_Assertion to In_Assertion_Expression
to better reflect its use. Update all places that mention the flag.
(In_Assertion): Rename to In_Assertion_Expression. Update
related pragma Inline. (Set_In_Assertion): Rename to
Set_In_Assertion_Expression. Update related pragma Inline.
* snames.ads-tmpl: Add new predefined name Ghost. Add new pragma
id Pragma_Ghost.
From-SVN: r197909
2013-04-12 Arnaud Charlet <charlet@adacore.com>
* sem_prag.adb (Set_Imported): Do not generate error for multiple
Import in CodePeer mode.
* s-rident.ads: Fix minor typo.
2013-04-12 Ed Schonberg <schonberg@adacore.com>
* checks.adb (Insert_Valid_Check): Do not insert validity check
in the body of the generated predicate function, to prevent
infinite recursion.
From-SVN: r197908
2013-04-12 Ed Schonberg <schonberg@adacore.com>
* s-rident.ads: Add various missing Ada 2012 restrictions:
No_Access_Parameter_Allocators, No_Coextensions,
No_Use_Of_Attribute, No_Use_Of_Pragma.
* snames.ads-tmpl: Add corresponding names.
* restrict.ads restrict.adb: Subprograms and data structures to
handle aspects No_Use_Of_Attribute and No_Use_Of_Pragma.
* sem_ch4.adb: Correct name of restrictions is
No_Standard_Allocators_After_Elaboration.
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Check
violation of restriction No_Use_Of_Attribute.
* sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
Set restrictions No_Use_Of_Pragma and No_Use_Of_Attribute.
(Analyze_Pragma): Check violation of restriction No_Use_Of_Pragma.
* sem_res.adb: Check restrictions No_Access_Parameter_Allocators
and No_Coextensions.
* bcheck.adb: Correct name of restrictions is
No_Standard_Allocators_After_Elaboration.
* gnatbind.adb: Correct name of restrictions is
No_Standard_Allocators_After_Elaboration.
From-SVN: r197907
2013-04-12 Hristian Kirtchev <kirtchev@adacore.com>
* sem_prag.adb (Analyze_Pragma, (Check_Mode_Restriction_In_Function):
Correct error message format.
2013-04-12 Robert Dewar <dewar@adacore.com>
* sem_attr.adb: Minor reformatting.
2013-04-12 Ed Schonberg <schonberg@adacore.com>
* sem_elab.adb (Within_Elaborate_All): Do not examine a context
item that has not been analyzed, because the unit may have errors,
or the context item may come from a proper unit inserted at the
point of a stub and not analyzed yet.
2013-04-12 Thomas Quinot <quinot@adacore.com>
* gnat1drv.adb, repinfo.adb, repinfo.ads (Repinfo.List_Array_Info,
List_Record_Info): Also include scalar storage order information in
output.
2013-04-12 Yannick Moy <moy@adacore.com>
* sem_ch6.adb (Process_Contract_Cases): Update code to apply to
Contract_Cases instead of Contract_Case pragma.
From-SVN: r197906
2013-04-12 Robert Dewar <dewar@adacore.com>
* a-cfdlli.ads, g-socket.adb, s-fileio.adb: Minor reformatting.
2013-04-12 Yannick Moy <moy@adacore.com>
* sem_attr.adb (Analyze_Attribute): Update analyse of
Attribute_Old and Attribute_Result so they are allowed in the
right-hand-side of an association in a Contract_Cases pragma.
* sem_prag.adb (Analyze_CTC_In_Decl_Part): Add pre-analysis of
the expressions in a Contract_Cases pragma.
From-SVN: r197905
2013-04-12 Robert Dewar <dewar@adacore.com>
* sem.ads, opt.ads: Minor comment edits.
* sem_warn.adb, sem_ch6.adb: Minor reformatting.
2013-04-12 Claire Dross <dross@adacore.com>
* a-cfdlli.adb a-cfdlli.ads (List, Not_No_Element, Iterate,
Reverse_Iterate, Query_Element, Update_Element, Read, Write): Removed,
not suitable for formal analysis.
2013-04-12 Ed Schonberg <schonberg@adacore.com>
* sem_prag.adb (Analyze_Abstract_State): Use Defining entity
to locate package entity, which may be a child unit.
2013-04-12 Thomas Quinot <quinot@adacore.com>
* g-socket.adb, g-socket.ads (Connect_Socket, version with timeout): If
the specified timeout is 0, do not attempt to determine whether the
connection succeeded.
2013-04-12 Doug Rupp <rupp@adacore.com>
* s-fileio.adb (Form_RMS Context_Key): Fix some thinkos.
From-SVN: r197904
2013-04-12 Doug Rupp <rupp@adacore.com>
* s-fileio.adb: Minor reformatting.
2013-04-12 Ed Schonberg <schonberg@adacore.com>
* sem_warn.adb (Check_Infinite_Loop_Warning): Do not warn if
the last statement in the analyzed loop is an unconditional
exit statement.
From-SVN: r197903
2013-04-12 Robert Dewar <dewar@adacore.com>
* opt.ads (Style_Check_Main): New switch.
* sem.adb (Semantics): Set Style_Check flag properly for new
unit to be analyzed.
* sem_ch10.adb (Analyze_With_Clause): Don't reset Style_Check,
the proper setting of this flag is now part of the Semantics
procedure.
* switch-c.adb (Scan_Front_End_Switches): Set Style_Check_Main
for -gnatg and -gnaty
2013-04-12 Doug Rupp <rupp@adacore.com>
* s-crtl.ads (fopen, freopen): Add vms_form parameter
* i-cstrea.ads (fopen, freopen): Likewise.
* adaint.h (__gnat_fopen, __gnat_freopen): Likewise.
* adaint.c (__gnat_fopen, __gnat_freopen): Likewise.
[VMS]: Split out RMS keys and call CRTL function appropriately.
* s-fileio.adb (Form_VMS_RMS_Keys, Form_RMS_Context_Key): New
subprograms.
(Open, Reset): Call Form_VMS_RMS_Keys. Call fopen,freopen with
vms_form
* gnat_rm.texi: Document implemented RMS keys.
From-SVN: r197902
2013-04-12 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch13.adb (Analyze_Aspect_Specifications):
Insert the corresponding pragma for aspect Abstract_State at
the top of the visible declarations of the related package.
Previously this was only done when the package is a compilation
unit.
2013-04-12 Arnaud Charlet <charlet@adacore.com>
* gnat_ugn.texi: Further menu clean ups.
* sem_prag.adb, opt.ads: Minor reformatting.
* sem_util.ads: Minor comment fix.
From-SVN: r197901
2013-04-12 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch13.adb (Analyze_Aspect_Specifications): Aspect
Depends is now a delayed aspect. The delay is required
due to the interplay between aspects Depends and Global.
(Check_Aspect_At_Freeze_Point): Add an entry for aspect Depends.
* sem_prag.adb: Reformat various error messages.
(Add_Item): New subsidiary routine.
(Analyze_Pragma): Add new variables
Global_Seen, Result_Seen, Subp_Inputs and Subp_Outputs. The
analysis of pragma Depends now has the capability to check
the proper mode and usage of subprogram inputs and outputs.
(Appears_In): New routine.
(Check_Function_Return): New routine.
(Check_Mode): New routine.
(Check_Usage): New routine.
(Collect_Subprogram_Inputs_Outputs): New routine.
From-SVN: r197900
2013-04-12 Bob Duff <duff@adacore.com>
* par-ch7.adb (P_Package): Initialize Sloc in the newly-pushed scope
stack entry.
2013-04-12 Robert Dewar <dewar@adacore.com>
* switch-c.adb: Minor fix to wording of error message for
-gnatet/eT.
2013-04-12 Robert Dewar <dewar@adacore.com>
* impunit.adb: Add s-multip and s-mudido to list of impl defined
system units.
* gnat_rm.texi: Add documentation for
System.Multiprocessors[.Dispatching_Domains].
2013-04-12 Ben Brosgol <brosgol@adacore.com>
* gnat_ugn.texi: Completion of menu cleanups.
2013-04-12 Arnaud Charlet <charlet@adacore.com>
* sem_prag.adb (Diagnose_Multiple_Pragmas): Relax the rules
in Relaxed_RM_Semantics.
2013-04-12 Arnaud Charlet <charlet@adacore.com>
* set_targ.adb (elab code): Add support for non gcc back-ends
where save_argv is null.
From-SVN: r197899
2013-04-12 Robert Dewar <dewar@adacore.com>
* gnat1drv.adb (Gnat1drv): Test Target_Dependent_Info_Write_Name.
* opt.ads (Target_Dependent_Info_Read): Add _Name, now an access
type (Target_Dependent_Info_Write): Add _Name, now an access type.
* set_targ.adb (Write_Target_Dependent_Values): Use name
from -gnatet switch stored in Target_Dependent_Info_Write_Name
(Read_Target_Dependent_Values): Use name from -gnateT switch
stored in Target_Dependent_Info_Read_Name.
* switch-c.adb: New form of -gnatet and -gnateT switches.
* usage.adb: New form of -gnatet and -gnateT switches with
file name.
From-SVN: r197898
PR tree-optimization/56918
PR tree-optimization/56920
* fold-const.c (int_const_binop_1): Use op1.mul_with_sign (op2, ...)
instead of op1 - op2. Pass 2 * TYPE_PRECISION (type) as second
argument to rshift method. For 2 * HOST_BITS_PER_WIDE_INT precision
use wide_mul_with_sign method.
* gcc.dg/vect/pr56918.c: New test.
* gcc.dg/vect/pr56920.c: New test.
From-SVN: r197846
2013-04-12 Richard Biener <rguenther@suse.de>
* gimple.c (is_gimple_constant): Vector CONSTRUCTORs should
not be considered a gimple constant.
From-SVN: r197845
2013-04-12 Marc Glisse <marc.glisse@inria.fr>
gcc/
* fold-const.c (const_binop): Handle vector shifts by a scalar.
(fold_binary_loc): Call const_binop also for mixed vector-scalar
operations.
gcc/testsuite/
* gcc.dg/fold-cstvecshift.c: New testcase.
From-SVN: r197843
* stor-layout.c (skip_simple_constant_arithmetic): Move to...
* tree.c (skip_simple_constant_arithmetic): ...here and make public.
(skip_simple_arithmetic): Tidy up.
* tree.h (skip_simple_constant_arithmetic): Declare.
ada/
* gcc-interface/decl.c (elaborate_expression_1): Skip only constant
arithmetics when looking for a read-only variable in the expression.
From-SVN: r197815
* pt.c (tsubst_copy) [VAR_DECL]: Don't call tsubst for
local variables, look them up instead.
(tsubst_decl) [VAR_DECL]: Remove handling for anonymous union
proxies and substitution in unevaluated context.
(tsubst_expr) [OMP_FOR]: Instantiate OMP_FOR_PRE_BODY
before the iterators.
From-SVN: r197811
2013-04-11 Javier Miranda <miranda@adacore.com>
* check.ads, exp_ch6.adb (Install_Null_Excluding_Check): No check in
interface thunks since it is performed at the caller side.
(Expand_Simple_Function_Return): No accessibility check needed in thunks
since the check is done by the target routine.
From-SVN: r197810
* config/arm/linux-atomic.c (SUBWORD_SYNC_OP, SUBWORD_VAL_CAS)
(SUBWORD_TEST_AND_SET): Use signed char/short types instead of
unsigned char/unsigned short.
(__sync_val_compare_and_swap_{1,2}): Handle signed argument.
From-SVN: r197806
2013-04-11 Ed Schonberg <schonberg@adacore.com>
* sem_prag.adb (Analyze_Pragma, case Priority): pre-analyze
expression with type Any_Priority.
* exp_ch9.adb (Initialize_Protection): Check that the value
of the priority expression is within the bounds of the proper
priority type.
From-SVN: r197799
2013-04-11 Pascal Obry <obry@adacore.com>
* gnat_ugn.texi: Remove obsolete comment about DLL calling
convention.
2013-04-11 Javier Miranda <miranda@adacore.com>
* exp_ch6.adb (Expand_Call): For the call to the target primitive
of an interface thunks do not compute the extra actuals; just
propagate the extra actuals received by the thunk.
* exp_disp.adb (Expand_Interface_Thunk): Decorate new attribute
Thunk_Entity.
* sem_ch6.adb (Create_Extra_Formals): Do not generate extra
formals in interface thunks whose target primitive has no extra
formals.
2013-04-11 Hristian Kirtchev <kirtchev@adacore.com>
* sem_prag.adb (Analyze_Pragma): Detect
a renaming by looking at the Renamed_Object attribute.
(Is_Renaming): Removed.
2013-04-11 Vincent Celier <celier@adacore.com>
* prj-env.adb (Initialize_Default_Project_Path): Take
into account a project path file, specified by environment
variable GPR_PROJECT_PATH_FILE, before taking into account
GPR_PROJECT_PATH.
* projects.texi: Add documentation for GPR_PROJECT_PATH_FILE
2013-04-11 Ed Schonberg <schonberg@adacore.com>
* a-cdlili.adb, a-cdlili.ads, a-cihama.adb, a-cihama.ads, a-coinve.adb,
a-coinve.ads, a-ciorse.adb, a-ciorse.ads, a-coorma.adb, a-coorma.ads,
a-cfdlli.adb, a-cfdlli.ads, a-cborma.adb, a-cborma.ads, a-cidlli.adb,
a-cidlli.ads, a-ciormu.adb, a-ciormu.ads, a-cihase.adb, a-cihase.ads,
a-cohama.adb, a-cohama.ads, a-coorse.adb, a-coorse.ads, a-cbhama.adb,
a-cbhama.ads, a-cborse.adb, a-cborse.ads, a-ciorma.adb, a-cobove.adb,
a-ciorma.ads, a-cobove.ads, a-coormu.adb, a-coormu.ads, a-cohase.adb,
a-cohase.ads, a-cbdlli.adb, a-cbdlli.ads, a-cbhase.adb, a-cbhase.ads:
Move Iterator operations from body to private part of spec.
From-SVN: r197797
2013-04-11 Eric Botcazou <ebotcazou@adacore.com>
* ttypes.ads, get_targ.ads: More minor rewording of comments.
2013-04-11 Johannes Kanig <kanig@adacore.com>
* debug.adb: Document use of switch -gnatd.Z.
2013-04-11 Hristian Kirtchev <kirtchev@adacore.com>
* sem_prag.adb (Analyze_Pragma): Both pragma Depends and Global can now
support renamings of entire objects. Legal renamings are replaced by
the object they rename.
(Is_Renaming): New routine.
2013-04-11 Yannick Moy <moy@adacore.com>
* set_targ.adb, opt.ads: Minor changes in comments.
From-SVN: r197795
2013-04-11 Ben Brosgol <brosgol@adacore.com>
* gnat_ugn.texi: Minor clean ups.
2013-04-11 Robert Dewar <dewar@adacore.com>
* nlists.ads, nlists.adb, treepr.adb, treepr.ads: Move debugging
function p from Nlists to Treepr.
2013-04-11 Ed Schonberg <schonberg@adacore.com>
* sem_disp.adb (Check_Dispatching_Context): If the context is
a contract for a null procedure defer error reporting until
postcondition body is created.
* exp_ch13.adb (Expand_N_Freeze_Entity): If the entity is a
null procedure, complete the analysis of its contracts so that
calls within classwide conditions are properly rewritten as
dispatching calls.
From-SVN: r197794
2013-04-11 Robert Dewar <dewar@adacore.com>
* exp_attr.adb, sem_res.adb, sem_attr.adb: Minor reformatting.
2013-04-11 Robert Dewar <dewar@adacore.com>
* atree.adb, atree.ads (Node31): New function.
(Set_Node31): New procedure.
2013-04-11 Robert Dewar <dewar@adacore.com>
* errout.ads: Minor typo correction.
2013-04-11 Javier Miranda <miranda@adacore.com>
* einfo.ad[sb] (Thunk_Entity/Set_Thunk_Entity): New attribute.
From-SVN: r197792
2013-04-11 Robert Dewar <dewar@adacore.com>
* back_end.adb (Register_Back_End_Types): Moved to Get_Targ
* back_end.ads (C_String): Moved to Get_Targ
(Register_Type_Proc): Moved to Get_Targ (Register_Back_End_Types):
Moved to Get_Targ.
* cstand.adb (Register_Float_Type): New interface
(Create_Back_End_Float_Types): Use entries in FPT_Mode_Table.
* get_targ.adb (Register_Back_End_Types): Moved here from
Back_End.
* get_targ.ads (C_String): Moved here from Back_End
(Register_Type_Proc): Moved here from Back_End
(Register_Back_End_Types): here from Back_End.
* gnat1drv.adb (GGnat11drv): Add call to
Write_Target_Dependent_Values;
* lib-writ.ads, lib-writ.adb (Write_ALI): Remove section writing
obsolete target dependent info.
* opt.ads (Generate_Target_Dependent_Info):
Removed (Target_Dependent_Info_Read): New flag
(Target_Dependent_Info_Write): New flag
* output.adb: Minor comment change
* s-os_lib.ads: Minor reformatting
* set_targ.ads, set_targ.adb: Minor reformatting.
* switch-c.adb (Scan_Switches.First_Ptr): New variable
(Scan_Front_End_Switches): Check -gnatd.b, -gnateT come first
(Scan_Front_End_Switches): Handle -gnatet, -gnateT
* ttypes.ads: Remove documentation section on target dependent
info in ali file Remove four letter codes, no longer used Instead
of using Get_Targ.Get_xxx, we use Set_Targ.xxx
* usage.adb: Add usage lines for -gnatet/-gnateT
* gcc-interface/Make-lang.in: Update dependencies.
2013-04-11 Thomas Quinot <quinot@adacore.com>
* sem_ch4.adb: Update documentation.
* sinfo.ads (N_Expression_With_Actions): Ditto.
2013-04-11 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch13.adb (Analyze_Aspect_Specifications):
Add a guard to prevent the double insertion of the same aspect
into a rep item list. This previously led to a circularity.
2013-04-11 Ed Schonberg <schonberg@adacore.com>
* sem_attr.adb (Eval_Attribute, case 'Access): Reject attribute
reference if the prefix is the dereference of an anonymous access
to subprogram type.
* exp_attr.adb (Expand_N_Attribute_Reference, Access_Cases): Handle
properly a reference to the current instance of a protected type
from within a protected subprogram.
* sem_res.adb (Find_Unique_Access_Type): Treat
Attribute_Access_Type like Allocator_Type when resolving an
equality operator.
From-SVN: r197791
2013-04-11 Arnaud Charlet <charlet@adacore.com>
* xgnatugn.adb: Remove obsolete comments.
2013-04-11 Robert Dewar <dewar@adacore.com>
* back_end.ads, back_end.adb: Minor reformatting.
* set_targ.ads, set_targ.adb: New files.
2013-04-11 Hristian Kirtchev <kirtchev@adacore.com>
* sem_case.adb (Check_Against_Predicate): New routine.
(Check_Choices): When the type covered by the list of choices
is a static subtype with a static predicate, check all choices
agains the predicate.
(Issue_Msg): All versions removed.
(Missing_Choice): New routines.
* sem_ch4.adb: Code and comment reformatting.
(Analyze_Case_Expression): Do not check the choices when the case
expression is being preanalyzed and the type of the expression
is a subtype with a static predicate.
(Has_Static_Predicate): New routine.
* sem_ch13.adb: Code and comment reformatting. (Build_Range):
Always build a range even if the low and hi bounds denote the
same value. This is needed by the machinery in Check_Choices.
(Build_Static_Predicate): Always build a range even if the low and
hi bounds denote the same value. This is needed by the machinery
in Check_Choices.
From-SVN: r197789