]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Use specific predicate before manipulating BIP_Alloc_Form
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 28 Mar 2022 19:16:24 +0000 (21:16 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 18 May 2022 08:41:06 +0000 (08:41 +0000)
For the sake of consistency with other similar manipulations.

gcc/ada/

* exp_ch7.adb (Build_BIP_Cleanup_Stmts): Use Needs_BIP_Alloc_Form.

gcc/ada/exp_ch7.adb

index 7434364651504631a3ff4343f3664fe9b53fdb13..0c53f3268870efaf87d16b5e3994eccae0a6bd04 100644 (file)
@@ -2850,16 +2850,14 @@ package body Exp_Ch7 is
                 Left_Opnd  => New_Occurrence_Of (Fin_Mas_Id, Loc),
                 Right_Opnd => Make_Null (Loc));
 
-            --  For constrained or tagged results escalate the condition to
+            --  For unconstrained or tagged results, escalate the condition to
             --  include the allocation format. Generate:
 
             --    if BIPallocform > Secondary_Stack'Pos
             --      and then BIPfinalizationmaster /= null
             --    then
 
-            if not Is_Constrained (Func_Typ)
-              or else Is_Tagged_Type (Func_Typ)
-            then
+            if Needs_BIP_Alloc_Form (Func_Id) then
                declare
                   Alloc : constant Entity_Id :=
                             Build_In_Place_Formal (Func_Id, BIP_Alloc_Form);