Strange result with polymorphic variables
Arjen Markus
arjen.markus895@gmail.com
Mon Aug 29 13:45:00 GMT 2011
Hi Janus,
it is now bug 50225.
Regards,
Arjen
2011/8/29 Arjen Markus <arjen.markus895@gmail.com>:
> Hi Janus,
>
> 2011/8/29 Janus Weil <janus@gcc.gnu.org>:
>>> This is certainly a bug (and also the reason for the earlier
>>> segfault). I have the strong suspicion that we just forget to nullify
>>> allocatable CLASS results values on entry.
>>
>> Yes, this definitely is the problem. Find below a further reduced
>> version (without TBPs). It runs fine, but only without "-fcheck=all".
>> With runtime checking, one still gets errors about allocating already
>> allocated variables.
>>
>> When changing
>>
>> class(point2d), allocatable :: add_vector
>>
>> to
>>
>> type(point2d), allocatable :: add_vector
>>
>> the runtime errors go away. Also one can observe in the dump
>> (-fdump-tree-original), that for the TYPE variant, the result is
>> initialized to zero, while for the CLASS case it is not.
>>
>> Arjen, could you please file a PR for this? I'll try to take care of it soon.
>>
>
> I will do that.
>
> Regards,
>
> Arjen
>
More information about the Fortran
mailing list