http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60718

--- Comment #9 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
yes, thanks. When the test case is valid, then probably the IL is invalid.

append_node (struct list_type & restrict list, struct
__class_poly_list_Node_type & new_node)
{
  if (list->head._data == 0B)
    {
      list->head = VIEW_CONVERT_EXPR<struct
__class_poly_list_Node_type_p>(*new_node);
    }
  L.4:;
  if (list->tail._data != 0B)
    {
      list->tail._data->next = VIEW_CONVERT_EXPR<struct
__class_poly_list_Node_type_p>(*new_node);
    }
  L.5:;
  list->tail = VIEW_CONVERT_EXPR<struct
__class_poly_list_Node_type_p>(*new_node);
  return;
}

MAIN__ ()
{
  static struct list_type list = {.head={._data=0B,
._vptr=&__vtab_poly_list_Node_type}, .tail={._data=0B,
._vptr=&__vtab_poly_list_Node_type}};
  struct __class_poly_list_Node_type_p node;

  node._data = (struct node_type *) __builtin_malloc (8);
  if (node._data == 0B)
    {
      _gfortran_os_error (&"Reservierung würde Speichergrenze
überschreiten"[1]{lb: 1 sz: 1});
    }
  (struct __vtype_poly_list_Node_type *) node._vptr =
&__vtab_poly_list_Node_type;
  (void) __builtin_memcpy ((void *) node._data, (void *) node._vptr->_def_init,
(character(kind=4)) node._vptr->_size);
  append_node (&list, &node);
  destroy_list (&list);
}

maybe we need a type-cast in the call statement?

  append_node (&list, VIEW_CONVERT_EXPR<struct __class_poly_list_Node_type
*>(&node));

Reply via email to