------- Comment #1 from rguenth at gcc dot gnu dot org 2010-06-19 19:16 ------- static struct vtype$periodic_5th_factory vtab$periodic_5th_factory = {.$hash=9935896, .$size=0, .$extends=&vtab$field_factory};
... if (vtab$periodic_5th_factory.create == 0B) { vtab$periodic_5th_factory.create = new_periodic_5th_order; } field_creator.$vptr = (struct vtype$field_factory *) &vtab$periodic_5th_factory; u = VIEW_CONVERT_EXPR<struct class$field_p>(field_creator.$vptr->create (&field_creator)); is broken. You access struct vtype$periodic_5th_factory via a pointer of type struct vtype$field_factory but they are not in any way related. Look into alias.c:record_component_aliases and provide proper BINFOs, or if that is not possible make sure to disable TBAA for vtables by making all pointers to them ref-all. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44596