summaryrefslogtreecommitdiff
path: root/gcc/ada/checks.adb
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-21 09:07:52 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-21 09:07:52 +0000
commitc376c8d3136602addba5a4e49dcc3f920999069e (patch)
tree46f42fd6a5ffbbc0708e3f6c9dbb4f490f663b39 /gcc/ada/checks.adb
parent4a5d167df1662b4f709186178aa8ab842dd87a8b (diff)
downloadgcc-c376c8d3136602addba5a4e49dcc3f920999069e.tar.gz
2011-12-21 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 182564 using svnmerge git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@182569 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/checks.adb')
-rw-r--r--gcc/ada/checks.adb9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index 5383bd8299c..059253fd903 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -2398,6 +2398,15 @@ package body Checks is
else
Apply_Scalar_Range_Check
(Expr, Target_Type, Fixed_Int => Conv_OK);
+
+ -- If the target type has predicates, we need to indicate
+ -- the need for a check, even if Determine_Range finds
+ -- that the value is within bounds. This may be the case
+ -- e.g for a division with a constant denominator.
+
+ if Has_Predicates (Target_Type) then
+ Enable_Range_Check (Expr);
+ end if;
end if;
end if;
end;