Hi,

On 23 April 2017 at 10:51, Janus Weil <ja...@gcc.gnu.org> wrote:
> Hi Thomas,
>
>>> the patch in the attachment fixes a memory leak by auto-deallocating
>>> the allocatable components of an allocatable intent(out) argument.
>>>
>>> Regtests cleanly on x86_64-linux-gnu. Ok for trunk?
>>
>> OK for trunk.
>
> thanks for the review! Committed as r247083.

This patch causes an error message from DejaGnu:
    (DejaGnu) proc "cleanup-tree-dump original" does not exist.
I'm not familiar with fortran, so I'm not sure it is as obvious as
removing cleanup-tree-dump as it is done in the other neighboring tests?

Thanks,

Christophe

>
>
>> Also (because this is a quite serious bug)
>> OK for gcc 7 after the release of 7.1.
>
> I tend to be a bit hesitant with backporting non-regression-fixes, but
> in this case I agree that it might make sense. (Will commit to
> 7-branch once it's open again, if no one objects.)
>
> At least the patch fixes the leak in the least invasive way I could
> find, although I was thinking out loudly about ways to refactor the
> intent(out) handling:
>
>> My feeling is that it would be a good idea to handle allocatable derived 
>> types inside
>> of the callee as well. I can see at least two advantages:
>> * It would avoid code duplication if the procedure is called several times.
>> * It would take some complexity out of gfc_conv_procedure_call, which is 
>> quite a
>> monster.
>>
>> From the technical side a treatment in the callee should be possible AFAICS. 
>> I wonder
>> why it is being done in the caller at all?
>
>
> Any feedback is welcome here (possibly I'm missing some reason why
> this needs to be done by the caller?) ...
>
> Cheers,
> Janus

Reply via email to