diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb index 9daa0110233bc2d0cc411aae64f86a06a7a79aea..2d0c32b0f094164675cd0a29f1a0a46c0d321877 100644 --- a/gcc/ada/debug.adb +++ b/gcc/ada/debug.adb @@ -180,7 +180,7 @@ package body Debug is -- d_M Ignore Source_File_Name and Source_File_Name_Project pragmas -- d_N -- d_O - -- d_P Enable runtime check for null prefix of prefixed subprogram call + -- d_P Disable runtime check for null prefix of prefixed subprogram call -- d_Q -- d_R For LLVM, dump the representation of records -- d_S @@ -1040,13 +1040,14 @@ package body Debug is -- it is checked, and the progress of the recursive trace through -- elaboration calls at compile time. - -- d_P For prefixed subprogram calls with an access-type prefix, generate - -- a null-excluding runtime check on the prefix, even when the called - -- subprogram has a first access parameter that does not exclude null - -- (that is the case only for class-wide parameter, as controlling - -- parameters are automatically null-excluding). In such a case, - -- P.Proc is equivalent to Proc(P.all'Access); see RM 6.4(9.1/5). - -- This includes a dereference, and thus a null check. + -- d_P For prefixed subprogram calls with an access-type prefix, disable + -- the generation of a null-excluding runtime check on the prefix, + -- even when the called subprogram has a first access parameter that + -- does not exclude null (that is the case only for class-wide + -- parameter, as controlling parameters are automatically null- + -- excluding). In such a case, P.Proc is equivalent to the call + -- Proc(P.all'Access); see RM 6.4(9.1/5). This includes a dereference, + -- and thus a null check. -- d_R In the LLVM backend, output the internal representation of -- each record diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index d2b019aef173bd549189d89684f26f1105812605..2d0e2be18497a0dc384f2e23b28c7c1531b0a6f3 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -4942,7 +4942,7 @@ package body Sem_Res is A, Nam); end if; - if Debug_Flag_Underscore_PP + if not Debug_Flag_Underscore_PP and then (Is_Controlling_Formal (F) or else Is_Class_Wide_Type (Designated_Type (F_Typ)))