Commit f9d7d7c1 by Eric Botcazou Committed by Eric Botcazou

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
parent 72832460
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
......
......@@ -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
......
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.
......
-- { 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;
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