public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Marc Poulhiès" <poulhies@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: Eric Botcazou <ebotcazou@adacore.com>
Subject: [COMMITTED 30/35] ada: Further adjustments coming from aliasing considerations
Date: Fri, 17 May 2024 10:32:02 +0200	[thread overview]
Message-ID: <20240517083207.130391-30-poulhies@adacore.com> (raw)
In-Reply-To: <20240517083207.130391-1-poulhies@adacore.com>

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(+)

diff --git a/gcc/ada/libgnat/g-alvevi.ads b/gcc/ada/libgnat/g-alvevi.ads
index b2beac7284c..b0f58790adf 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 1d4c82d17ab..eee19f4bdce 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 --
    ------------------------------------
-- 
2.43.2


  parent reply	other threads:[~2024-05-17  8:32 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17  8:31 [COMMITTED 01/35] ada: Add support for 'Object_Size to pragma Compile_Time_{Warning,Error} Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 02/35] ada: Small cleanup in aggregate expansion code Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 03/35] ada: Remove superfluous Relocate_Node calls Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 04/35] ada: Fix checking range constraints within composite types Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 05/35] ada: Check subtype to avoid a precondition failure Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 06/35] ada: Fix probable copy/paste error Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 07/35] ada: Tune detection of unconstrained and tagged items in Depends contract Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 08/35] ada: Allow private items with unknown discriminants as Depends inputs Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 09/35] ada: Simplify code for private types with unknown discriminants Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 10/35] ada: Only record types with discriminants can be unconstrained Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 11/35] ada: Fix Constraint_Error on mutable assignment Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 12/35] ada: Fix crash caused by missing New_Copy_tree Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 13/35] ada: Make raise-gcc.c compatible with Clang Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 14/35] ada: gnatbind-related cleanups Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 15/35] ada: correction to " Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 16/35] ada: Fix containers' Reference_Preserving_Key functions' memory leaks Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 17/35] ada: Update docs for Resolve_Null_Array_Aggregate Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 18/35] ada: gnatbind: subprogram spec no longer exists Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 19/35] ada: Couple of adjustments coming from aliasing considerations Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 20/35] ada: Expose utility routine for processing of Depends contracts in SPARK Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 21/35] ada: Fix others error message location Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 22/35] ada: Clarify code for aggregate warnings Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 23/35] ada: Disable Equivalent_Array_Aggregate optimization if predicates involved Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 24/35] ada: Do not query the modification time of a special file Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 25/35] ada: Fix for validity checking and conditional evaluation of 'Old Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 26/35] ada: Factor out duplicated code in bodies of System.Task_Primitives.Operations Marc Poulhiès
2024-05-17  8:31 ` [COMMITTED 27/35] ada: Bug in computing local restrictions inherited from enclosing scopes Marc Poulhiès
2024-05-17  8:32 ` [COMMITTED 28/35] ada: Document secondary usage of Materialize_Entity flag Marc Poulhiès
2024-05-17  8:32 ` [COMMITTED 29/35] ada: Replace spinlocks with fully-fledged locks in finalization collections Marc Poulhiès
2024-05-17  8:32 ` Marc Poulhiès [this message]
2024-05-17  8:32 ` [COMMITTED 31/35] ada: Restore dependency on System.OS_Interface in System.Task_Primitives Marc Poulhiès
2024-05-17  8:32 ` [COMMITTED 32/35] ada: Improve test for unprocessed preprocessor directives Marc Poulhiès
2024-05-17  8:32 ` [COMMITTED 33/35] ada: Start the initialization of the tasking runtime earlier Marc Poulhiès
2024-05-17  8:32 ` [COMMITTED 34/35] ada: Remove outdated workaround in aggregate expansion Marc Poulhiès
2024-05-17  8:32 ` [COMMITTED 35/35] ada: Improve deriving initial sizes for container aggregates Marc Poulhiès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240517083207.130391-30-poulhies@adacore.com \
    --to=poulhies@adacore.com \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).