From 19634e40b7f905c8bb5ff7f1095829b91b718532 Mon Sep 17 00:00:00 2001 From: Robert Dewar Date: Fri, 13 Jun 2014 10:04:27 +0000 Subject: [PATCH] debug.adb: Document debug flag -gnatd.1. 2014-06-13 Robert Dewar * 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 | 8 ++++++++ gcc/ada/debug.adb | 8 +++++++- gcc/ada/layout.adb | 8 +++++++- gcc/ada/sem_ch3.adb | 21 ++++++++++++++++++++- 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 3d1113cfe20..2065ccce8a2 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,11 @@ +2014-06-13 Robert Dewar + + * 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 * layout.adb (Layout_Type): Anonymous access types designating diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index eaab4ffbebe..4e62365c591 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 618b0f8d78f..7b0cdc5383e 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 938c28ea6b1..03e91543c28 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