summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/decl.c8
2 files changed, 12 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index d10a213bb81..f5b9df21c6d 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,10 @@
+2008-03-31 Eric Botcazou <ebotcazou@adacore.com>
+
+ * decl.c (gnat_to_gnu_entity) <object>: Do not force a non-null
+ size if it has overflowed.
+
2008-03-31 Olivier Hainque <hainque@adacore.com>
- Eric Botcazou <botcazou@adacore.com>
+ Eric Botcazou <ebotcazou@adacore.com>
* utils2.c (find_common_type): Document assumption on t1/t2 vs
lhs/rhs. Force use of lhs type if smaller, whatever the modes.
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index 88198745fa8..6f92fac5428 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))