aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ada/ChangeLog8
-rw-r--r--gcc/ada/debug.adb8
-rw-r--r--gcc/ada/layout.adb8
-rw-r--r--gcc/ada/sem_ch3.adb21
4 files changed, 42 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 3d1113c..2065ccc 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,13 @@
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
unconstrained arrays are always thin pointers.
* sem_ch3.adb (Replace_Type): Anonymous access types designating
diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb
index eaab4ff..4e62365c 100644
--- a/gcc/ada/debug.adb
+++ b/gcc/ada/debug.adb
@@ -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 --
------------------------------------------
diff --git a/gcc/ada/layout.adb b/gcc/ada/layout.adb
index 618b0f8..7b0cdc5 100644
--- a/gcc/ada/layout.adb
+++ b/gcc/ada/layout.adb
@@ -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
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 938c28e..03e9154 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -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