[gcc r14-6707] ada: Rework comment in Expand_Ctrl_Function_Call

Marc Poulhi?s dkm@gcc.gnu.org
Tue Dec 19 14:30:39 GMT 2023


https://gcc.gnu.org/g:23508d3dc673de88af9a43d34d723863f1edd61d

commit r14-6707-g23508d3dc673de88af9a43d34d723863f1edd61d
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Fri Dec 1 16:53:02 2023 +0100

    ada: Rework comment in Expand_Ctrl_Function_Call
    
    This expands on the reason for properly guarding the transformation.
    
    gcc/ada/
    
            * exp_ch6.adb (Expand_Ctrl_Function_Call): Rework last comment.

Diff:
---
 gcc/ada/exp_ch6.adb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index 195e34a3479..8e4c9035b22 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -5477,7 +5477,12 @@ package body Exp_Ch6 is
 
       Set_Analyzed (N);
 
-      --  Apply the transformation, unless it was already applied manually
+      --  Apply the transformation unless it was already applied earlier. This
+      --  may happen because Remove_Side_Effects can be called during semantic
+      --  analysis, for example from Build_Actual_Subtype_Of_Component. It is
+      --  crucial to avoid creating a reference of reference here, because it
+      --  would not be subsequently recognized by the Is_Finalizable_Transient
+      --  and Requires_Cleanup_Actions predicates.
 
       if Nkind (Par) /= N_Reference then
          Remove_Side_Effects (N);


More information about the Gcc-cvs mailing list