aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/decl.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2008-03-31 19:14:08 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-03-31 19:14:08 +0000
commit5a864002b8608352188f6019d28ba15878e05363 (patch)
tree0f65879b64d2251911ce095698a002384eaf0bd2 /gcc/ada/decl.c
parenta12bdb97c9bb28dc996017ec826612ac61dbe846 (diff)
downloadgcc-5a864002b8608352188f6019d28ba15878e05363.zip
gcc-5a864002b8608352188f6019d28ba15878e05363.tar.gz
gcc-5a864002b8608352188f6019d28ba15878e05363.tar.bz2
decl.c (gnat_to_gnu_entity): Do not force a non-null size if it has overflowed.
* decl.c (gnat_to_gnu_entity) <object>: Do not force a non-null size if it has overflowed. From-SVN: r133768
Diffstat (limited to 'gcc/ada/decl.c')
-rw-r--r--gcc/ada/decl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index 8819874..6f92fac 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -640,8 +640,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
clause, as we would lose useful information on the view size
(e.g. for null array slices) and we are not allocating the object
here anyway. */
- if (((gnu_size && integer_zerop (gnu_size))
- || (TYPE_SIZE (gnu_type) && integer_zerop (TYPE_SIZE (gnu_type))))
+ if (((gnu_size
+ && integer_zerop (gnu_size)
+ && !TREE_OVERFLOW (gnu_size))
+ || (TYPE_SIZE (gnu_type)
+ && integer_zerop (TYPE_SIZE (gnu_type))
+ && !TREE_OVERFLOW (TYPE_SIZE (gnu_type))))
&& (!Is_Constr_Subt_For_UN_Aliased (Etype (gnat_entity))
|| !Is_Array_Type (Etype (gnat_entity)))
&& !Present (Renamed_Object (gnat_entity))