@@ -58,6 +58,7 @@ package GNAT.Altivec.Vector_Views is
type VUC_View is record
Values : Varray_unsigned_char;
end record;
+ pragma Universal_Aliasing (VUC_View);
type Varray_signed_char is array (Vchar_Range) of signed_char;
for Varray_signed_char'Alignment use VECTOR_ALIGNMENT;
@@ -65,6 +66,7 @@ package GNAT.Altivec.Vector_Views is
type VSC_View is record
Values : Varray_signed_char;
end record;
+ pragma Universal_Aliasing (VSC_View);
type Varray_bool_char is array (Vchar_Range) of bool_char;
for Varray_bool_char'Alignment use VECTOR_ALIGNMENT;
@@ -72,6 +74,7 @@ package GNAT.Altivec.Vector_Views is
type VBC_View is record
Values : Varray_bool_char;
end record;
+ pragma Universal_Aliasing (VBC_View);
----------------------
-- short components --
@@ -85,6 +88,7 @@ package GNAT.Altivec.Vector_Views is
type VUS_View is record
Values : Varray_unsigned_short;
end record;
+ pragma Universal_Aliasing (VUS_View);
type Varray_signed_short is array (Vshort_Range) of signed_short;
for Varray_signed_short'Alignment use VECTOR_ALIGNMENT;
@@ -92,6 +96,7 @@ package GNAT.Altivec.Vector_Views is
type VSS_View is record
Values : Varray_signed_short;
end record;
+ pragma Universal_Aliasing (VSS_View);
type Varray_bool_short is array (Vshort_Range) of bool_short;
for Varray_bool_short'Alignment use VECTOR_ALIGNMENT;
@@ -99,6 +104,7 @@ package GNAT.Altivec.Vector_Views is
type VBS_View is record
Values : Varray_bool_short;
end record;
+ pragma Universal_Aliasing (VBS_View);
--------------------
-- int components --
@@ -112,6 +118,7 @@ package GNAT.Altivec.Vector_Views is
type VUI_View is record
Values : Varray_unsigned_int;
end record;
+ pragma Universal_Aliasing (VUI_View);
type Varray_signed_int is array (Vint_Range) of signed_int;
for Varray_signed_int'Alignment use VECTOR_ALIGNMENT;
@@ -119,6 +126,7 @@ package GNAT.Altivec.Vector_Views is
type VSI_View is record
Values : Varray_signed_int;
end record;
+ pragma Universal_Aliasing (VSI_View);
type Varray_bool_int is array (Vint_Range) of bool_int;
for Varray_bool_int'Alignment use VECTOR_ALIGNMENT;
@@ -126,6 +134,7 @@ package GNAT.Altivec.Vector_Views is
type VBI_View is record
Values : Varray_bool_int;
end record;
+ pragma Universal_Aliasing (VBI_View);
----------------------
-- float components --
@@ -139,6 +148,7 @@ package GNAT.Altivec.Vector_Views is
type VF_View is record
Values : Varray_float;
end record;
+ pragma Universal_Aliasing (VF_View);
----------------------
-- pixel components --
@@ -152,5 +162,6 @@ package GNAT.Altivec.Vector_Views is
type VP_View is record
Values : Varray_pixel;
end record;
+ pragma Universal_Aliasing (VP_View);
end GNAT.Altivec.Vector_Views;
@@ -74,6 +74,9 @@ package System.Stream_Attributes is
P2 : System.Address;
end record;
+ pragma Universal_Aliasing (Fat_Pointer);
+ -- This avoids a copy for the aforementioned unchecked conversions
+
------------------------------------
-- Treatment of enumeration types --
------------------------------------
From: Eric Botcazou <ebotcazou@adacore.com> They are needed on 32-bit platforms because of different calling conventions and again in the units implementing AltiVec and Streams support. gcc/ada/ * libgnat/g-alvevi.ads: Add pragma Universal_Aliasing for all the view types. * libgnat/s-stratt.ads: Likewise for Fat_Pointer type. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/g-alvevi.ads | 11 +++++++++++ gcc/ada/libgnat/s-stratt.ads | 3 +++ 2 files changed, 14 insertions(+)