------- Comment #2 from janus at gcc dot gnu dot org 2010-06-21 10:18 ------- My first idea to fix this was to add a new field to the vtabs, let's call it $def_init, which would be the fourth field in the vtab structure (after $hash, $size and $extends), and would contain the default initialization values for the type.
However, this approach does not work, since the field needed for default initialization would have to be of the derived type which the vtab belongs to. This however can have different sizes, so that the PPCs in the vtab will not be aligned any more for extended types, which messes up dynamic dispatch. Alternatives: (1) make $def_init a pointer (problem: initialization of $def_init itself) (2) add standalone variables a la "type_t$def_init" to carry default initialization for each type (3) ...? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44541