OSDN Git Service

2005-06-14 Eric Botcazou <ebotcazou@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Jun 2005 08:44:56 +0000 (08:44 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Jun 2005 08:44:56 +0000 (08:44 +0000)
* s-atacco.ads: Put a pragma No_Strict_Aliasing on Object_Pointer.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101055 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/s-atacco.ads

index 6f8bd94..7ccb339 100644 (file)
@@ -62,6 +62,13 @@ pragma Elaborate_Body;
    type Object_Pointer is access all Object;
    for Object_Pointer'Size use Standard'Address_Size;
 
+   pragma No_Strict_Aliasing (Object_Pointer);
+   --  Strictly speaking, this routine should not be used to generate pointers
+   --  to other than proper values of the proper type, but in practice, this
+   --  is done all the time. This pragma stops the compiler from doing some
+   --  optimizations that may cause unexpected results based on the assumption
+   --  of no strict aliasing.
+
    function To_Pointer (Value : Address)        return Object_Pointer;
    function To_Address (Value : Object_Pointer) return Address;