]> gcc.gnu.org Git - gcc.git/commit
ada: Fix internal error on conversion as in/out actual with -gnatVa
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 25 Nov 2022 09:28:18 +0000 (10:28 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 28 Nov 2022 12:02:31 +0000 (13:02 +0100)
commite75d06f9bfad341aea3565f95fffb8937de5f142
tree92b55422fd1fcd4e065cd44b612bfb947e7f3137
parentf2b30a724e6bf7ff8e591b176967d596cee7648e
ada: Fix internal error on conversion as in/out actual with -gnatVa

The problem is that the regular expansion of the conversion around the
call to the subprogram is disabled by the expansion of the validity check
around the same call, as documented in Expand_Actuals:

  --  This case is given higher priority because the subsequent check
  --  for type conversion may add an extra copy of the variable and
  --  prevent proper value propagation back in the original object.

Now the two mechanisms need to cooperate in order for the code to compile.

gcc/ada/

* exp_ch6.adb (Expand_Actuals.Add_Call_By_Copy_Code): Deal with a
reference to a validation variable in the actual.
(Expand_Actuals.Add_Validation_Call_By_Copy_Code): Minor tweak.
(Expand_Actuals): Call Add_Validation_Call_By_Copy_Code directly
only if Add_Call_By_Copy_Code is not to be invoked.
gcc/ada/exp_ch6.adb
This page took 0.062243 seconds and 6 git commands to generate.