From 5512eabc3e162c2c1e4c54febc716353519e51f0 Mon Sep 17 00:00:00 2001 From: Bob Duff Date: Thu, 28 Apr 2022 10:22:42 -0400 Subject: [Ada] Incorrect code for anonymous access-to-function with convention C This patch fixes a bug where the compiler generates incorrect code for a call via an object with convention C, whose type is an anonymous access-to-function type. gcc/ada/ * einfo-utils.adb (Set_Convention): Call Set_Convention recursively, so that Set_Can_Use_Internal_Rep is called (if appropriate) on the anonymous access type of the object, and its designated subprogram type. * sem_ch3.adb (Access_Definition): Remove redundant call to Set_Can_Use_Internal_Rep. --- gcc/ada/sem_ch3.adb | 3 --- 1 file changed, 3 deletions(-) (limited to 'gcc/ada/sem_ch3.adb') diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 34dac1d..b7f26a3 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -876,9 +876,6 @@ package body Sem_Ch3 is Mutate_Ekind (Anon_Type, E_Anonymous_Access_Subprogram_Type); end if; - Set_Can_Use_Internal_Rep - (Anon_Type, not Always_Compatible_Rep_On_Target); - -- If the anonymous access is associated with a protected operation, -- create a reference to it after the enclosing protected definition -- because the itype will be used in the subsequent bodies. -- cgit v1.1