[Ada] Wrong initialization of Offset_To_Top in secondary DT
The compiler does not initialize well the runtime information required
to perform at runtime interface conversions on derivations of tagged
types that implement interfaces and have variable size components.
2019-08-13 Javier Miranda <miranda@adacore.com>
gcc/ada/
* exp_disp.adb (Make_Secondary_DT): Handle record type
derivations that have interface components located at fixed
positions and interface components located at variable offset.
The offset of components located at fixed positions is computed
using the dummy object (similar to the case where all the
interface components are located at fixed positions).
(Make_DT): Build the dummy object for all tagged types that
implement interface types (that is, build it also for types with
variable size components), and use the dummy object to compute
the offset of all tag components located at fixed positions when
initializing the Interface_Table object.
gcc/testsuite/
* gnat.dg/tag2.adb, gnat.dg/tag2_pkg.ads: New testcase.
From-SVN: r274335