This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]