[Patch, Fortran] PR 66227: [5/6/7 Regression] [OOP] EXTENDS_TYPE_OF n returns wrong result for polymorphic variable allocated to extended type

Janus Weil janus@gcc.gnu.org
Thu Nov 17 08:01:00 GMT 2016


Hi Mikael,

2016-11-16 22:59 GMT+01:00 Mikael Morin <morin-mikael@orange.fr>:
>> On top of that comes the complication that the arguments of
>> "gfc_type_is_extension_of" are in reversed order compared to
>> EXTENDS_TYPE_OF :(
>>
> And it’s probably the actual bug. Your patch in the end is a sort of
> exchange of the arguments, isn’t it?

huh, not quite. To me it looks more like a confusion of cases with
class/type vs type/class arguments ...


>> In any case, I have thought about the logic of
>> gfc_simplify_extends_type_of once again, and the only remaining
>> problem I found was a case where the result was correct, but we missed
>> some optimization, namely "(a1,b11)" in the test case. This was left
>> as a runtime-case, but in fact it can be evaluated to FALSE at compile
>> time.
>>
>> I fixed the simplification function and the test case accordingly, and
>> hope that everything should be fine now. Right? (Updated patch
>> attached ...)
>>
> Looks good to me. Thanks.

thank you for reviewing! Committed to trunk as r242535. I'll wait a
week or so before backporting to the release branches (given that no
problems appear in the meantime).

Cheers,
Janus



More information about the Fortran mailing list