[Patch, Fortran] PR42888: [4.5 Regression] ICE in fold_convert_loc, at fold-const.c:2670

Janus Weil janus@gcc.gnu.org
Sun Jan 31 19:46:00 GMT 2010


Hi Tobias,

> Actually, why do you need a memcopy and cannot do a normal assignment?

for the test case I attached, a normal assignment would be sufficient.
The memcpy is needed for the general case that the dynamic type (which
is being allocated) is different from the declared type, i.e.
something like

  class(t1), allocatable :: x
  allocate (t2::x)

Here one can not just use a normal assignment, since this would only
copy those fields that are already present in the base type t1, but
not those which are added in the extended type t2.

Cheers,
Janus



More information about the Fortran mailing list