This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran] PR42888: [4.5 Regression] ICE in fold_convert_loc, at fold-const.c:2670
- From: Janus Weil <janus at gcc dot gnu dot org>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 31 Jan 2010 19:35:38 +0100
- Subject: Re: [Patch, Fortran] PR42888: [4.5 Regression] ICE in fold_convert_loc, at fold-const.c:2670
- References: <854832d41001300411ya86336ana4ab1d0db3208664@mail.gmail.com> <4B65A2AF.2080902@net-b.de>
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