aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-12-01 16:53:02 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-12-19 15:27:50 +0100
commit23508d3dc673de88af9a43d34d723863f1edd61d (patch)
tree0aaea8d4de22bba849377ee72e314bc6e353bf26 /gcc
parentb09d948e0520574d40587c086fa43ade7316d466 (diff)
downloadgcc-23508d3dc673de88af9a43d34d723863f1edd61d.zip
gcc-23508d3dc673de88af9a43d34d723863f1edd61d.tar.gz
gcc-23508d3dc673de88af9a43d34d723863f1edd61d.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/exp_ch6.adb7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index 195e34a..8e4c903 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);