2016-12-20 17:07 GMT+01:00 Andre Vehreschild <ve...@gmx.de>:
> Hi Janus,
>
>> 1) After adding that code block in gfc_trans_assignment_1, it seems
>> like the comment above is outdated, right?
>
> Thanks for noting.
>
>> 2) Wouldn't it be better to move this block, which does the correct
>> allocation for CLASS variables, into
>> "alloc_scalar_allocatable_for_assignment", where the allocation for
>> all other cases is done?
>
> I tried to, but that would have meant to extend the interface of
> alloc_scalar_allocatable_for_assignment significantly, while at the location
> where I finally added the code, I could use the data available. Secondly
> putting the malloc at the correct location is not possible at alloc_scalar_...
> because the pre-blocks have already been joined to the body. That way the
> malloc was always placed either before even the vptr was set, or after the 
> data
> was copied. Both options were quite hazardous.
>
> I now went to add the allocation into trans_class_assignment (). This allows
> even more reuse of already present and needed data, e.g., the vptr.
>
> Bootstrapped and regtested ok on x86_64-linux/f23. Ok for trunk?

Thanks for the explanations. The patch is ok with me in this form.

Cheers,
Janus

Reply via email to