diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-04-12 15:15:12 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-04-12 15:15:12 +0200 |
commit | d515aef32662568e230d2cc772c4a7da61ca64c0 (patch) | |
tree | 242cb0f5cd55a55e84abcf05975c83e082b14ed8 | |
parent | 57f4c2887eb49f17bcd465879faaecf2f6234eae (diff) | |
download | gcc-d515aef32662568e230d2cc772c4a7da61ca64c0.zip gcc-d515aef32662568e230d2cc772c4a7da61ca64c0.tar.gz gcc-d515aef32662568e230d2cc772c4a7da61ca64c0.tar.bz2 |
[multiple changes]
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
-rw-r--r-- | gcc/ada/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/ada/checks.adb | 11 | ||||
-rw-r--r-- | gcc/ada/s-rident.ads | 2 | ||||
-rw-r--r-- | gcc/ada/sem_prag.adb | 6 |
4 files changed, 30 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index cba7cf9..e524d1c 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,15 @@ +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. + 2013-04-12 Ed Schonberg <schonberg@adacore.com> * s-rident.ads: Add various missing Ada 2012 restrictions: diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 39325af..c8d900f 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -6228,6 +6228,7 @@ package body Checks is procedure Insert_Valid_Check (Expr : Node_Id) is Loc : constant Source_Ptr := Sloc (Expr); + Typ : constant Entity_Id := Etype (Expr); Exp : Node_Id; begin @@ -6241,6 +6242,16 @@ package body Checks is return; end if; + -- Do not insert checks within a predicate function. This will arise + -- if the current unit and the predicate function are being compiled + -- with validity checks enabled. + + if Present (Predicate_Function (Typ)) + and then Current_Scope = Predicate_Function (Typ) + then + return; + end if; + -- If we have a checked conversion, then validity check applies to -- the expression inside the conversion, not the result, since if -- the expression inside is valid, then so is the conversion result. diff --git a/gcc/ada/s-rident.ads b/gcc/ada/s-rident.ads index 66a8cf4..480c5a5 100644 --- a/gcc/ada/s-rident.ads +++ b/gcc/ada/s-rident.ads @@ -65,7 +65,7 @@ -- The latest implementation avoids both this problem by using a named -- scheme for recording restrictions, rather than a positional scheme which -- fails completely if restrictions are added or subtracted. Now the worst --- that happens at bind time in incosistent builds is that unrecognized +-- that happens at bind time in inconsistent builds is that unrecognized -- restrictions are ignored, and the consistency checking for restrictions -- might be incomplete, which is no big deal. diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index ee93885..a8d3fe5 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -6246,6 +6246,12 @@ package body Sem_Prag is if Is_Exported (E) then Error_Msg_NE ("entity& was previously exported", N, E); + -- Ignore error in CodePeer mode where we treat all imported + -- subprograms as unknown. + + elsif CodePeer_Mode then + goto OK; + -- OK if Import/Interface case elsif Import_Interface_Present (N) then |