Commit f54ee980 by Eric Botcazou Committed by Eric Botcazou

decl.c (gnat_to_gnu_entity): Convert GNU_SIZE to units before invoking allocatable_size_p on it.

	* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Convert GNU_SIZE
	to units before invoking allocatable_size_p on it.
	Remove orphaned comment.  Do not use ssize_int.
	<E_Record_Subtype>: Traverse list in original order.  Minor tweak.
	(allocatable_size_p): Adjust and simplify.
	(build_subst_list): Use consistent terminology throughout.
	(build_variant_list): Likewise.  Traverse list in original order.
	(create_field_decl_from): Likewise.
	(copy_and_substitute_in_size): Likewise.
	(create_variant_part_from): Add comment about field list order.
	* gcc-interface/utils.c (build_vms_descriptor): Do not use ssize_int.
	* gcc-interface/utils2.c (build_allocator): Likewise.

From-SVN: r188382
parent e4270465
2012-06-11 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Convert GNU_SIZE
to units before invoking allocatable_size_p on it.
Remove orphaned comment. Do not use ssize_int.
<E_Record_Subtype>: Traverse list in original order. Minor tweak.
(allocatable_size_p): Adjust and simplify.
(build_subst_list): Use consistent terminology throughout.
(build_variant_list): Likewise. Traverse list in original order.
(create_field_decl_from): Likewise.
(copy_and_substitute_in_size): Likewise.
(create_variant_part_from): Add comment about field list order.
* gcc-interface/utils.c (build_vms_descriptor): Do not use ssize_int.
* gcc-interface/utils2.c (build_allocator): Likewise.
2012-06-11 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Identifier_to_gnu): Test Is_Elementary_Type
instead of Is_Scalar_Type for a constant with an address clause.
Do not return the underlying constant for a constant used by reference
......
......@@ -3601,7 +3601,7 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
record_type, size_int (klass), field_list);
field_list
= make_descriptor_field ("MBMO", gnat_type_for_size (32, 1),
record_type, ssize_int (-1), field_list);
record_type, size_int (-1), field_list);
field_list
= make_descriptor_field ("LENGTH", gnat_type_for_size (64, 1),
record_type,
......
......@@ -2287,7 +2287,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))
size = ssize_int (-1);
size = size_int (-1);
storage = build_call_alloc_dealloc (NULL_TREE, size, storage_type,
gnat_proc, gnat_pool, gnat_node);
......@@ -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))
size = ssize_int (-1);
size = size_int (-1);
storage = convert (result_type,
build_call_alloc_dealloc (NULL_TREE, size, type,
......
2012-06-11 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/specs/array1.ads: New test.
* gnat.dg/specs/array2.ads: Likewise.
* gnat.dg/array22.adb: Likewise.
2012-06-11 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/constant4.adb: New test.
* gnat.dg/constant4_pkg.ads: New helper.
......
-- { dg-do compile }
with System; use System;
procedure Array22 is
type Integer_Address is mod Memory_Size;
type Memory is array (Integer_Address range <>) of Character;
type Chunk (First, Last : Integer_Address) is record
Mem : Memory (First .. Last);
end record;
C : Chunk (1, 8);
for C'Alignment use 8;
pragma Unreferenced (C);
begin
null;
end;
-- { dg-do compile }
pragma Restrictions (No_Elaboration_Code);
package Array1 is
type Arr is array (Positive range <>) of Boolean;
A : Arr (1 .. 2 ** 29);
end Array1;
-- { dg-do compile }
-- { dg-options "-gnatws" }
pragma Restrictions (No_Elaboration_Code);
package Array2 is
type Arr is array (Positive range <>) of Boolean;
A : Arr (1 .. 2 ** 2);
for A'Size use 16#1000_0000_0#;
end Array2;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment