summaryrefslogtreecommitdiff
path: root/gcc/ada/checks.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-23 09:34:26 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-23 09:34:26 +0000
commit8eb4a5ebb720724ffb33a4a4092c9c422bd0eac9 (patch)
treecc91e16e1239e5e819de3651e828aab9e9648cd5 /gcc/ada/checks.adb
parent98045ff0f3003b93f5e44f2bf1b0a8477aae3de4 (diff)
downloadgcc-8eb4a5ebb720724ffb33a4a4092c9c422bd0eac9.tar.gz
2009-07-23 Robert Dewar <dewar@adacore.com>
* checks.adb (Apply_Arithmetic_Overflow_Check): Add comments cross-referencing the new related code in Exp_Ch4.Expand_N_Type_Conversion. * exp_ch4.adb (Expand_N_Type_Conversion): Avoid unnecessary overflows * exp_disp.adb, exp_disp.ads, sinfo.ads: Minor reformatting. Add comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149983 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/checks.adb')
-rw-r--r--gcc/ada/checks.adb7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index e3bf4b32287..e39e3e079a6 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -760,6 +760,13 @@ package body Checks is
-- off, since this is precisely about giving the "right" result and
-- avoiding the need for an overflow check.
+ -- Note: this circuit is partially redundant with respect to the similar
+ -- processing in Exp_Ch4.Expand_N_Type_Conversion, but the latter deals
+ -- with cases that do not come through here. We still need the following
+ -- processing even with the Exp_Ch4 code in place, since we want to be
+ -- sure not to generate the arithmetic overflow check in these cases
+ -- (Exp_Ch4 would have a hard time removing them once generated).
+
if Is_Signed_Integer_Type (Typ)
and then Nkind (Parent (N)) = N_Type_Conversion
then