From: Bob Duff Date: Tue, 17 Aug 2021 15:02:51 +0000 (-0400) Subject: [Ada] Subprogram_Variant in ignored ghost code X-Git-Tag: basepoints/gcc-13~4283 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ea0b5b656a0e90bc9bb3ab0920796b24a9387d76;p=thirdparty%2Fgcc.git [Ada] Subprogram_Variant in ignored ghost code gcc/ada/ * exp_ch6.adb (Expand_Call_Helper): Do not call Check_Subprogram_Variant if the subprogram is an ignored ghost entity. Otherwise the compiler crashes (in debug builds) or gives strange error messages (in production builds). --- diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index ffd14759a7f1..ce0bb80825d2 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -4392,6 +4392,7 @@ package body Exp_Ch6 is -- the current subprogram is called. if Is_Subprogram (Subp) + and then not Is_Ignored_Ghost_Entity (Subp) and then Same_Or_Aliased_Subprograms (Subp, Current_Scope) then Check_Subprogram_Variant;