public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Use specific predicate before manipulating BIP_Alloc_Form
@ 2022-05-18  8:43 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-18  8:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: Eric Botcazou

[-- Attachment #1: Type: text/plain, Size: 191 bytes --]

For the sake of consistency with other similar manipulations.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* exp_ch7.adb (Build_BIP_Cleanup_Stmts): Use Needs_BIP_Alloc_Form.

[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 952 bytes --]

diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb
--- a/gcc/ada/exp_ch7.adb
+++ b/gcc/ada/exp_ch7.adb
@@ -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);



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-18  8:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-18  8:43 [Ada] Use specific predicate before manipulating BIP_Alloc_Form Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).