aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/checks.ads
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-10-02 10:04:47 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2012-10-02 10:04:47 +0200
commitc7e152b57d8f22c33077340f5684d8098062bdff (patch)
treeff87aebf201b633f8c9217e599e37bf01db0773c /gcc/ada/checks.ads
parent0c609a21446d5ff209003d898a11878b343ca6db (diff)
downloadgcc-c7e152b57d8f22c33077340f5684d8098062bdff.zip
gcc-c7e152b57d8f22c33077340f5684d8098062bdff.tar.gz
gcc-c7e152b57d8f22c33077340f5684d8098062bdff.tar.bz2
[multiple changes]
2012-10-02 Robert Dewar <dewar@adacore.com> * sem_dim.adb: Minor code reorganization. * sem_dim.ads: Add comment. 2012-10-02 Robert Dewar <dewar@adacore.com> * checks.ads, exp_ch4.adb, checks.adb (Minimize_Eliminate_Overflow_Checks): Add Top_Level parameter to avoid unnecessary conversions to Bignum. Minor reformatting. 2012-10-02 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Process_PPCs): Generate invariant checks for a return value whose type is an access type and whose designated type has invariants. Ditto for in-out parameters and in-parameters of an access type. * exp_ch3.adb (Build_Component_Invariant_Call): Add invariant check for an access component whose designated type has invariants. From-SVN: r191956
Diffstat (limited to 'gcc/ada/checks.ads')
-rw-r--r--gcc/ada/checks.ads17
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/ada/checks.ads b/gcc/ada/checks.ads
index 9fd8034..583d558 100644
--- a/gcc/ada/checks.ads
+++ b/gcc/ada/checks.ads
@@ -260,9 +260,10 @@ package Checks is
-- parameter is used to supply Sloc values for the constructed tree.
procedure Minimize_Eliminate_Overflow_Checks
- (N : Node_Id;
- Lo : out Uint;
- Hi : out Uint);
+ (N : Node_Id;
+ Lo : out Uint;
+ Hi : out Uint;
+ Top_Level : Boolean);
-- This is the main routine for handling MINIMIZED and ELIMINATED overflow
-- checks. On entry N is a node whose result is a signed integer subtype.
-- If the node is an artihmetic operation, then a range analysis is carried
@@ -321,6 +322,16 @@ package Checks is
--
-- Note that if Bignum values appear, the caller must take care of doing
-- the appropriate mark/release operation on the secondary stack.
+ --
+ -- Top_Level is used to avoid inefficient unnecessary transitions into the
+ -- Bignum domain. If Top_Level is True, it means that the caller will have
+ -- to convert any Bignum value back to Long_Long_Integer, checking that the
+ -- value is in range. This is the normal case for a top level operator in
+ -- a subexpression. There is no point in going into Bignum mode to avoid an
+ -- overflow just so we can check for overflow the next moment. For calls
+ -- from comparisons and membership tests, and for all recursive calls, we
+ -- do want to transition into the Bignum domain if necessary. Note that
+ -- this setting is only relevant in ELIMINATED mode.
-------------------------------------------------------
-- Control and Optimization of Range/Overflow Checks --