From: Gary Dismukes Date: Wed, 5 Aug 2020 20:29:30 +0000 (-0400) Subject: [Ada] Compiler crash on prefixed call to controlled function with invariant check X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=05eb5c6142c9406666c97c588ff2c9bdc1706562;p=gcc.git [Ada] Compiler crash on prefixed call to controlled function with invariant check gcc/ada/ * exp_ch6.adb (Insert_Post_Call_Actions): Test for N_Explicit_Dereference as part of the existing test for function calls. --- diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 7b50812a9e8..b04d1c023b7 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -8360,9 +8360,12 @@ package body Exp_Ch6 is -- The write-back of (in)-out parameters is handled by the back-end, -- but the constraint checks generated when subtypes of formal and -- actual don't match must be inserted in the form of assignments. + -- Also do this in the case of explicit dereferences, which can occur + -- due to rewritings of function calls with controlled results. if Nkind (N) = N_Function_Call or else Nkind (Original_Node (N)) = N_Function_Call + or else Nkind (N) = N_Explicit_Dereference then pragma Assert (Ada_Version >= Ada_2012); -- Functions with '[in] out' parameters are only allowed in Ada