]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: TSS finalize address subprogram generation for constrained...
authorRichard Wai <richard@annexi-strayline.com>
Sun, 17 Sep 2023 15:00:00 +0000 (11:00 -0400)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 19 Sep 2023 12:00:12 +0000 (14:00 +0200)
commit005888670a1a0e26d818449a0fbbc5eb3541e303
tree404978c49d2caad1cd8bd4e1d626d562eb185d94
parenteceb45bb2e0bf5518d9bd873e25a498456af8e1f
ada: TSS finalize address subprogram generation for constrained...

...subtypes of unconstrained synchronized private extensions should take
care to designate the corresponding record of the underlying concurrent
type.

When generating TSS finalize address subprograms for class-wide types of
constrained root types, it follows the parent chain looking for the
first "non-constrained" type. It is possible that such a type is a
private extension with the “synchronized” keyword, in which case the
underlying type is a concurrent type. When that happens, the designated
type of the finalize address subprogram should be the corresponding
record’s class-wide-type.

gcc/ada/ChangeLog:
* exp_ch3.adb (Expand_Freeze_Class_Wide_Type): Expanded comments
explaining why TSS Finalize_Address is not generated for
concurrent class-wide types.
* exp_ch7.adb (Make_Finalize_Address_Stmts): Handle cases where the
underlying non-constrained parent type is a concurrent type, and
adjust the designated type to be the corresponding record’s
class-wide type.

gcc/testsuite/ChangeLog:

* gnat.dg/sync_tag_finalize.adb: New test.

Signed-off-by: Richard Wai <richard@annexi-strayline.com>
gcc/ada/exp_ch3.adb
gcc/ada/exp_ch7.adb
gcc/testsuite/gnat.dg/sync_tag_finalize.adb [new file with mode: 0644]