diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-06 12:15:32 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-06 12:15:32 +0100 |
commit | 229fa5dbde6e8a58c8409712a9e09d76793677c0 (patch) | |
tree | c10c62f1ebe2c54e1c08fd4a75865af8efa675cf /gcc/ada/checks.adb | |
parent | d9c59db4554b9fe827e2f262eafdd789b686a944 (diff) | |
download | gcc-229fa5dbde6e8a58c8409712a9e09d76793677c0.zip gcc-229fa5dbde6e8a58c8409712a9e09d76793677c0.tar.gz gcc-229fa5dbde6e8a58c8409712a9e09d76793677c0.tar.bz2 |
[multiple changes]
2017-01-06 Ed Schonberg <schonberg@adacore.com>
* checks.adb (Ensure_Valid): Do not generate a validity check
within a generated predicate function, validity checks will have
been applied earlier when required.
2017-01-06 Tristan Gingold <gingold@adacore.com>
* s-tpoben.ads (Protection_Entries): Add comment and reorder
components for performances.
* s-tpobop.adb (PO_Do_Or_Queue): Implement Max_Queue_Length runtime
semantic.
From-SVN: r244136
Diffstat (limited to 'gcc/ada/checks.adb')
-rw-r--r-- | gcc/ada/checks.adb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index efb3684..61e1ad4 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -5709,6 +5709,14 @@ package body Checks is elsif Expr_Known_Valid (Expr) then return; + -- No check needed within a generated predicate function. Validity + -- of input value will have been checked earlier. + + elsif Ekind (Current_Scope) = E_Function + and then Is_Predicate_Function (Current_Scope) + then + return; + -- Ignore case of enumeration with holes where the flag is set not to -- worry about holes, since no special validity check is needed |