]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
debug.adb: Document debug flag -gnatd.1.
authorRobert Dewar <dewar@adacore.com>
Fri, 13 Jun 2014 10:04:27 +0000 (10:04 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 13 Jun 2014 10:04:27 +0000 (12:04 +0200)
2014-06-13  Robert Dewar  <dewar@adacore.com>

* debug.adb: Document debug flag -gnatd.1.
* layout.adb (Layout_Type): Size change for anonymous access
types under -gnatd.1.
* sem_ch3.adb (Replace_Type): Size change for anonymous access
types under -gnatd.1.

From-SVN: r211619

gcc/ada/ChangeLog
gcc/ada/debug.adb
gcc/ada/layout.adb
gcc/ada/sem_ch3.adb

index 3d1113cfe20f71b68da25b373eba6387f3ee1d04..2065ccce8a24b624c496bd2dccdbe0a67c15ef46 100644 (file)
@@ -1,3 +1,11 @@
+2014-06-13  Robert Dewar  <dewar@adacore.com>
+
+       * debug.adb: Document debug flag -gnatd.1.
+       * layout.adb (Layout_Type): Size change for anonymous access
+       types under -gnatd.1.
+       * sem_ch3.adb (Replace_Type): Size change for anonymous access
+       types under -gnatd.1.
+
 2014-06-13  Robert Dewar  <dewar@adacore.com>
 
        * layout.adb (Layout_Type): Anonymous access types designating
index eaab4ffbebebd4eb05b8de213493739393d1dc4e..4e62365c591c7542fc8e7698b194c1569cf7b0de 100644 (file)
@@ -155,7 +155,7 @@ package body Debug is
    --  d8   Force opposite endianness in packed stuff
    --  d9   Allow lock free implementation
 
-   --  d.1
+   --  d.1  Disable fix to make anonymous access types thin
    --  d.2
    --  d.3
    --  d.4
@@ -733,6 +733,12 @@ package body Debug is
    --  d9   This allows lock free implementation for protected objects
    --       (see Exp_Ch9).
 
+   --  d.1  There is a problem with making anonymous access types which refer
+   --       to an unconstrained array thick. And we have a fix, which is to
+   --       make them thin always. Search for Debug_Flag_Dot_1 in layout.adb
+   --       and sem_ch3.adb to see the explanation for why we don't enable this
+   --       fix for now unless this debug flag is set.
+
    ------------------------------------------
    -- Documentation for Binder Debug Flags --
    ------------------------------------------
index 618b0f8d78f648a3ecf48cdd001a237e639b17cc..7b0cdc5383ee7df4652c325d23af24d96ffd0775 100644 (file)
@@ -2466,7 +2466,13 @@ package body Layout is
          --  into strange conformance problems between two types, one of which
          --  can see that something is unconstrained and one of which cannot.
 
-         elsif Ekind (E) = E_Anonymous_Access_Type then
+         elsif Ekind (E) = E_Anonymous_Access_Type
+
+           --  For now eneable this only if debug flag -gnatd.1 is set, since
+           --  we have some regressions in gnatcoll that need sorting out???
+
+           and then Debug_Flag_Dot_1
+         then
             Init_Size (E, System_Address_Size);
 
          --  For other access types, we use either address size, or, if a fat
index 938c28ea6b1185de93681e6578574668005f1fdf..03e91543c281b4a2249206bedb64b0f6b0a1d9ac 100644 (file)
@@ -13576,7 +13576,26 @@ package body Sem_Ch3 is
                   --  case we can't see it yet (full type declaration not seen
                   --  yet), so we default to thin in that case anyway.
 
-                  Init_Size (Acc_Type, System_Address_Size);
+                  --  For now, for the access to unconstrained array scase, we
+                  --  are making the above change only if debug flag -gnatd.1
+                  --  is set. That's because the change, though almost
+                  --  certainly correct, is causing gnatcoll regressions
+                  --  which we have to sort out ???
+
+                  if Is_Array_Type (Desig_Typ)
+                    and then not Is_Constrained (Desig_Typ)
+                    and then not Debug_Flag_Dot_1
+                  then
+                     Init_Size (Acc_Type, 2 * System_Address_Size);
+
+                  --  Normal case. This is what we intend to do always when we
+                  --  finally install the change discussed above. In the case
+                  --  of access to unconstrained array, then we take this path
+                  --  for now only if -gnatd.1 debug flag is set.
+
+                  else
+                     Init_Size (Acc_Type, System_Address_Size);
+                  end if;
 
                   --  Set remaining characterstics of anonymous access type