[Patch, Fortran] PR42888: [4.5 Regression] ICE in fold_convert_loc, at fold-const.c:2670
Tobias Burnus
burnus@net-b.de
Sun Jan 31 16:47:00 GMT 2010
Janus Weil wrote:
> here is my fix for a regression which was introduced by one of my
> CLASS patches (allocation of CLASS variables). For technical reasons I
> had moved some code for setting up default initializers from
> resolution to translation stage. As the PR shows, this causes a couple
> of problems (see e.g. comments #9 and #13). So I'm moving the code
> back to resolve.c. I also had to make an addition to
> gfc_trans_class_assign, which takes care of memcpy'ing the default
> initializer into the CLASS container (which before was handled
> directly in gfc_trans_allocate).
>
Actually, why do you need a memcopy and cannot do a normal assignment?
For TYPE one gets:
{
struct t t.0;
t.0.x = -999;
*x = t.0;
}
whereas for CLASS one gets (with your patch):
{
struct t t.0;
t.0.x = -999;
(void) __builtin_memcpy ((void *) x.$data, (void *) &t.0, 4);
}
To my knowledge, using memcopy makes the alias analysis more difficult
and should thus be avoided.
Tobias
More information about the Fortran
mailing list