]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Further adjustments coming from aliasing considerations
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 14 Mar 2024 11:58:29 +0000 (12:58 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 17 May 2024 08:21:06 +0000 (10:21 +0200)
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.

gcc/ada/libgnat/g-alvevi.ads
gcc/ada/libgnat/s-stratt.ads

index b2beac7284c71b82b301ddff4ffb881a930d7215..b0f58790adf8565d61f271d81c84edc17a37aa0d 100644 (file)
@@ -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;
index 1d4c82d17abd7047742c91918e9f7d329e1b855d..eee19f4bdced8e28e26f5ea0e84d3835f9e83965 100644 (file)
@@ -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 --
    ------------------------------------