https://gcc.gnu.org/g:9ff83f013eb1ea2eac11c17cc3be2024e96101a5
commit r15-616-g9ff83f013eb1ea2eac11c17cc3be2024e96101a5 Author: Eric Botcazou <ebotca...@adacore.com> Date: Thu Mar 14 12:58:29 2024 +0100 ada: Further adjustments coming from aliasing considerations 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. Diff: --- gcc/ada/libgnat/g-alvevi.ads | 11 +++++++++++ gcc/ada/libgnat/s-stratt.ads | 3 +++ 2 files changed, 14 insertions(+) diff --git a/gcc/ada/libgnat/g-alvevi.ads b/gcc/ada/libgnat/g-alvevi.ads index b2beac7284c7..b0f58790adf8 100644 --- a/gcc/ada/libgnat/g-alvevi.ads +++ b/gcc/ada/libgnat/g-alvevi.ads @@ -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; diff --git a/gcc/ada/libgnat/s-stratt.ads b/gcc/ada/libgnat/s-stratt.ads index 1d4c82d17abd..eee19f4bdced 100644 --- a/gcc/ada/libgnat/s-stratt.ads +++ b/gcc/ada/libgnat/s-stratt.ads @@ -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 -- ------------------------------------