Fix internal error on function returning dynamically-sized type
commit4d8b41bb0512947ce13636fc460ea9fb8dea419a
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 16 Nov 2023 17:36:44 +0000 (16 18:36 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Thu, 16 Nov 2023 17:38:23 +0000 (16 18:38 +0100)
treeb1849828717df680f4b0c4fb3c494a8daf06f99e
parent23725aa53bd264941c4fb228227736be4da59761
Fix internal error on function returning dynamically-sized type

This is a tree sharing issue for the internal return type synthesized for
a function returning a dynamically-sized type and taking an Out or In/Out
parameter passed by copy.

gcc/ada/
* gcc-interface/decl.cc (gnat_to_gnu_subprog_type): Also create a
TYPE_DECL for the return type built for the CI/CO mechanism.

gcc/testsuite/
* gnat.dg/varsize4.ads, gnat.dg/varsize4.adb: New test.
* gnat.dg/varsize4_pkg.ads: New helper.
gcc/ada/gcc-interface/decl.cc
gcc/testsuite/gnat.dg/varsize4.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/varsize4.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/varsize4_pkg.ads [new file with mode: 0644]