diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-04-23 16:52:28 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-04-23 16:52:28 +0200 |
commit | 05c064c1a58fa0500d93e6da59e4d1d119d74e94 (patch) | |
tree | c20bc4877e4a7f9f0f03664554f90471f9f253b1 /gcc/ada | |
parent | 92e776e9971b9fc4e31fd0f23352809cb3680d3a (diff) | |
download | gcc-05c064c1a58fa0500d93e6da59e4d1d119d74e94.zip gcc-05c064c1a58fa0500d93e6da59e4d1d119d74e94.tar.gz gcc-05c064c1a58fa0500d93e6da59e4d1d119d74e94.tar.bz2 |
[multiple changes]
2013-04-23 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Expand_N_Subprogram_Body): When compiling with
initialize_scalars, disable predicate checks on the generated
assignment to an out scalar parameter.
2013-04-23 Gary Dismukes <dismukes@adacore.com>
* sem_ch4.adb (Analyze_Allocator): Remove error
check for "constrained in partial view" constraints entirely.
2013-04-23 Robert Dewar <dewar@adacore.com>
* einfo.ads, sem_prag.ads: Minor reformatting.
* errout.ads: Comment update.
From-SVN: r198194
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/ada/einfo.ads | 2 | ||||
-rw-r--r-- | gcc/ada/errout.ads | 24 | ||||
-rw-r--r-- | gcc/ada/exp_ch6.adb | 12 | ||||
-rw-r--r-- | gcc/ada/sem_ch4.adb | 11 | ||||
-rw-r--r-- | gcc/ada/sem_prag.ads | 4 |
6 files changed, 40 insertions, 29 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index c563eb2..83cb681 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,19 @@ +2013-04-23 Ed Schonberg <schonberg@adacore.com> + + * exp_ch6.adb (Expand_N_Subprogram_Body): When compiling with + initialize_scalars, disable predicate checks on the generated + assignment to an out scalar parameter. + +2013-04-23 Gary Dismukes <dismukes@adacore.com> + + * sem_ch4.adb (Analyze_Allocator): Remove error + check for "constrained in partial view" constraints entirely. + +2013-04-23 Robert Dewar <dewar@adacore.com> + + * einfo.ads, sem_prag.ads: Minor reformatting. + * errout.ads: Comment update. + 2013-04-23 Yannick Moy <moy@adacore.com> * exp_ch5.adb: Minor typo. diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index f3be43d..8d7981b 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -1429,7 +1429,7 @@ package Einfo is -- type has no discriminants and the full view has discriminants with -- defaults. In Ada 2005 heap-allocated objects of such types are not -- constrained, and can change their discriminants with full assignment. - +-- -- Ada 2012 has an additional rule (3.3. (23/10.3)) concerning objects -- declared in a generic package body. Objects whose type is an untagged -- generic formal private type are considered to have a constrained diff --git a/gcc/ada/errout.ads b/gcc/ada/errout.ads index f53c3e0..ef8977f 100644 --- a/gcc/ada/errout.ads +++ b/gcc/ada/errout.ads @@ -280,24 +280,27 @@ package Errout is -- which is being continued. It is allowable to put ? in continuation -- messages, and the usual style is to include it, since it makes it -- clear that the continuation is part of a warning message. + -- + -- Note: this usage is obsolete, use ??, ?x? or ?X? instead to specify + -- the string to be added when Warn_Doc_Switch is set to True. If this + -- switch is True, then for simple ? messages it has no effect. This + -- simple form is to ease transition and will be removed later. - -- Insertion character ?? (two question marks) + -- Insertion character ?? (Two question marks: default warning) -- Like ?, but if the flag Warn_Doc_Switch is True, adds the string - -- "[enabled by default]" at the end of the warning message. In the - -- case of continuations, use this in each continuation message. + -- "[enabled by default]" at the end of the warning message. For + -- continuations, use this in each continuation message. -- Insertion character ?x? (warning with switch) -- Like ?, but if the flag Warn_Doc_Switch is True, adds the string -- "[-gnatwx]" at the end of the warning message. x is a lower case - -- letter. In the case of continuations, use this on each continuation - -- message. + -- letter. For continuations, use this on each continuation message. -- Insertion character ?X? (warning with dot switch) -- Like ?, but if the flag Warn_Doc_Switch is True, adds the string -- "[-gnatw.x]" at the end of the warning message. X is an upper case - -- letter corresponding to the lower case letter x in the message. In - -- the case of continuations, use this on each continuation - -- message. + -- letter corresponding to the lower case letter x in the message. + -- For continuations, use this on each continuation message. -- Insertion character < (Less Than: conditional warning message) -- The character < appearing anywhere in a message is used for a @@ -321,9 +324,8 @@ package Errout is -- Insertion character ' (Quote: literal character) -- Precedes a character which is placed literally into the message. -- Used to insert characters into messages that are one of the - -- insertion characters defined here. Also useful in inserting - -- sequences of upper case letters which are not to be treated as - -- keywords. + -- insertion characters defined here. Also used when insertion + -- upper case letter sequences not to be treated as keywords. -- Insertion character \ (Backslash: continuation message) -- Indicates that the message is a continuation of a message diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index c98affb..b097779 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -6550,6 +6550,7 @@ package body Exp_Ch6 is if Init_Or_Norm_Scalars and then Is_Subprogram (Spec_Id) then declare F : Entity_Id; + A : Node_Id; begin -- Loop through formals @@ -6564,12 +6565,15 @@ package body Exp_Ch6 is -- Insert the initialization. We turn off validity checks -- for this assignment, since we do not want any check on -- the initial value itself (which may well be invalid). + -- Predicate checks are disabled as well (RM 6.4.1 (13/3)) - Insert_Before_And_Analyze (First (L), - Make_Assignment_Statement (Loc, + A := Make_Assignment_Statement (Loc, Name => New_Occurrence_Of (F, Loc), - Expression => Get_Simple_Init_Val (Etype (F), N)), - Suppress => Validity_Check); + Expression => Get_Simple_Init_Val (Etype (F), N)); + Set_Suppress_Assignment_Checks (A); + + Insert_Before_And_Analyze (First (L), + A, Suppress => Validity_Check); end if; Next_Formal (F); diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index af5da0a..abdbf15 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -574,17 +574,6 @@ package body Sem_Ch4 is Rewrite (E, New_Copy_Tree (Subtype_Mark (E))); Analyze_Allocator (N); return; - - -- Ada 2005, AI-363: if the designated type has a constrained - -- partial view, it cannot receive a discriminant constraint, - -- and the allocated object is unconstrained. - - elsif Ada_Version >= Ada_2005 - and then Has_Constrained_Partial_View (Base_Typ) - then - Error_Msg_N - ("constraint not allowed when type " & - "has a constrained partial view", Constraint (E)); end if; if Expander_Active then diff --git a/gcc/ada/sem_prag.ads b/gcc/ada/sem_prag.ads index 54ddc43..7c370b8 100644 --- a/gcc/ada/sem_prag.ads +++ b/gcc/ada/sem_prag.ads @@ -107,9 +107,9 @@ package Sem_Prag is function Effective_Name (N : Node_Id) return Name_Id; -- N is a pragma node or aspect specification node. This function returns -- the name of the pragma or aspect, taking into account possible rewrites, - -- and also cases where a pragma comes from an attribute (in such cases, + -- and also cases where a pragma comes from an aspect (in such cases, -- the name can be different from the pragma name, e.g. Pre generates - -- a Precondition pragma. This also deals with the presence of 'Class + -- a Precondition pragma). This also deals with the presence of 'Class -- which results in one of the special names Name_uPre, Name_uPost, -- Name_uInvariant, or Name_uType_Invariant being returned to represent -- the corresponding aspects with x'Class names. |