summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-09 08:11:29 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-09 08:11:29 +0000
commitb23a8f1efb0662c44510c59229d658005b7638ff (patch)
treea5941150675febb03670bb47db59a660d40430f6 /gcc/ada/sem_res.adb
parent984ff9c079d345fc01c4c7abab82423a616fd3f4 (diff)
downloadgcc-b23a8f1efb0662c44510c59229d658005b7638ff.tar.gz
2008-06-09 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r136577 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@136579 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb16
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 80010871910..a6d42f73637 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -56,6 +56,7 @@ with Sem_Cat; use Sem_Cat;
with Sem_Ch4; use Sem_Ch4;
with Sem_Ch6; use Sem_Ch6;
with Sem_Ch8; use Sem_Ch8;
+with Sem_Ch13; use Sem_Ch13;
with Sem_Disp; use Sem_Disp;
with Sem_Dist; use Sem_Dist;
with Sem_Elab; use Sem_Elab;
@@ -471,12 +472,15 @@ package body Sem_Res is
function Large_Storage_Type (T : Entity_Id) return Boolean is
begin
- return
- T = Standard_Integer
- or else
- T = Standard_Positive
- or else
- T = Standard_Natural;
+ -- The type is considered large if its bounds are known at
+ -- compile time and if it requires at least as many bits as
+ -- a Positive to store the possible values.
+
+ return Compile_Time_Known_Value (Type_Low_Bound (T))
+ and then Compile_Time_Known_Value (Type_High_Bound (T))
+ and then
+ Minimum_Size (T, Biased => True) >=
+ Esize (Standard_Integer) - 1;
end Large_Storage_Type;
begin