aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/gcc-interface/utils2.c')
-rw-r--r--gcc/ada/gcc-interface/utils2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index 4bb16ec..71dd8e5 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -2286,7 +2286,7 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
init);
/* If the size overflows, pass -1 so Storage_Error will be raised. */
- if (TREE_CODE (size) == INTEGER_CST && TREE_OVERFLOW (size))
+ if (TREE_CODE (size) == INTEGER_CST && !valid_constant_size_p (size))
size = size_int (-1);
storage = build_call_alloc_dealloc (NULL_TREE, size, storage_type,
@@ -2345,7 +2345,7 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
}
/* If the size overflows, pass -1 so Storage_Error will be raised. */
- if (TREE_CODE (size) == INTEGER_CST && TREE_OVERFLOW (size))
+ if (TREE_CODE (size) == INTEGER_CST && !valid_constant_size_p (size))
size = size_int (-1);
storage = convert (result_type,