decl.c (gnat_to_gnu_entity): Do not consider that regular packed arrays can never be superflat.

* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Subtype>: Do not
	consider that regular packed arrays can never be superflat.

From-SVN: r210583
This commit is contained in:
Eric Botcazou 2014-05-18 17:51:15 +00:00 committed by Eric Botcazou
parent 7283246061
commit f9d7d7c14c
4 changed files with 36 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2014-05-18 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Subtype>: Do not
consider that regular packed arrays can never be superflat.
2014-05-17 Trevor Saunders <tsaunders@mozilla.com>
* gcc-interface/ada-tree.h: Remove usage of variable_size gty

View File

@ -2420,8 +2420,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
we can just use the high bound of the index type. */
else if ((Nkind (gnat_index) == N_Range
&& cannot_be_superflat_p (gnat_index))
/* Packed Array Types are never superflat. */
|| Is_Packed_Array_Type (gnat_entity))
/* Bit-Packed Array Types are never superflat. */
|| (Is_Packed_Array_Type (gnat_entity)
&& Is_Bit_Packed_Array
(Original_Array_Type (gnat_entity))))
gnu_high = gnu_max;
/* Otherwise, if the high bound is constant but the low bound is

View File

@ -1,3 +1,7 @@
2014-05-18 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/enum3.adb: New test.
2014-05-18 Andreas Schwab <schwab@suse.de>
* gcc.target/ia64/visibility-1.c (variable_l): Add used attribute.

View File

@ -0,0 +1,23 @@
-- { dg-do run }
procedure Enum3 is
type Enum is (Aaa, Bbb, Ccc);
for Enum use (1,2,4);
begin
for Lo in Enum loop
for Hi in Enum loop
declare
subtype S is Enum range Lo .. Hi;
type Vector is array (S) of Integer;
Vec : Vector;
begin
for I in S loop
Vec (I) := 0;
end loop;
if Vec /= (S => 0) then
raise Program_Error;
end if;
end;
end loop;
end loop;
end;